diff --git a/api/v1beta2/appwrapper_types.go b/api/v1beta2/appwrapper_types.go index 91c3b4b..4b6cd13 100644 --- a/api/v1beta2/appwrapper_types.go +++ b/api/v1beta2/appwrapper_types.go @@ -22,57 +22,88 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) -// AppWrapperSpec defines the desired state of the appwrapper +// AppWrapperSpec defines the desired state of the AppWrapper type AppWrapperSpec struct { - // Components lists the components in the job + // Components lists the components contained in the AppWrapper Components []AppWrapperComponent `json:"components"` - // Suspend suspends the job when set to true + // Suspend suspends the AppWrapper when set to true + //+optional Suspend bool `json:"suspend,omitempty"` } -// AppWrapperComponent describes a wrapped resource +// AppWrapperComponent describes a single wrapped Kubernetes resource type AppWrapperComponent struct { - // PodSets contained in the component + // Annotations is an unstructured key value map that may be used to store and retrieve + // arbitrary metadata about the Component to customize its treatment by the AppWrapper controller. + //+optional + Annotations map[string]string `json:"annotations,omitempty"` + + // PodSets contained in the Component + //+optional PodSets []AppWrapperPodSet `json:"podSets,omitempty"` - // PodSetInfos assigned to the Component by Kueue + // PodSetInfos assigned to the Component's PodSets by Kueue + //+optional PodSetInfos []AppWrapperPodSetInfo `json:"podSetInfos,omitempty"` // +kubebuilder:pruning:PreserveUnknownFields // +kubebuilder:validation:EmbeddedResource - // Template for the component + // Template defines the Kubernetes resource for the Component Template runtime.RawExtension `json:"template"` } // AppWrapperPodSet describes an homogeneous set of pods type AppWrapperPodSet struct { - // Replicas is the number of pods in the set + // Replicas is the number of pods in this PodSet + //+optional Replicas *int32 `json:"replicas,omitempty"` - // ReplicaPath is the path to the replica count for the set + // ReplicaPath is the path within Component.Template to the replica count for this PodSet + //+optional ReplicaPath string `json:"replicaPath,omitempty"` - // PodPath is the path to the PodTemplateSpec + // PodPath is the path Component.Template to the PodTemplateSpec for this PodSet PodPath string `json:"podPath"` } +// AppWrapperPodSetInfo contains the data that Kueue wants to inject into an admitted PodSpecTemplate type AppWrapperPodSetInfo struct { - Annotations map[string]string `json:"annotations,omitempty"` - Labels map[string]string `json:"labels,omitempty"` - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - Tolerations []corev1.Toleration `json:"tolerations,omitempty"` + // Annotations to be added to the PodSpecTemplate + //+optional + Annotations map[string]string `json:"annotations,omitempty"` + // Labels to be added to the PodSepcTemplate + //+optional + Labels map[string]string `json:"labels,omitempty"` + // NodeSelectors to be added to the PodSpecTemplate + //+optional + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + // Tolerations to be added to the PodSpecTemplate + //+optional + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` } // AppWrapperStatus defines the observed state of the appwrapper type AppWrapperStatus struct { // Phase of the AppWrapper object + //+optional Phase AppWrapperPhase `json:"phase,omitempty"` // Retries counts the number of times the AppWrapper has entered the Resetting Phase + //+optional Retries int32 `json:"resettingCount,omitempty"` - // Conditions + // Conditions hold the latest available observations of the AppWrapper current state. + // + // The type of the condition could be: + // + // - QuotaReserved: The AppWrapper was admitted by Kueue and has quota allocated to it + // - ResourcesDeployed: The contained resources are deployed (or being deployed) on the cluster + // - PodsReady: All pods of the contained resources are in the Ready or Succeeded state + // - Unhealthy: One or more of the contained resources is unhealthy + // - DeletingResources: The contained resources are in the process of being deleted from the cluster + // + //+optional Conditions []metav1.Condition `json:"conditions,omitempty"` } diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index f2b1147..776ad88 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -56,6 +56,13 @@ func (in *AppWrapper) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AppWrapperComponent) DeepCopyInto(out *AppWrapperComponent) { *out = *in + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } if in.PodSets != nil { in, out := &in.PodSets, &out.PodSets *out = make([]AppWrapperPodSet, len(*in)) diff --git a/config/crd/bases/workload.codeflare.dev_appwrappers.yaml b/config/crd/bases/workload.codeflare.dev_appwrappers.yaml index 92686d8..3cf8383 100644 --- a/config/crd/bases/workload.codeflare.dev_appwrappers.yaml +++ b/config/crd/bases/workload.codeflare.dev_appwrappers.yaml @@ -50,30 +50,45 @@ spec: metadata: type: object spec: - description: AppWrapperSpec defines the desired state of the appwrapper + description: AppWrapperSpec defines the desired state of the AppWrapper properties: components: - description: Components lists the components in the job + description: Components lists the components contained in the AppWrapper items: - description: AppWrapperComponent describes a wrapped resource + description: AppWrapperComponent describes a single wrapped Kubernetes + resource properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations is an unstructured key value map that may be used to store and retrieve + arbitrary metadata about the Component to customize its treatment by the AppWrapper controller. + type: object podSetInfos: - description: PodSetInfos assigned to the Component by Kueue + description: PodSetInfos assigned to the Component's PodSets + by Kueue items: + description: AppWrapperPodSetInfo contains the data that Kueue + wants to inject into an admitted PodSpecTemplate properties: annotations: additionalProperties: type: string + description: Annotations to be added to the PodSpecTemplate type: object labels: additionalProperties: type: string + description: Labels to be added to the PodSepcTemplate type: object nodeSelector: additionalProperties: type: string + description: NodeSelectors to be added to the PodSpecTemplate type: object tolerations: + description: Tolerations to be added to the PodSpecTemplate items: description: |- The pod this Toleration is attached to tolerates any taint that matches @@ -114,20 +129,21 @@ spec: type: object type: array podSets: - description: PodSets contained in the component + description: PodSets contained in the Component items: description: AppWrapperPodSet describes an homogeneous set of pods properties: podPath: - description: PodPath is the path to the PodTemplateSpec + description: PodPath is the path Component.Template to + the PodTemplateSpec for this PodSet type: string replicaPath: - description: ReplicaPath is the path to the replica count - for the set + description: ReplicaPath is the path within Component.Template + to the replica count for this PodSet type: string replicas: - description: Replicas is the number of pods in the set + description: Replicas is the number of pods in this PodSet format: int32 type: integer required: @@ -135,7 +151,8 @@ spec: type: object type: array template: - description: Template for the component + description: Template defines the Kubernetes resource for the + Component type: object x-kubernetes-embedded-resource: true x-kubernetes-preserve-unknown-fields: true @@ -144,7 +161,7 @@ spec: type: object type: array suspend: - description: Suspend suspends the job when set to true + description: Suspend suspends the AppWrapper when set to true type: boolean required: - components @@ -153,7 +170,18 @@ spec: description: AppWrapperStatus defines the observed state of the appwrapper properties: conditions: - description: Conditions + description: |- + Conditions hold the latest available observations of the AppWrapper current state. + + + The type of the condition could be: + + + - QuotaReserved: The AppWrapper was admitted by Kueue and has quota allocated to it + - ResourcesDeployed: The contained resources are deployed (or being deployed) on the cluster + - PodsReady: All pods of the contained resources are in the Ready or Succeeded state + - Unhealthy: One or more of the contained resources is unhealthy + - DeletingResources: The contained resources are in the process of being deleted from the cluster items: description: "Condition contains details for one aspect of the current state of this API Resource.\n---\nThis struct is intended for diff --git a/site/_pages/appwrapper.v1beta2.md b/site/_pages/appwrapper.v1beta2.md index 19b2bde..6840628 100644 --- a/site/_pages/appwrapper.v1beta2.md +++ b/site/_pages/appwrapper.v1beta2.md @@ -49,7 +49,7 @@ Generated API reference documentation for . - [AppWrapperSpec](#workload-codeflare-dev-v1beta2-AppWrapperSpec) -

AppWrapperComponent describes a wrapped resource

+

AppWrapperComponent describes a single wrapped Kubernetes resource

@@ -57,25 +57,33 @@ Generated API reference documentation for . - + + + - @@ -111,25 +119,25 @@ Generated API reference documentation for . - - @@ -143,35 +151,41 @@ Generated API reference documentation for . - [AppWrapperComponent](#workload-codeflare-dev-v1beta2-AppWrapperComponent) +

AppWrapperPodSetInfo contains the data that Kueue wants to inject into an admitted PodSpecTemplate

+
podSets [Required]
+
annotations
+map[string]string +
+

Annotations is an unstructured key value map that may be used to store and retrieve +arbitrary metadata about the Component to customize its treatment by the AppWrapper controller.

+
podSets
[]AppWrapperPodSet
-

PodSets contained in the component

+

PodSets contained in the Component

podSetInfos [Required]
+
podSetInfos
[]AppWrapperPodSetInfo
-

PodSetInfos assigned to the Component by Kueue

+

PodSetInfos assigned to the Component's PodSets by Kueue

template [Required]
k8s.io/apimachinery/pkg/runtime.RawExtension
-

Template for the component

+

Template defines the Kubernetes resource for the Component

replicas [Required]
+
replicas
int32
-

Replicas is the number of pods in the set

+

Replicas is the number of pods in this PodSet

replicaPath [Required]
+
replicaPath
string
-

ReplicaPath is the path to the replica count for the set

+

ReplicaPath is the path within Component.Template to the replica count for this PodSet

podPath [Required]
string
-

PodPath is the path to the PodTemplateSpec

+

PodPath is the path Component.Template to the PodTemplateSpec for this PodSet

- +

Annotations to be added to the PodSpecTemplate

+ - +

Labels to be added to the PodSepcTemplate

+ - +

NodeSelectors to be added to the PodSpecTemplate

+ - +

Tolerations to be added to the PodSpecTemplate

+
FieldDescription
annotations [Required]
+
annotations
map[string]string
- No description provided.
labels [Required]
+
labels
map[string]string
- No description provided.
nodeSelector [Required]
+
nodeSelector
map[string]string
- No description provided.
tolerations [Required]
+
tolerations
[]k8s.io/api/core/v1.Toleration
- No description provided.
@@ -184,7 +198,7 @@ Generated API reference documentation for . - [AppWrapper](#workload-codeflare-dev-v1beta2-AppWrapper) -

AppWrapperSpec defines the desired state of the appwrapper

+

AppWrapperSpec defines the desired state of the AppWrapper

@@ -196,14 +210,14 @@ Generated API reference documentation for . []AppWrapperComponent - @@ -225,25 +239,33 @@ Generated API reference documentation for . - - -
-

Components lists the components in the job

+

Components lists the components contained in the AppWrapper

suspend [Required]
+
suspend
bool
-

Suspend suspends the job when set to true

+

Suspend suspends the AppWrapper when set to true

phase [Required]
+
phase
AppWrapperPhase

Phase of the AppWrapper object

resettingCount [Required]
+
resettingCount
int32

Retries counts the number of times the AppWrapper has entered the Resetting Phase

conditions [Required]
+
conditions
[]k8s.io/apimachinery/pkg/apis/meta/v1.Condition
-

Conditions

+

Conditions hold the latest available observations of the AppWrapper current state.

+

The type of the condition could be:

+
    +
  • QuotaReserved: The AppWrapper was admitted by Kueue and has quota allocated to it
  • +
  • ResourcesDeployed: The contained resources are deployed (or being deployed) on the cluster
  • +
  • PodsReady: All pods of the contained resources are in the Ready or Succeeded state
  • +
  • Unhealthy: One or more of the contained resources is unhealthy
  • +
  • DeletingResources: The contained resources are in the process of being deleted from the cluster
  • +