diff --git a/go.mod b/go.mod index 5a3f1ae76a..a2c8d0d52b 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/go-logr/logr v1.2.3 - github.com/kubeflow/common v0.4.5 + github.com/kubeflow/common v0.4.6 github.com/onsi/ginkgo/v2 v2.1.6 github.com/onsi/gomega v1.20.1 github.com/prometheus/client_golang v1.12.2 @@ -89,5 +89,3 @@ require ( sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) - -replace github.com/kubeflow/common v0.4.5 => github.com/tenzen-y/common v0.0.0-20230115192234-865b54409a0b diff --git a/go.sum b/go.sum index 2463792221..b9fbfacc7b 100644 --- a/go.sum +++ b/go.sum @@ -327,6 +327,8 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kubeflow/common v0.4.6 h1:yzJf/HEdS6ginD0GlVkgbOFie0Sp66VdGjXidAGZIlk= +github.com/kubeflow/common v0.4.6/go.mod h1:43MAof/uhpJA2C0urynqatE3oKFQc7m2HLmJty7waqY= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -425,8 +427,6 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/tenzen-y/common v0.0.0-20230115192234-865b54409a0b h1:Dc2HDPNTzmpSOuOo1d8LeIIC0Sr0InPhdYTqYEEp2CU= -github.com/tenzen-y/common v0.0.0-20230115192234-865b54409a0b/go.mod h1:kI2gL98Ts9uJLHiKZzJZn7chVd9gUD85G+arE4M+7Lo= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= diff --git a/hack/python-sdk/swagger.json b/hack/python-sdk/swagger.json index 9cc7a5b930..7247abd6ba 100644 --- a/hack/python-sdk/swagger.json +++ b/hack/python-sdk/swagger.json @@ -714,7 +714,11 @@ "format": "int32" }, "labelSelector": { - "description": "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", + "description": "Deprecated: Use Selector instead", + "$ref": "#/definitions/v1.LabelSelector" + }, + "selector": { + "description": "A Selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty Selector matches all objects. A null Selector matches no objects.", "type": "string" }, "succeeded": { diff --git a/manifests/base/crds/kubeflow.org_mpijobs.yaml b/manifests/base/crds/kubeflow.org_mpijobs.yaml index 5f99a1a418..b1a84dc7f7 100644 --- a/manifests/base/crds/kubeflow.org_mpijobs.yaml +++ b/manifests/base/crds/kubeflow.org_mpijobs.yaml @@ -7479,10 +7479,55 @@ spec: format: int32 type: integer labelSelector: - description: A label selector is a label query over a set of - resources. The result of matchLabels and matchExpressions - are ANDed. An empty label selector matches all objects. A - null label selector matches no objects. + description: 'Deprecated: Use Selector instead' + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. + If the operator is In or NotIn, the values array + must be non-empty. If the operator is Exists or + DoesNotExist, the values array must be empty. This + array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. + A single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field is + "key", the operator is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + selector: + description: A Selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. + An empty Selector matches all objects. A null Selector matches + no objects. type: string succeeded: description: The number of pods which reached phase Succeeded. diff --git a/manifests/base/crds/kubeflow.org_mxjobs.yaml b/manifests/base/crds/kubeflow.org_mxjobs.yaml index d99b15c399..0b70d7316b 100644 --- a/manifests/base/crds/kubeflow.org_mxjobs.yaml +++ b/manifests/base/crds/kubeflow.org_mxjobs.yaml @@ -7475,10 +7475,55 @@ spec: format: int32 type: integer labelSelector: - description: A label selector is a label query over a set of - resources. The result of matchLabels and matchExpressions - are ANDed. An empty label selector matches all objects. A - null label selector matches no objects. + description: 'Deprecated: Use Selector instead' + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. + If the operator is In or NotIn, the values array + must be non-empty. If the operator is Exists or + DoesNotExist, the values array must be empty. This + array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. + A single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field is + "key", the operator is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + selector: + description: A Selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. + An empty Selector matches all objects. A null Selector matches + no objects. type: string succeeded: description: The number of pods which reached phase Succeeded. diff --git a/manifests/base/crds/kubeflow.org_paddlejobs.yaml b/manifests/base/crds/kubeflow.org_paddlejobs.yaml index 9ee76b384d..4446769ddb 100644 --- a/manifests/base/crds/kubeflow.org_paddlejobs.yaml +++ b/manifests/base/crds/kubeflow.org_paddlejobs.yaml @@ -7981,10 +7981,55 @@ spec: format: int32 type: integer labelSelector: - description: A label selector is a label query over a set of - resources. The result of matchLabels and matchExpressions - are ANDed. An empty label selector matches all objects. A - null label selector matches no objects. + description: 'Deprecated: Use Selector instead' + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. + If the operator is In or NotIn, the values array + must be non-empty. If the operator is Exists or + DoesNotExist, the values array must be empty. This + array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. + A single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field is + "key", the operator is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + selector: + description: A Selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. + An empty Selector matches all objects. A null Selector matches + no objects. type: string succeeded: description: The number of pods which reached phase Succeeded. @@ -8010,7 +8055,7 @@ spec: storage: true subresources: scale: - labelSelectorPath: .status.replicaStatuses.Worker.labelSelector + labelSelectorPath: .status.replicaStatuses.Worker.selector specReplicasPath: .spec.paddleReplicaSpecs.Worker.replicas statusReplicasPath: .status.replicaStatuses.Worker.active status: {} diff --git a/manifests/base/crds/kubeflow.org_pytorchjobs.yaml b/manifests/base/crds/kubeflow.org_pytorchjobs.yaml index 46e1d8a0bd..bb2de4e1f7 100644 --- a/manifests/base/crds/kubeflow.org_pytorchjobs.yaml +++ b/manifests/base/crds/kubeflow.org_pytorchjobs.yaml @@ -8010,10 +8010,55 @@ spec: format: int32 type: integer labelSelector: - description: A label selector is a label query over a set of - resources. The result of matchLabels and matchExpressions - are ANDed. An empty label selector matches all objects. A - null label selector matches no objects. + description: 'Deprecated: Use Selector instead' + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. + If the operator is In or NotIn, the values array + must be non-empty. If the operator is Exists or + DoesNotExist, the values array must be empty. This + array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. + A single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field is + "key", the operator is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + selector: + description: A Selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. + An empty Selector matches all objects. A null Selector matches + no objects. type: string succeeded: description: The number of pods which reached phase Succeeded. @@ -8039,7 +8084,7 @@ spec: storage: true subresources: scale: - labelSelectorPath: .status.replicaStatuses.Worker.labelSelector + labelSelectorPath: .status.replicaStatuses.Worker.selector specReplicasPath: .spec.pytorchReplicaSpecs.Worker.replicas statusReplicasPath: .status.replicaStatuses.Worker.active status: {} diff --git a/manifests/base/crds/kubeflow.org_tfjobs.yaml b/manifests/base/crds/kubeflow.org_tfjobs.yaml index f53d2a646c..a36d8b1734 100644 --- a/manifests/base/crds/kubeflow.org_tfjobs.yaml +++ b/manifests/base/crds/kubeflow.org_tfjobs.yaml @@ -7476,10 +7476,55 @@ spec: format: int32 type: integer labelSelector: - description: A label selector is a label query over a set of - resources. The result of matchLabels and matchExpressions - are ANDed. An empty label selector matches all objects. A - null label selector matches no objects. + description: 'Deprecated: Use Selector instead' + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. + If the operator is In or NotIn, the values array + must be non-empty. If the operator is Exists or + DoesNotExist, the values array must be empty. This + array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. + A single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field is + "key", the operator is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + selector: + description: A Selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. + An empty Selector matches all objects. A null Selector matches + no objects. type: string succeeded: description: The number of pods which reached phase Succeeded. diff --git a/manifests/base/crds/kubeflow.org_xgboostjobs.yaml b/manifests/base/crds/kubeflow.org_xgboostjobs.yaml index ab0e84d20d..c10ee67f8e 100644 --- a/manifests/base/crds/kubeflow.org_xgboostjobs.yaml +++ b/manifests/base/crds/kubeflow.org_xgboostjobs.yaml @@ -7465,10 +7465,55 @@ spec: format: int32 type: integer labelSelector: - description: A label selector is a label query over a set of - resources. The result of matchLabels and matchExpressions - are ANDed. An empty label selector matches all objects. A - null label selector matches no objects. + description: 'Deprecated: Use Selector instead' + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that relates + the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, NotIn, + Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. + If the operator is In or NotIn, the values array + must be non-empty. If the operator is Exists or + DoesNotExist, the values array must be empty. This + array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. + A single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field is + "key", the operator is "In", and the values array contains + only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + selector: + description: A Selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. + An empty Selector matches all objects. A null Selector matches + no objects. type: string succeeded: description: The number of pods which reached phase Succeeded. diff --git a/pkg/apis/kubeflow.org/v1/openapi_generated.go b/pkg/apis/kubeflow.org/v1/openapi_generated.go index 1d810c8ab8..715eade7a4 100644 --- a/pkg/apis/kubeflow.org/v1/openapi_generated.go +++ b/pkg/apis/kubeflow.org/v1/openapi_generated.go @@ -247,7 +247,13 @@ func schema_pkg_apis_common_v1_ReplicaStatus(ref common.ReferenceCallback) commo }, "labelSelector": { SchemaProps: spec.SchemaProps{ - Description: "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", + Description: "Deprecated: Use Selector instead", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), + }, + }, + "selector": { + SchemaProps: spec.SchemaProps{ + Description: "A Selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty Selector matches all objects. A null Selector matches no objects.", Type: []string{"string"}, Format: "", }, @@ -255,6 +261,8 @@ func schema_pkg_apis_common_v1_ReplicaStatus(ref common.ReferenceCallback) commo }, }, }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, } } diff --git a/pkg/apis/kubeflow.org/v1/paddlepaddle_types.go b/pkg/apis/kubeflow.org/v1/paddlepaddle_types.go index 67c11cc17e..5137cdb95c 100644 --- a/pkg/apis/kubeflow.org/v1/paddlepaddle_types.go +++ b/pkg/apis/kubeflow.org/v1/paddlepaddle_types.go @@ -51,7 +51,7 @@ const ( //+kubebuilder:subresource:status //+kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.conditions[-1:].type` //+kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` -// +kubebuilder:subresource:scale:specpath=.spec.paddleReplicaSpecs.Worker.replicas,statuspath=.status.replicaStatuses.Worker.active,selectorpath=.status.replicaStatuses.Worker.labelSelector +// +kubebuilder:subresource:scale:specpath=.spec.paddleReplicaSpecs.Worker.replicas,statuspath=.status.replicaStatuses.Worker.active,selectorpath=.status.replicaStatuses.Worker.selector // PaddleJob Represents a PaddleJob resource. type PaddleJob struct { diff --git a/pkg/apis/kubeflow.org/v1/pytorch_types.go b/pkg/apis/kubeflow.org/v1/pytorch_types.go index 7a030bcf8d..bb04aea6e5 100644 --- a/pkg/apis/kubeflow.org/v1/pytorch_types.go +++ b/pkg/apis/kubeflow.org/v1/pytorch_types.go @@ -51,7 +51,7 @@ const ( //+kubebuilder:subresource:status //+kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.conditions[-1:].type` //+kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` -// +kubebuilder:subresource:scale:specpath=.spec.pytorchReplicaSpecs.Worker.replicas,statuspath=.status.replicaStatuses.Worker.active,selectorpath=.status.replicaStatuses.Worker.labelSelector +// +kubebuilder:subresource:scale:specpath=.spec.pytorchReplicaSpecs.Worker.replicas,statuspath=.status.replicaStatuses.Worker.active,selectorpath=.status.replicaStatuses.Worker.selector // PyTorchJob Represents a PyTorchJob resource. type PyTorchJob struct { diff --git a/pkg/controller.v1/mpi/mpijob_controller.go b/pkg/controller.v1/mpi/mpijob_controller.go index de1f7be65a..fabb3e46da 100644 --- a/pkg/controller.v1/mpi/mpijob_controller.go +++ b/pkg/controller.v1/mpi/mpijob_controller.go @@ -81,7 +81,7 @@ func NewReconciler(mgr manager.Manager, gangSchedulingSetupFunc common.GangSched cfg := mgr.GetConfig() kubeClientSet := kubeclientset.NewForConfigOrDie(cfg) sharedInformers := informers.NewSharedInformerFactory(kubeClientSet, 0) - priorityClassInformer := sharedInformers.Scheduling().V1beta1().PriorityClasses() + priorityClassInformer := sharedInformers.Scheduling().V1().PriorityClasses() r.JobController = common.JobController{ Controller: r, diff --git a/pkg/controller.v1/mxnet/mxjob_controller.go b/pkg/controller.v1/mxnet/mxjob_controller.go index ff468a6281..3a0e4e9171 100644 --- a/pkg/controller.v1/mxnet/mxjob_controller.go +++ b/pkg/controller.v1/mxnet/mxjob_controller.go @@ -82,7 +82,7 @@ func NewReconciler(mgr manager.Manager, gangSchedulingSetupFunc common.GangSched cfg := mgr.GetConfig() kubeClientSet := kubeclientset.NewForConfigOrDie(cfg) sharedInformers := informers.NewSharedInformerFactory(kubeClientSet, 0) - priorityClassInformer := sharedInformers.Scheduling().V1beta1().PriorityClasses() + priorityClassInformer := sharedInformers.Scheduling().V1().PriorityClasses() // Initialize common job controller r.JobController = common.JobController{ diff --git a/pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go b/pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go index c5ae860b08..ecea63a31d 100644 --- a/pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go +++ b/pkg/controller.v1/paddlepaddle/paddlepaddle_controller.go @@ -74,7 +74,7 @@ func NewReconciler(mgr manager.Manager, gangSchedulingSetupFunc common.GangSched cfg := mgr.GetConfig() kubeClientSet := kubeclientset.NewForConfigOrDie(cfg) sharedInformers := informers.NewSharedInformerFactory(kubeClientSet, 0) - priorityClassInformer := sharedInformers.Scheduling().V1beta1().PriorityClasses() + priorityClassInformer := sharedInformers.Scheduling().V1().PriorityClasses() // Initialize common job controller r.JobController = common.JobController{ @@ -387,7 +387,7 @@ func (r *PaddleJobReconciler) UpdateJobStatus(job interface{}, for rtype, spec := range replicas { status := jobStatus.ReplicaStatuses[rtype] // Generate the label selector. - status.LabelSelector = metav1.FormatLabelSelector(r.GenLabelSelector(paddlejob.Name, rtype)) + status.Selector = metav1.FormatLabelSelector(r.GenLabelSelector(paddlejob.Name, rtype)) succeeded := status.Succeeded expected := *(spec.Replicas) - succeeded diff --git a/pkg/controller.v1/pytorch/pytorchjob_controller.go b/pkg/controller.v1/pytorch/pytorchjob_controller.go index f52a35fce8..ca664e4173 100644 --- a/pkg/controller.v1/pytorch/pytorchjob_controller.go +++ b/pkg/controller.v1/pytorch/pytorchjob_controller.go @@ -74,7 +74,7 @@ func NewReconciler(mgr manager.Manager, gangSchedulingSetupFunc common.GangSched cfg := mgr.GetConfig() kubeClientSet := kubeclientset.NewForConfigOrDie(cfg) sharedInformers := informers.NewSharedInformerFactory(kubeClientSet, 0) - priorityClassInformer := sharedInformers.Scheduling().V1beta1().PriorityClasses() + priorityClassInformer := sharedInformers.Scheduling().V1().PriorityClasses() // Initialize common job controller r.JobController = common.JobController{ @@ -390,7 +390,7 @@ func (r *PyTorchJobReconciler) UpdateJobStatus(job interface{}, for rtype, spec := range replicas { status := jobStatus.ReplicaStatuses[rtype] // Generate the label selector. - status.LabelSelector = metav1.FormatLabelSelector(r.GenLabelSelector(pytorchjob.Name, rtype)) + status.Selector = metav1.FormatLabelSelector(r.GenLabelSelector(pytorchjob.Name, rtype)) succeeded := status.Succeeded expected := *(spec.Replicas) - succeeded diff --git a/pkg/controller.v1/tensorflow/tfjob_controller.go b/pkg/controller.v1/tensorflow/tfjob_controller.go index 33cb5173ab..6011dab5ce 100644 --- a/pkg/controller.v1/tensorflow/tfjob_controller.go +++ b/pkg/controller.v1/tensorflow/tfjob_controller.go @@ -99,7 +99,7 @@ func NewReconciler(mgr manager.Manager, gangSchedulingSetupFunc common.GangSched cfg := mgr.GetConfig() kubeClientSet := kubeclientset.NewForConfigOrDie(cfg) sharedInformers := informers.NewSharedInformerFactory(kubeClientSet, 0) - priorityClassInformer := sharedInformers.Scheduling().V1beta1().PriorityClasses() + priorityClassInformer := sharedInformers.Scheduling().V1().PriorityClasses() r.JobController = common.JobController{ Controller: r, diff --git a/pkg/controller.v1/xgboost/xgboostjob_controller.go b/pkg/controller.v1/xgboost/xgboostjob_controller.go index b72d6b9d91..7e6f2628d0 100644 --- a/pkg/controller.v1/xgboost/xgboostjob_controller.go +++ b/pkg/controller.v1/xgboost/xgboostjob_controller.go @@ -89,7 +89,7 @@ func NewReconciler(mgr manager.Manager, gangSchedulingSetupFunc common.GangSched cfg := mgr.GetConfig() kubeClientSet := kubeclientset.NewForConfigOrDie(cfg) sharedInformers := informers.NewSharedInformerFactory(kubeClientSet, 0) - priorityClassInformer := sharedInformers.Scheduling().V1beta1().PriorityClasses() + priorityClassInformer := sharedInformers.Scheduling().V1().PriorityClasses() // Initialize common job controller r.JobController = common.JobController{ diff --git a/sdk/python/docs/V1ReplicaStatus.md b/sdk/python/docs/V1ReplicaStatus.md index 74f8a8841a..2a0d3a3b8f 100644 --- a/sdk/python/docs/V1ReplicaStatus.md +++ b/sdk/python/docs/V1ReplicaStatus.md @@ -6,7 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **active** | **int** | The number of actively running pods. | [optional] **failed** | **int** | The number of pods which reached phase Failed. | [optional] -**label_selector** | **str** | A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. | [optional] +**label_selector** | [**V1LabelSelector**](V1LabelSelector.md) | | [optional] +**selector** | **str** | A Selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty Selector matches all objects. A null Selector matches no objects. | [optional] **succeeded** | **int** | The number of pods which reached phase Succeeded. | [optional] [[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/kubeflow/training/models/v1_replica_status.py b/sdk/python/kubeflow/training/models/v1_replica_status.py index df017ee90c..3e2e7d9585 100644 --- a/sdk/python/kubeflow/training/models/v1_replica_status.py +++ b/sdk/python/kubeflow/training/models/v1_replica_status.py @@ -35,7 +35,8 @@ class V1ReplicaStatus(object): openapi_types = { 'active': 'int', 'failed': 'int', - 'label_selector': 'str', + 'label_selector': 'V1LabelSelector', + 'selector': 'str', 'succeeded': 'int' } @@ -43,10 +44,11 @@ class V1ReplicaStatus(object): 'active': 'active', 'failed': 'failed', 'label_selector': 'labelSelector', + 'selector': 'selector', 'succeeded': 'succeeded' } - def __init__(self, active=None, failed=None, label_selector=None, succeeded=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, active=None, failed=None, label_selector=None, selector=None, succeeded=None, local_vars_configuration=None): # noqa: E501 """V1ReplicaStatus - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -55,6 +57,7 @@ def __init__(self, active=None, failed=None, label_selector=None, succeeded=None self._active = None self._failed = None self._label_selector = None + self._selector = None self._succeeded = None self.discriminator = None @@ -64,6 +67,8 @@ def __init__(self, active=None, failed=None, label_selector=None, succeeded=None self.failed = failed if label_selector is not None: self.label_selector = label_selector + if selector is not None: + self.selector = selector if succeeded is not None: self.succeeded = succeeded @@ -117,10 +122,9 @@ def failed(self, failed): def label_selector(self): """Gets the label_selector of this V1ReplicaStatus. # noqa: E501 - A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. # noqa: E501 :return: The label_selector of this V1ReplicaStatus. # noqa: E501 - :rtype: str + :rtype: V1LabelSelector """ return self._label_selector @@ -128,14 +132,36 @@ def label_selector(self): def label_selector(self, label_selector): """Sets the label_selector of this V1ReplicaStatus. - A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. # noqa: E501 :param label_selector: The label_selector of this V1ReplicaStatus. # noqa: E501 - :type: str + :type: V1LabelSelector """ self._label_selector = label_selector + @property + def selector(self): + """Gets the selector of this V1ReplicaStatus. # noqa: E501 + + A Selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty Selector matches all objects. A null Selector matches no objects. # noqa: E501 + + :return: The selector of this V1ReplicaStatus. # noqa: E501 + :rtype: str + """ + return self._selector + + @selector.setter + def selector(self, selector): + """Sets the selector of this V1ReplicaStatus. + + A Selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty Selector matches all objects. A null Selector matches no objects. # noqa: E501 + + :param selector: The selector of this V1ReplicaStatus. # noqa: E501 + :type: str + """ + + self._selector = selector + @property def succeeded(self): """Gets the succeeded of this V1ReplicaStatus. # noqa: E501 diff --git a/sdk/python/test/test_kubeflow_org_v1_mpi_job.py b/sdk/python/test/test_kubeflow_org_v1_mpi_job.py index 5961b8b08d..5bb33e150c 100644 --- a/sdk/python/test/test_kubeflow_org_v1_mpi_job.py +++ b/sdk/python/test/test_kubeflow_org_v1_mpi_job.py @@ -78,7 +78,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ) diff --git a/sdk/python/test/test_kubeflow_org_v1_mpi_job_list.py b/sdk/python/test/test_kubeflow_org_v1_mpi_job_list.py index f525c23671..bcc1bad6b9 100644 --- a/sdk/python/test/test_kubeflow_org_v1_mpi_job_list.py +++ b/sdk/python/test/test_kubeflow_org_v1_mpi_job_list.py @@ -81,7 +81,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ), ) @@ -135,7 +136,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ), ) diff --git a/sdk/python/test/test_kubeflow_org_v1_mx_job.py b/sdk/python/test/test_kubeflow_org_v1_mx_job.py index 5b5a16ab27..2f54224baa 100644 --- a/sdk/python/test/test_kubeflow_org_v1_mx_job.py +++ b/sdk/python/test/test_kubeflow_org_v1_mx_job.py @@ -76,7 +76,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ) diff --git a/sdk/python/test/test_kubeflow_org_v1_mx_job_list.py b/sdk/python/test/test_kubeflow_org_v1_mx_job_list.py index 7cc7f27d23..831f2c1c35 100644 --- a/sdk/python/test/test_kubeflow_org_v1_mx_job_list.py +++ b/sdk/python/test/test_kubeflow_org_v1_mx_job_list.py @@ -79,7 +79,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ), ) @@ -131,7 +132,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ), ) diff --git a/sdk/python/test/test_kubeflow_org_v1_paddle_job.py b/sdk/python/test/test_kubeflow_org_v1_paddle_job.py index 4177d417de..1cd71a4372 100644 --- a/sdk/python/test/test_kubeflow_org_v1_paddle_job.py +++ b/sdk/python/test/test_kubeflow_org_v1_paddle_job.py @@ -82,7 +82,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ) diff --git a/sdk/python/test/test_kubeflow_org_v1_paddle_job_list.py b/sdk/python/test/test_kubeflow_org_v1_paddle_job_list.py index 9ffa16fe20..2de315603a 100644 --- a/sdk/python/test/test_kubeflow_org_v1_paddle_job_list.py +++ b/sdk/python/test/test_kubeflow_org_v1_paddle_job_list.py @@ -85,7 +85,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ), ) @@ -143,7 +144,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ), ) diff --git a/sdk/python/test/test_kubeflow_org_v1_py_torch_job.py b/sdk/python/test/test_kubeflow_org_v1_py_torch_job.py index 3d1bc22f6c..e6fe89f4b1 100644 --- a/sdk/python/test/test_kubeflow_org_v1_py_torch_job.py +++ b/sdk/python/test/test_kubeflow_org_v1_py_torch_job.py @@ -93,7 +93,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ) diff --git a/sdk/python/test/test_kubeflow_org_v1_py_torch_job_list.py b/sdk/python/test/test_kubeflow_org_v1_py_torch_job_list.py index eadad7fba2..c860de7ecb 100644 --- a/sdk/python/test/test_kubeflow_org_v1_py_torch_job_list.py +++ b/sdk/python/test/test_kubeflow_org_v1_py_torch_job_list.py @@ -96,7 +96,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ), ) @@ -165,7 +166,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ), ) diff --git a/sdk/python/test/test_kubeflow_org_v1_tf_job.py b/sdk/python/test/test_kubeflow_org_v1_tf_job.py index 287f932e15..ce1193272d 100644 --- a/sdk/python/test/test_kubeflow_org_v1_tf_job.py +++ b/sdk/python/test/test_kubeflow_org_v1_tf_job.py @@ -77,7 +77,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ) diff --git a/sdk/python/test/test_kubeflow_org_v1_tf_job_list.py b/sdk/python/test/test_kubeflow_org_v1_tf_job_list.py index 1ec73e7895..e513a728e3 100644 --- a/sdk/python/test/test_kubeflow_org_v1_tf_job_list.py +++ b/sdk/python/test/test_kubeflow_org_v1_tf_job_list.py @@ -80,7 +80,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ), ) @@ -133,7 +134,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ), ) diff --git a/sdk/python/test/test_kubeflow_org_v1_xg_boost_job.py b/sdk/python/test/test_kubeflow_org_v1_xg_boost_job.py index 4cac7e1966..f4a8234eb2 100644 --- a/sdk/python/test/test_kubeflow_org_v1_xg_boost_job.py +++ b/sdk/python/test/test_kubeflow_org_v1_xg_boost_job.py @@ -75,7 +75,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ) diff --git a/sdk/python/test/test_kubeflow_org_v1_xg_boost_job_list.py b/sdk/python/test/test_kubeflow_org_v1_xg_boost_job_list.py index 7bd61e7351..d2801fd4f2 100644 --- a/sdk/python/test/test_kubeflow_org_v1_xg_boost_job_list.py +++ b/sdk/python/test/test_kubeflow_org_v1_xg_boost_job_list.py @@ -78,7 +78,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ), ) @@ -129,7 +130,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None, ), ) diff --git a/sdk/python/test/test_v1_job_status.py b/sdk/python/test/test_v1_job_status.py index 12350b6f9a..1306a33fa3 100644 --- a/sdk/python/test/test_v1_job_status.py +++ b/sdk/python/test/test_v1_job_status.py @@ -51,7 +51,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, start_time = None @@ -71,7 +72,8 @@ def make_instance(self, include_optional): 'key' : V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56, ) }, ) diff --git a/sdk/python/test/test_v1_replica_status.py b/sdk/python/test/test_v1_replica_status.py index 17402fa046..e1af62a909 100644 --- a/sdk/python/test/test_v1_replica_status.py +++ b/sdk/python/test/test_v1_replica_status.py @@ -38,7 +38,8 @@ def make_instance(self, include_optional): return V1ReplicaStatus( active = 56, failed = 56, - label_selector = '0', + label_selector = None, + selector = '0', succeeded = 56 ) else :