From 21bc40bcf422d108627b4e2d31ead9d067ad7bc1 Mon Sep 17 00:00:00 2001 From: Daniel Vega-Myhre Date: Sat, 9 Mar 2024 00:30:18 +0000 Subject: [PATCH 1/2] add descriptions to replicatedJobStatus fields --- api/jobset/v1alpha2/jobset_types.go | 25 ++++++++++++++----- .../crd/bases/jobset.x-k8s.io_jobsets.yaml | 12 +++++++++ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/api/jobset/v1alpha2/jobset_types.go b/api/jobset/v1alpha2/jobset_types.go index 6c8fb64a6..36fd87703 100644 --- a/api/jobset/v1alpha2/jobset_types.go +++ b/api/jobset/v1alpha2/jobset_types.go @@ -115,12 +115,25 @@ type JobSetStatus struct { // ReplicatedJobStatus defines the observed ReplicatedJobs Readiness. type ReplicatedJobStatus struct { - Name string `json:"name"` - Ready int32 `json:"ready"` - Succeeded int32 `json:"succeeded"` - Failed int32 `json:"failed"` - Active int32 `json:"active"` - Suspended int32 `json:"suspended"` + // Name of the ReplicatedJob. + Name string `json:"name"` + + // Ready is the number of child Jobs where number of ready pods + completed pods >= total expected pod count + // for the Job (i.e., minimum of job.spec.parallelism and job.spec.completions). + Ready int32 `json:"ready"` + + // Succeeded is the number of successfully completed child Jobs. + Succeeded int32 `json:"succeeded"` + + // Failed is the number of failed child Jobs. + Failed int32 `json:"failed"` + + // Active is the number of child Jobs with at least 1 pod in a running or pending state, which are not + // marked for deletion. + Active int32 `json:"active"` + + // Suspended is the number of child Jobs which are in a suspended state. + Suspended int32 `json:"suspended"` } // +genclient diff --git a/config/components/crd/bases/jobset.x-k8s.io_jobsets.yaml b/config/components/crd/bases/jobset.x-k8s.io_jobsets.yaml index f6cf9b685..ff37ef82a 100644 --- a/config/components/crd/bases/jobset.x-k8s.io_jobsets.yaml +++ b/config/components/crd/bases/jobset.x-k8s.io_jobsets.yaml @@ -8415,20 +8415,32 @@ spec: Readiness. properties: active: + description: |- + Active is the number of child Jobs with at least 1 pod in a running or pending state, which are not + marked for deletion. format: int32 type: integer failed: + description: Failed is the number of failed child Jobs. format: int32 type: integer name: + description: Name of the ReplicatedJob. type: string ready: + description: |- + Ready is the number of child Jobs where number of ready pods + completed pods >= total expected pod count + for the Job (i.e., minimum of job.spec.parallelism and job.spec.completions). format: int32 type: integer succeeded: + description: Succeeded is the number of successfully completed + child Jobs. format: int32 type: integer suspended: + description: Suspended is the number of child Jobs which are + in a suspended state. format: int32 type: integer required: From 2743fed2384190d6ee685bbee866bac220882a62 Mon Sep 17 00:00:00 2001 From: Daniel Vega-Myhre Date: Sat, 9 Mar 2024 00:59:36 +0000 Subject: [PATCH 2/2] update generated clients --- api/jobset/v1alpha2/jobset_types.go | 9 ++-- api/jobset/v1alpha2/openapi_generated.go | 42 +++++++++++-------- .../crd/bases/jobset.x-k8s.io_jobsets.yaml | 9 ++-- hack/python-sdk/swagger.json | 6 +++ .../docs/JobsetV1alpha2ReplicatedJobStatus.md | 12 +++--- .../jobset_v1alpha2_replicated_job_status.py | 12 ++++++ 6 files changed, 58 insertions(+), 32 deletions(-) diff --git a/api/jobset/v1alpha2/jobset_types.go b/api/jobset/v1alpha2/jobset_types.go index 36fd87703..d0a417b4b 100644 --- a/api/jobset/v1alpha2/jobset_types.go +++ b/api/jobset/v1alpha2/jobset_types.go @@ -118,8 +118,9 @@ type ReplicatedJobStatus struct { // Name of the ReplicatedJob. Name string `json:"name"` - // Ready is the number of child Jobs where number of ready pods + completed pods >= total expected pod count - // for the Job (i.e., minimum of job.spec.parallelism and job.spec.completions). + // Ready is the number of child Jobs where the number of ready pods and completed pods + // is greater than or equal to the total expected pod count for the Job (i.e., the minimum + // of job.spec.parallelism and job.spec.completions). Ready int32 `json:"ready"` // Succeeded is the number of successfully completed child Jobs. @@ -128,8 +129,8 @@ type ReplicatedJobStatus struct { // Failed is the number of failed child Jobs. Failed int32 `json:"failed"` - // Active is the number of child Jobs with at least 1 pod in a running or pending state, which are not - // marked for deletion. + // Active is the number of child Jobs with at least 1 pod in a running or pending state + // which are not marked for deletion. Active int32 `json:"active"` // Suspended is the number of child Jobs which are in a suspended state. diff --git a/api/jobset/v1alpha2/openapi_generated.go b/api/jobset/v1alpha2/openapi_generated.go index afec70269..3c2c11bce 100644 --- a/api/jobset/v1alpha2/openapi_generated.go +++ b/api/jobset/v1alpha2/openapi_generated.go @@ -359,44 +359,50 @@ func schema_jobset_api_jobset_v1alpha2_ReplicatedJobStatus(ref common.ReferenceC Properties: map[string]spec.Schema{ "name": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Description: "Name of the ReplicatedJob.", + Default: "", + Type: []string{"string"}, + Format: "", }, }, "ready": { SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", + Description: "Ready is the number of child Jobs where the number of ready pods and completed pods is greater than or equal to the total expected pod count for the Job (i.e., the minimum of job.spec.parallelism and job.spec.completions).", + Default: 0, + Type: []string{"integer"}, + Format: "int32", }, }, "succeeded": { SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", + Description: "Succeeded is the number of successfully completed child Jobs.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", }, }, "failed": { SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", + Description: "Failed is the number of failed child Jobs.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", }, }, "active": { SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", + Description: "Active is the number of child Jobs with at least 1 pod in a running or pending state which are not marked for deletion.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", }, }, "suspended": { SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", + Description: "Suspended is the number of child Jobs which are in a suspended state.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", }, }, }, diff --git a/config/components/crd/bases/jobset.x-k8s.io_jobsets.yaml b/config/components/crd/bases/jobset.x-k8s.io_jobsets.yaml index ff37ef82a..33f532f67 100644 --- a/config/components/crd/bases/jobset.x-k8s.io_jobsets.yaml +++ b/config/components/crd/bases/jobset.x-k8s.io_jobsets.yaml @@ -8416,8 +8416,8 @@ spec: properties: active: description: |- - Active is the number of child Jobs with at least 1 pod in a running or pending state, which are not - marked for deletion. + Active is the number of child Jobs with at least 1 pod in a running or pending state + which are not marked for deletion. format: int32 type: integer failed: @@ -8429,8 +8429,9 @@ spec: type: string ready: description: |- - Ready is the number of child Jobs where number of ready pods + completed pods >= total expected pod count - for the Job (i.e., minimum of job.spec.parallelism and job.spec.completions). + Ready is the number of child Jobs where the number of ready pods and completed pods + is greater than or equal to the total expected pod count for the Job (i.e., the minimum + of job.spec.parallelism and job.spec.completions). format: int32 type: integer succeeded: diff --git a/hack/python-sdk/swagger.json b/hack/python-sdk/swagger.json index 7e95733c3..a24816955 100644 --- a/hack/python-sdk/swagger.json +++ b/hack/python-sdk/swagger.json @@ -193,30 +193,36 @@ ], "properties": { "active": { + "description": "Active is the number of child Jobs with at least 1 pod in a running or pending state which are not marked for deletion.", "type": "integer", "format": "int32", "default": 0 }, "failed": { + "description": "Failed is the number of failed child Jobs.", "type": "integer", "format": "int32", "default": 0 }, "name": { + "description": "Name of the ReplicatedJob.", "type": "string", "default": "" }, "ready": { + "description": "Ready is the number of child Jobs where the number of ready pods and completed pods is greater than or equal to the total expected pod count for the Job (i.e., the minimum of job.spec.parallelism and job.spec.completions).", "type": "integer", "format": "int32", "default": 0 }, "succeeded": { + "description": "Succeeded is the number of successfully completed child Jobs.", "type": "integer", "format": "int32", "default": 0 }, "suspended": { + "description": "Suspended is the number of child Jobs which are in a suspended state.", "type": "integer", "format": "int32", "default": 0 diff --git a/sdk/python/docs/JobsetV1alpha2ReplicatedJobStatus.md b/sdk/python/docs/JobsetV1alpha2ReplicatedJobStatus.md index b5edb8d2c..09e1dea46 100644 --- a/sdk/python/docs/JobsetV1alpha2ReplicatedJobStatus.md +++ b/sdk/python/docs/JobsetV1alpha2ReplicatedJobStatus.md @@ -4,12 +4,12 @@ ReplicatedJobStatus defines the observed ReplicatedJobs Readiness. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**active** | **int** | | [default to 0] -**failed** | **int** | | [default to 0] -**name** | **str** | | [default to ''] -**ready** | **int** | | [default to 0] -**succeeded** | **int** | | [default to 0] -**suspended** | **int** | | [default to 0] +**active** | **int** | Active is the number of child Jobs with at least 1 pod in a running or pending state which are not marked for deletion. | [default to 0] +**failed** | **int** | Failed is the number of failed child Jobs. | [default to 0] +**name** | **str** | Name of the ReplicatedJob. | [default to ''] +**ready** | **int** | Ready is the number of child Jobs where the number of ready pods and completed pods is greater than or equal to the total expected pod count for the Job (i.e., the minimum of job.spec.parallelism and job.spec.completions). | [default to 0] +**succeeded** | **int** | Succeeded is the number of successfully completed child Jobs. | [default to 0] +**suspended** | **int** | Suspended is the number of child Jobs which are in a suspended state. | [default to 0] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/sdk/python/jobset/models/jobset_v1alpha2_replicated_job_status.py b/sdk/python/jobset/models/jobset_v1alpha2_replicated_job_status.py index f5b2ca849..e278c81e9 100644 --- a/sdk/python/jobset/models/jobset_v1alpha2_replicated_job_status.py +++ b/sdk/python/jobset/models/jobset_v1alpha2_replicated_job_status.py @@ -75,6 +75,7 @@ def __init__(self, active=0, failed=0, name='', ready=0, succeeded=0, suspended= def active(self): """Gets the active of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 + Active is the number of child Jobs with at least 1 pod in a running or pending state which are not marked for deletion. # noqa: E501 :return: The active of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 :rtype: int @@ -85,6 +86,7 @@ def active(self): def active(self, active): """Sets the active of this JobsetV1alpha2ReplicatedJobStatus. + Active is the number of child Jobs with at least 1 pod in a running or pending state which are not marked for deletion. # noqa: E501 :param active: The active of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 :type: int @@ -98,6 +100,7 @@ def active(self, active): def failed(self): """Gets the failed of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 + Failed is the number of failed child Jobs. # noqa: E501 :return: The failed of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 :rtype: int @@ -108,6 +111,7 @@ def failed(self): def failed(self, failed): """Sets the failed of this JobsetV1alpha2ReplicatedJobStatus. + Failed is the number of failed child Jobs. # noqa: E501 :param failed: The failed of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 :type: int @@ -121,6 +125,7 @@ def failed(self, failed): def name(self): """Gets the name of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 + Name of the ReplicatedJob. # noqa: E501 :return: The name of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 :rtype: str @@ -131,6 +136,7 @@ def name(self): def name(self, name): """Sets the name of this JobsetV1alpha2ReplicatedJobStatus. + Name of the ReplicatedJob. # noqa: E501 :param name: The name of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 :type: str @@ -144,6 +150,7 @@ def name(self, name): def ready(self): """Gets the ready of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 + Ready is the number of child Jobs where the number of ready pods and completed pods is greater than or equal to the total expected pod count for the Job (i.e., the minimum of job.spec.parallelism and job.spec.completions). # noqa: E501 :return: The ready of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 :rtype: int @@ -154,6 +161,7 @@ def ready(self): def ready(self, ready): """Sets the ready of this JobsetV1alpha2ReplicatedJobStatus. + Ready is the number of child Jobs where the number of ready pods and completed pods is greater than or equal to the total expected pod count for the Job (i.e., the minimum of job.spec.parallelism and job.spec.completions). # noqa: E501 :param ready: The ready of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 :type: int @@ -167,6 +175,7 @@ def ready(self, ready): def succeeded(self): """Gets the succeeded of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 + Succeeded is the number of successfully completed child Jobs. # noqa: E501 :return: The succeeded of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 :rtype: int @@ -177,6 +186,7 @@ def succeeded(self): def succeeded(self, succeeded): """Sets the succeeded of this JobsetV1alpha2ReplicatedJobStatus. + Succeeded is the number of successfully completed child Jobs. # noqa: E501 :param succeeded: The succeeded of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 :type: int @@ -190,6 +200,7 @@ def succeeded(self, succeeded): def suspended(self): """Gets the suspended of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 + Suspended is the number of child Jobs which are in a suspended state. # noqa: E501 :return: The suspended of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 :rtype: int @@ -200,6 +211,7 @@ def suspended(self): def suspended(self, suspended): """Sets the suspended of this JobsetV1alpha2ReplicatedJobStatus. + Suspended is the number of child Jobs which are in a suspended state. # noqa: E501 :param suspended: The suspended of this JobsetV1alpha2ReplicatedJobStatus. # noqa: E501 :type: int