diff --git a/Gopkg.lock b/Gopkg.lock index d5388c65d18..1416ee43aa1 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -349,28 +349,28 @@ version = "v1.1.5" [[projects]] - digest = "1:a0d34e77e6bb768a105145f56bb39631a449efd97379210f7fdc9e9e437d9487" + digest = "1:81bf086c2ebc845b5fbe833c0fd967a8ee8e33413084ccc68f36ecdaa73919fd" name = "github.com/kubeflow/pytorch-operator" packages = [ - "pkg/apis/pytorch/v1beta1", + "pkg/apis/pytorch/v1", "pkg/apis/pytorch/v1beta2", ] pruneopts = "NUT" - revision = "da7798e7c2c127a270735c409f9305f3a6c06fd8" - version = "v0.5.0-rc.1" + revision = "396fb2f062e47e518240228f7f65ea5134dcbc43" + version = "v0.5.1" [[projects]] - digest = "1:aa39f57002948b31f67912913ad8ec7dd7a7e410c9bf0d4a6500335c9792eceb" + digest = "1:412ddde4fadb72f54ae7f5395f122a0fa4c63038174c336972a251ab2d0fa6ea" name = "github.com/kubeflow/tf-operator" packages = [ - "pkg/apis/common/v1beta1", + "pkg/apis/common/v1", "pkg/apis/common/v1beta2", - "pkg/apis/tensorflow/v1beta1", + "pkg/apis/tensorflow/v1", "pkg/apis/tensorflow/v1beta2", ] pruneopts = "NUT" - revision = "c2849477dffdeacc2ebc11de66f826a6ce5cf690" - version = "v0.4.0" + revision = "d0b973be7135b7cbed3138d3d5ac70ae3a9bcd88" + version = "v0.5.3" [[projects]] digest = "1:802689c84994b7f2e41ffe7e39d29a8d8227f2121938dc025db44dfaa9633b15" @@ -1171,11 +1171,11 @@ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger", "github.com/grpc-ecosystem/grpc-gateway/runtime", "github.com/grpc-ecosystem/grpc-gateway/utilities", - "github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1", + "github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1", "github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta2", - "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1", + "github.com/kubeflow/tf-operator/pkg/apis/common/v1", "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2", - "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1", + "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1", "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2", "github.com/onsi/ginkgo", "github.com/onsi/gomega", diff --git a/Gopkg.toml b/Gopkg.toml index f9cf4a8bffd..f4a102ce1c0 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -86,11 +86,11 @@ required = [ [[constraint]] name = "github.com/kubeflow/tf-operator" - version = "0.4.0" + version = "0.5.3" [[constraint]] name = "github.com/kubeflow/pytorch-operator" - version = "0.5.0-rc.1" + version = "0.5.1" [[constraint]] name = "github.com/awalterschulze/gographviz" diff --git a/README.md b/README.md index b39a51cdad3..1f6a15732ee 100644 --- a/README.md +++ b/README.md @@ -300,7 +300,7 @@ Spec: Value: 0 Worker Spec: Go Template: - Raw Template: apiVersion: "kubeflow.org/v1beta1" + Raw Template: apiVersion: "kubeflow.org/v1" kind: PyTorchJob metadata: name: {{.WorkerID}} diff --git a/examples/v1alpha1/pytorchjob-example.yaml b/examples/v1alpha1/pytorchjob-example.yaml index 25a8adcdd17..e67773d7fbb 100644 --- a/examples/v1alpha1/pytorchjob-example.yaml +++ b/examples/v1alpha1/pytorchjob-example.yaml @@ -29,7 +29,7 @@ spec: retain: true goTemplate: rawTemplate: |- - apiVersion: "kubeflow.org/v1beta1" + apiVersion: "kubeflow.org/v1" kind: PyTorchJob metadata: name: {{.WorkerID}} diff --git a/examples/v1alpha1/tfjob-example.yaml b/examples/v1alpha1/tfjob-example.yaml index 6765d2ce4bf..9d320c69e50 100644 --- a/examples/v1alpha1/tfjob-example.yaml +++ b/examples/v1alpha1/tfjob-example.yaml @@ -28,7 +28,7 @@ spec: workerSpec: goTemplate: rawTemplate: |- - apiVersion: "kubeflow.org/v1beta1" + apiVersion: "kubeflow.org/v1" kind: TFJob metadata: name: {{.WorkerID}} diff --git a/examples/v1alpha2/pytorchjob-example.yaml b/examples/v1alpha2/pytorchjob-example.yaml index b80c8d8ded0..1cfa06aa792 100644 --- a/examples/v1alpha2/pytorchjob-example.yaml +++ b/examples/v1alpha2/pytorchjob-example.yaml @@ -17,7 +17,7 @@ spec: retain: true goTemplate: rawTemplate: |- - apiVersion: "kubeflow.org/v1beta2" + apiVersion: "kubeflow.org/v1" kind: PyTorchJob metadata: name: {{.Trial}} diff --git a/examples/v1alpha2/tfjob-example.yaml b/examples/v1alpha2/tfjob-example.yaml index 6b353b2e8e9..0114296a050 100644 --- a/examples/v1alpha2/tfjob-example.yaml +++ b/examples/v1alpha2/tfjob-example.yaml @@ -28,7 +28,7 @@ spec: retain: true goTemplate: rawTemplate: |- - apiVersion: "kubeflow.org/v1beta2" + apiVersion: "kubeflow.org/v1" kind: TFJob metadata: name: {{.Trial}} diff --git a/manifests/v1alpha1/studyjobcontroller/pytorchjobsCrd.yaml b/manifests/v1alpha1/studyjobcontroller/pytorchjobsCrd.yaml index b2dd419b8d4..697294be50f 100644 --- a/manifests/v1alpha1/studyjobcontroller/pytorchjobsCrd.yaml +++ b/manifests/v1alpha1/studyjobcontroller/pytorchjobsCrd.yaml @@ -4,7 +4,7 @@ metadata: name: pytorchjobs.kubeflow.org spec: group: kubeflow.org - version: v1beta1 + version: v1 scope: Namespaced names: kind: PyTorchJob diff --git a/manifests/v1alpha1/studyjobcontroller/tfjobsCrd.yaml b/manifests/v1alpha1/studyjobcontroller/tfjobsCrd.yaml index c53f1ac1c8b..580ca69aa8c 100644 --- a/manifests/v1alpha1/studyjobcontroller/tfjobsCrd.yaml +++ b/manifests/v1alpha1/studyjobcontroller/tfjobsCrd.yaml @@ -4,7 +4,7 @@ metadata: name: tfjobs.kubeflow.org spec: group: kubeflow.org - version: v1beta1 + version: v1 scope: Namespaced names: kind: TFJob diff --git a/pkg/api/operators/apis/addtoscheme_tfjob_v1beta1.go b/pkg/api/operators/apis/addtoscheme_pytorchjob_v1.go similarity index 83% rename from pkg/api/operators/apis/addtoscheme_tfjob_v1beta1.go rename to pkg/api/operators/apis/addtoscheme_pytorchjob_v1.go index 20a44cb834e..5f54a8849a0 100644 --- a/pkg/api/operators/apis/addtoscheme_tfjob_v1beta1.go +++ b/pkg/api/operators/apis/addtoscheme_pytorchjob_v1.go @@ -13,10 +13,10 @@ limitations under the License. package apis import ( - "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1" + "github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1" ) func init() { // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back - AddToSchemes = append(AddToSchemes, v1beta1.SchemeBuilder.AddToScheme) + AddToSchemes = append(AddToSchemes, v1.SchemeBuilder.AddToScheme) } diff --git a/pkg/api/operators/apis/addtoscheme_pytorchjob_v1beta1.go b/pkg/api/operators/apis/addtoscheme_pytorchjob_v1beta1.go deleted file mode 100644 index 9eee8cef54d..00000000000 --- a/pkg/api/operators/apis/addtoscheme_pytorchjob_v1beta1.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package apis - -import ( - "github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1" -) - -func init() { - // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back - AddToSchemes = append(AddToSchemes, v1beta1.SchemeBuilder.AddToScheme) -} diff --git a/pkg/api/operators/apis/addtoscheme_pytorchjob_v1beta2.go b/pkg/api/operators/apis/addtoscheme_pytorchjob_v1beta2.go deleted file mode 100644 index 7e1f2d30cce..00000000000 --- a/pkg/api/operators/apis/addtoscheme_pytorchjob_v1beta2.go +++ /dev/null @@ -1,22 +0,0 @@ -/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package apis - -import ( - "github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta2" -) - -func init() { - // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back - AddToSchemes = append(AddToSchemes, v1beta2.SchemeBuilder.AddToScheme) -} diff --git a/pkg/api/operators/apis/addtoscheme_tfjob_v1beta2.go b/pkg/api/operators/apis/addtoscheme_tfjob_v1.go similarity index 83% rename from pkg/api/operators/apis/addtoscheme_tfjob_v1beta2.go rename to pkg/api/operators/apis/addtoscheme_tfjob_v1.go index 3c177474783..1d885d60cd3 100644 --- a/pkg/api/operators/apis/addtoscheme_tfjob_v1beta2.go +++ b/pkg/api/operators/apis/addtoscheme_tfjob_v1.go @@ -13,10 +13,10 @@ limitations under the License. package apis import ( - "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2" + "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1" ) func init() { // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back - AddToSchemes = append(AddToSchemes, v1beta2.SchemeBuilder.AddToScheme) + AddToSchemes = append(AddToSchemes, v1.SchemeBuilder.AddToScheme) } diff --git a/pkg/common/v1alpha2/common.go b/pkg/common/v1alpha2/common.go index 761c516866c..a0b9f378b84 100644 --- a/pkg/common/v1alpha2/common.go +++ b/pkg/common/v1alpha2/common.go @@ -16,12 +16,12 @@ func GetSupportedJobList() []schema.GroupVersionKind { }, { Group: "kubeflow.org", - Version: "v1beta2", + Version: "v1", Kind: "TFJob", }, { Group: "kubeflow.org", - Version: "v1beta2", + Version: "v1", Kind: "PyTorchJob", }, } diff --git a/pkg/controller/v1alpha1/studyjob/studyjob_controller.go b/pkg/controller/v1alpha1/studyjob/studyjob_controller.go index dbf1dfef992..92db7aab874 100644 --- a/pkg/controller/v1alpha1/studyjob/studyjob_controller.go +++ b/pkg/controller/v1alpha1/studyjob/studyjob_controller.go @@ -22,9 +22,9 @@ import ( katibv1alpha1 "github.com/kubeflow/katib/pkg/api/operators/apis/studyjob/v1alpha1" katibapi "github.com/kubeflow/katib/pkg/api/v1alpha1" common "github.com/kubeflow/katib/pkg/common/v1alpha1" - pytorchjobv1beta1 "github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1" - commonv1beta1 "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1" - tfjobv1beta1 "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1" + pytorchjobv1 "github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1" + commonv1 "github.com/kubeflow/tf-operator/pkg/apis/common/v1" + tfjobv1 "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -116,7 +116,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error { } err = c.Watch( - &source.Kind{Type: &tfjobv1beta1.TFJob{}}, + &source.Kind{Type: &tfjobv1.TFJob{}}, &handler.EnqueueRequestForOwner{ IsController: true, OwnerType: &katibv1alpha1.StudyJob{}, @@ -125,7 +125,7 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error { return err } err = c.Watch( - &source.Kind{Type: &pytorchjobv1beta1.PyTorchJob{}}, + &source.Kind{Type: &pytorchjobv1.PyTorchJob{}}, &handler.EnqueueRequestForOwner{ IsController: true, OwnerType: &katibv1alpha1.StudyJob{}, @@ -446,7 +446,7 @@ func (r *ReconcileStudyJobController) getJobWorkerStatus(ns string, wid string, if ok { statusMap := status.(map[string]interface{}) - jobStatus := commonv1beta1.JobStatus{} + jobStatus := commonv1.JobStatus{} err := runtime.DefaultUnstructuredConverter.FromUnstructured(statusMap, &jobStatus) if err != nil { klog.Errorf("Error in converting unstructured to status: %v ", err) @@ -454,9 +454,9 @@ func (r *ReconcileStudyJobController) getJobWorkerStatus(ns string, wid string, } if len(jobStatus.Conditions) > 0 { lc := jobStatus.Conditions[len(jobStatus.Conditions)-1] - if lc.Type == commonv1beta1.JobSucceeded { + if lc.Type == commonv1.JobSucceeded { state = katibapi.State_COMPLETED - } else if lc.Type == commonv1beta1.JobFailed { + } else if lc.Type == commonv1.JobFailed { state = katibapi.State_ERROR } } diff --git a/pkg/controller/v1alpha2/experiment/experiment_controller_test.go b/pkg/controller/v1alpha2/experiment/experiment_controller_test.go index 0abe564f9bb..35dfb076de0 100644 --- a/pkg/controller/v1alpha2/experiment/experiment_controller_test.go +++ b/pkg/controller/v1alpha2/experiment/experiment_controller_test.go @@ -139,7 +139,7 @@ func TestReconcileExperiment(t *testing.T) { defer mockCtrl3.Finish() generator := manifestmock.NewMockGenerator(mockCtrl) generator.EXPECT().GetRunSpecWithHyperParameters(gomock.Any(), gomock.Any(), - gomock.Any(), gomock.Any(), gomock.Any()).Return(`apiVersion: "kubeflow.org/v1beta2" + gomock.Any(), gomock.Any(), gomock.Any()).Return(`apiVersion: "kubeflow.org/v1" kind: "TFJob" metadata: name: "test" @@ -287,7 +287,7 @@ func newFakeInstance() *experimentsv1alpha2.Experiment { }, TrialTemplate: &experimentsv1alpha2.TrialTemplate{ GoTemplate: &experimentsv1alpha2.GoTemplate{ - RawTemplate: `apiVersion: "kubeflow.org/v1beta2" + RawTemplate: `apiVersion: "kubeflow.org/v1" kind: TFJob metadata: name: {{.Trial}} diff --git a/pkg/controller/v1alpha2/experiment/validator/validator_test.go b/pkg/controller/v1alpha2/experiment/validator/validator_test.go index c9028c89f13..2e1b471e16d 100644 --- a/pkg/controller/v1alpha2/experiment/validator/validator_test.go +++ b/pkg/controller/v1alpha2/experiment/validator/validator_test.go @@ -19,7 +19,7 @@ func init() { } func TestValidateTFJobTrialTemplate(t *testing.T) { - trialTFJobTemplate := `apiVersion: "kubeflow.org/v1beta1" + trialTFJobTemplate := `apiVersion: "kubeflow.org/v1" kind: "TFJob" metadata: name: "dist-mnist-for-e2e-test" diff --git a/pkg/controller/v1alpha2/trial/trial_controller_test.go b/pkg/controller/v1alpha2/trial/trial_controller_test.go index dea2549fd2b..0c5688e092d 100644 --- a/pkg/controller/v1alpha2/trial/trial_controller_test.go +++ b/pkg/controller/v1alpha2/trial/trial_controller_test.go @@ -333,7 +333,7 @@ spec: - "-mn" - "test" restartPolicy: Never`, - RunSpec: `apiVersion: "kubeflow.org/v1beta2" + RunSpec: `apiVersion: "kubeflow.org/v1" kind: "TFJob" metadata: name: "test" diff --git a/test/unit/v1alpha2/crds/pytorchjob_v1beta2.yaml b/test/unit/v1alpha2/crds/pytorchjob_v1.yaml similarity index 92% rename from test/unit/v1alpha2/crds/pytorchjob_v1beta2.yaml rename to test/unit/v1alpha2/crds/pytorchjob_v1.yaml index e46e614cbb0..697294be50f 100644 --- a/test/unit/v1alpha2/crds/pytorchjob_v1beta2.yaml +++ b/test/unit/v1alpha2/crds/pytorchjob_v1.yaml @@ -4,7 +4,7 @@ metadata: name: pytorchjobs.kubeflow.org spec: group: kubeflow.org - version: v1beta2 + version: v1 scope: Namespaced names: kind: PyTorchJob diff --git a/test/unit/v1alpha2/crds/tfjob_v1beta2.yaml b/test/unit/v1alpha2/crds/tfjob_v1.yaml similarity index 92% rename from test/unit/v1alpha2/crds/tfjob_v1beta2.yaml rename to test/unit/v1alpha2/crds/tfjob_v1.yaml index 2c8b8a2fb89..580ca69aa8c 100644 --- a/test/unit/v1alpha2/crds/tfjob_v1beta2.yaml +++ b/test/unit/v1alpha2/crds/tfjob_v1.yaml @@ -4,7 +4,7 @@ metadata: name: tfjobs.kubeflow.org spec: group: kubeflow.org - version: v1beta2 + version: v1 scope: Namespaced names: kind: TFJob diff --git a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/constants.go b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/constants.go similarity index 93% rename from vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/constants.go rename to vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/constants.go index 659390f80b9..b3e2aa21099 100644 --- a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/constants.go +++ b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/constants.go @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1beta1 +package v1 import ( - common "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1" + common "github.com/kubeflow/tf-operator/pkg/apis/common/v1" ) const ( diff --git a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/defaults.go b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/defaults.go similarity index 97% rename from vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/defaults.go rename to vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/defaults.go index 55f1c74787e..13ac7d44edd 100644 --- a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/defaults.go +++ b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/defaults.go @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1beta1 +package v1 import ( "strings" - common "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1" + common "github.com/kubeflow/tf-operator/pkg/apis/common/v1" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" ) diff --git a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/doc.go b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/doc.go similarity index 90% rename from vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/doc.go rename to vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/doc.go index 6263d776ac3..9649a4e75f8 100644 --- a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/doc.go +++ b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/doc.go @@ -15,6 +15,6 @@ // +k8s:deepcopy-gen=package,register // +k8s:defaulter-gen=TypeMeta -// Package v1beta1 is the v1beta1 version of the API. +// Package v1 is the v1 version of the API. // +groupName=kubeflow.org -package v1beta1 +package v1 diff --git a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/register.go b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/register.go similarity index 98% rename from vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/register.go rename to vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/register.go index 0826256b1b4..77a5b7c7c11 100644 --- a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/register.go +++ b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/register.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1beta1 +package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -34,7 +34,7 @@ const ( // Kind is the kind name. Kind = "PyTorchJob" // GroupVersion is the version. - GroupVersion = "v1beta1" + GroupVersion = "v1" // Plural is the Plural for pytorchJob. Plural = "pytorchjobs" // Singular is the singular for pytorchJob. diff --git a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/types.go b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/types.go similarity index 64% rename from vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/types.go rename to vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/types.go index bf0d314560a..513b30de21d 100644 --- a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/types.go +++ b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/types.go @@ -1,4 +1,4 @@ -// Copyright 2018 The Kubeflow Authors +// Copyright 2019 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,51 +12,57 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1beta1 +package v1 import ( - common "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1" + common "github.com/kubeflow/tf-operator/pkg/apis/common/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // +genclient -// +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +resource:path=pytorchjob -// PyTorchJob represents the configuration of PyTorchJob +// Represents a PyTorchJob resource. type PyTorchJob struct { + // Standard Kubernetes type metadata. metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + // Standard Kubernetes object's metadata. metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the PyTorchJob. + // Specification of the desired state of the PyTorchJob. Spec PyTorchJobSpec `json:"spec,omitempty"` // Most recently observed status of the PyTorchJob. - // This data may not be up to date. - // Populated by the system. - // Read-only. + // Read-only (modified by the system). Status common.JobStatus `json:"status,omitempty"` } // PyTorchJobSpec is a desired state description of the PyTorchJob. type PyTorchJobSpec struct { - // CleanPodPolicy defines the policy to kill pods after PyTorchJob is - // succeeded. - // Default to Running. + // Specifies the duration (in seconds) since startTime during which the job can remain active + // before it is terminated. Must be a positive integer. + // This setting applies only to pods where restartPolicy is OnFailure or Always. + // +optional + ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` + + // Number of retries before marking this job as failed. + // +optional + BackoffLimit *int32 `json:"backoffLimit,omitempty"` + + // Defines the policy for cleaning up pods after the PyTorchJob completes. + // Defaults to Running. CleanPodPolicy *common.CleanPodPolicy `json:"cleanPodPolicy,omitempty"` - // TTLSecondsAfterFinished is the TTL to clean up pytorch-jobs (temporary - // before kubernetes adds the cleanup controller). + // Defines the TTL for cleaning up finished PyTorchJobs (temporary + // before Kubernetes adds the cleanup controller). // It may take extra ReconcilePeriod seconds for the cleanup, since // reconcile gets called periodically. - // Default to infinite. + // Defaults to infinite. TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` - // PyTorchReplicaSpecs is map of PyTorchReplicaType and PyTorchReplicaSpec - // specifies the PyTorch replicas to run. + // A map of PyTorchReplicaType (type) to ReplicaSpec (value). Specifies the PyTorch cluster configuration. // For example, // { // "Master": PyTorchReplicaSpec, @@ -65,7 +71,7 @@ type PyTorchJobSpec struct { PyTorchReplicaSpecs map[PyTorchReplicaType]*common.ReplicaSpec `json:"pytorchReplicaSpecs"` } -// PyTorchReplicaType is the type for PyTorchReplica. +// PyTorchReplicaType is the type for PyTorchReplica. Can be one of "Master" or "Worker". type PyTorchReplicaType common.ReplicaType const ( @@ -81,6 +87,7 @@ const ( // PyTorchJobList is a list of PyTorchJobs. type PyTorchJobList struct { + // Standard type metadata. metav1.TypeMeta `json:",inline"` // Standard list metadata. diff --git a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/zz_generated.deepcopy.go similarity index 86% rename from vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/zz_generated.deepcopy.go rename to vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/zz_generated.deepcopy.go index 89c866ae1b9..63f3fc7707e 100644 --- a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/zz_generated.deepcopy.go +++ b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/zz_generated.deepcopy.go @@ -16,10 +16,10 @@ // Code generated by deepcopy-gen. DO NOT EDIT. -package v1beta1 +package v1 import ( - commonv1beta1 "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1" + commonv1 "github.com/kubeflow/tf-operator/pkg/apis/common/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -87,9 +87,19 @@ func (in *PyTorchJobList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PyTorchJobSpec) DeepCopyInto(out *PyTorchJobSpec) { *out = *in + if in.ActiveDeadlineSeconds != nil { + in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds + *out = new(int64) + **out = **in + } + if in.BackoffLimit != nil { + in, out := &in.BackoffLimit, &out.BackoffLimit + *out = new(int32) + **out = **in + } if in.CleanPodPolicy != nil { in, out := &in.CleanPodPolicy, &out.CleanPodPolicy - *out = new(commonv1beta1.CleanPodPolicy) + *out = new(commonv1.CleanPodPolicy) **out = **in } if in.TTLSecondsAfterFinished != nil { @@ -99,14 +109,14 @@ func (in *PyTorchJobSpec) DeepCopyInto(out *PyTorchJobSpec) { } if in.PyTorchReplicaSpecs != nil { in, out := &in.PyTorchReplicaSpecs, &out.PyTorchReplicaSpecs - *out = make(map[PyTorchReplicaType]*commonv1beta1.ReplicaSpec, len(*in)) + *out = make(map[PyTorchReplicaType]*commonv1.ReplicaSpec, len(*in)) for key, val := range *in { - var outVal *commonv1beta1.ReplicaSpec + var outVal *commonv1.ReplicaSpec if val == nil { (*out)[key] = nil } else { in, out := &val, &outVal - *out = new(commonv1beta1.ReplicaSpec) + *out = new(commonv1.ReplicaSpec) (*in).DeepCopyInto(*out) } (*out)[key] = outVal diff --git a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/zz_generated.defaults.go b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/zz_generated.defaults.go similarity index 98% rename from vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/zz_generated.defaults.go rename to vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/zz_generated.defaults.go index 03f5ee1df93..cacafc0fbfa 100644 --- a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta1/zz_generated.defaults.go +++ b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1/zz_generated.defaults.go @@ -16,7 +16,7 @@ // Code generated by defaulter-gen. DO NOT EDIT. -package v1beta1 +package v1 import ( runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta2/types.go b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta2/types.go index 40834cc1c15..237da3bf405 100644 --- a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta2/types.go +++ b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta2/types.go @@ -20,7 +20,6 @@ import ( ) // +genclient -// +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +resource:path=pytorchjob @@ -43,6 +42,16 @@ type PyTorchJob struct { // PyTorchJobSpec is a desired state description of the PyTorchJob. type PyTorchJobSpec struct { + // Specifies the duration in seconds relative to the startTime that the job may be active + // before the system tries to terminate it; value must be positive integer. + // This method applies only to pods with restartPolicy == OnFailure or Always. + // +optional + ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` + + // Optional number of retries before marking this job failed. + // +optional + BackoffLimit *int32 `json:"backoffLimit,omitempty"` + // CleanPodPolicy defines the policy to kill pods after PyTorchJob is // succeeded. // Default to Running. diff --git a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta2/zz_generated.deepcopy.go b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta2/zz_generated.deepcopy.go index 688fdaf0546..e24ddebecd8 100644 --- a/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta2/zz_generated.deepcopy.go +++ b/vendor/github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1beta2/zz_generated.deepcopy.go @@ -87,6 +87,16 @@ func (in *PyTorchJobList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PyTorchJobSpec) DeepCopyInto(out *PyTorchJobSpec) { *out = *in + if in.ActiveDeadlineSeconds != nil { + in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds + *out = new(int64) + **out = **in + } + if in.BackoffLimit != nil { + in, out := &in.BackoffLimit, &out.BackoffLimit + *out = new(int32) + **out = **in + } if in.CleanPodPolicy != nil { in, out := &in.CleanPodPolicy, &out.CleanPodPolicy *out = new(commonv1beta2.CleanPodPolicy) diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/doc.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/doc.go similarity index 91% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/doc.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/doc.go index 0621a0c31e9..48b85e8c02a 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/doc.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/doc.go @@ -16,6 +16,6 @@ // +k8s:defaulter-gen=TypeMeta // +k8s:openapi-gen=true -// Package v1beta1 is the v1beta1 version of the API. +// Package v1 is the v1 version of the API. // +groupName=kubeflow.org -package v1beta1 +package v1 diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1/openapi_generated.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/openapi_generated.go similarity index 98% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1/openapi_generated.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/openapi_generated.go index 0e51decd985..a718227aadd 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1/openapi_generated.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/openapi_generated.go @@ -18,7 +18,7 @@ // This file was autogenerated by openapi-gen. Do not edit it manually! -package v1beta1 +package v1 import ( spec "github.com/go-openapi/spec" @@ -30,6 +30,176 @@ import ( func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { return map[string]common.OpenAPIDefinition{ + "github.com/kubeflow/tf-operator/pkg/apis/common/v1.JobCondition": { + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JobCondition describes the state of the job at a certain point.", + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type of job condition.", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Status of the condition, one of True, False, or Unknown.", + Type: []string{"string"}, + Format: "", + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Description: "The reason for the condition's last transition.", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "A readable message indicating details about the transition.", + Type: []string{"string"}, + Format: "", + }, + }, + "lastUpdateTime": { + SchemaProps: spec.SchemaProps{ + Description: "The last time this condition was updated.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "lastTransitionTime": { + SchemaProps: spec.SchemaProps{ + Description: "Last time the condition transitioned from one status to another.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + }, + Required: []string{"type", "status"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + }, + "github.com/kubeflow/tf-operator/pkg/apis/common/v1.JobStatus": { + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JobStatus represents the current observed state of the training job.", + Properties: map[string]spec.Schema{ + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "An array of current observed job conditions.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubeflow/tf-operator/pkg/apis/common/v1.JobCondition"), + }, + }, + }, + }, + }, + "replicaStatuses": { + SchemaProps: spec.SchemaProps{ + Description: "A map from ReplicaType (key) to ReplicaStatus (value), specifying the status of each replica.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubeflow/tf-operator/pkg/apis/common/v1.ReplicaStatus"), + }, + }, + }, + }, + }, + "startTime": { + SchemaProps: spec.SchemaProps{ + Description: "Represents the time when the job was acknowledged by the job controller. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "completionTime": { + SchemaProps: spec.SchemaProps{ + Description: "Represents the time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "lastReconcileTime": { + SchemaProps: spec.SchemaProps{ + Description: "Represents the last time when the job was reconciled. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + }, + Required: []string{"conditions", "replicaStatuses"}, + }, + }, + Dependencies: []string{ + "github.com/kubeflow/tf-operator/pkg/apis/common/v1.JobCondition", "github.com/kubeflow/tf-operator/pkg/apis/common/v1.ReplicaStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + }, + "github.com/kubeflow/tf-operator/pkg/apis/common/v1.ReplicaSpec": { + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ReplicaSpec is a description of the job replica.", + Properties: map[string]spec.Schema{ + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "The desired number of replicas of the given template. If unspecified, defaults to 1.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Describes the pod that will be created for this replica. Note that RestartPolicy in PodTemplateSpec will be overidden by RestartPolicy in ReplicaSpec.", + Ref: ref("k8s.io/api/core/v1.PodTemplateSpec"), + }, + }, + "restartPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "Restart policy for all replicas within the job. One of Always, OnFailure, Never, or ExitCode. Defaults to Never.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.PodTemplateSpec"}, + }, + "github.com/kubeflow/tf-operator/pkg/apis/common/v1.ReplicaStatus": { + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ReplicaStatus represents the current observed state of the replica.", + Properties: map[string]spec.Schema{ + "active": { + SchemaProps: spec.SchemaProps{ + Description: "The number of actively running pods.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "succeeded": { + SchemaProps: spec.SchemaProps{ + Description: "The number of pods which reached phase Succeeded.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "failed": { + SchemaProps: spec.SchemaProps{ + Description: "The number of pods which reached phase Failed.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + Dependencies: []string{}, + }, "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource": { Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1/common_types.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/types.go similarity index 79% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1/common_types.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/types.go index 8bbeb79e4aa..bfe2bfd657f 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1/common_types.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/types.go @@ -1,4 +1,4 @@ -// Copyright 2018 The Kubeflow Authors +// Copyright 2019 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -package v1beta1 +package v1 import ( "k8s.io/api/core/v1" @@ -19,33 +19,32 @@ import ( ) // +k8s:deepcopy-gen=true -// JobStatus represents the current observed state of the training Job. +// JobStatus represents the current observed state of the training job. type JobStatus struct { - // Conditions is an array of current observed job conditions. + // An array of current observed job conditions. Conditions []JobCondition `json:"conditions"` - // ReplicaStatuses is map of ReplicaType and ReplicaStatus, - // specifies the status of each replica. + // A map from ReplicaType (key) to ReplicaStatus (value), specifying the status of each replica. ReplicaStatuses map[ReplicaType]*ReplicaStatus `json:"replicaStatuses"` - // Represents time when the job was acknowledged by the job controller. + // Represents the time when the job was acknowledged by the job controller. // It is not guaranteed to be set in happens-before order across separate operations. // It is represented in RFC3339 form and is in UTC. StartTime *metav1.Time `json:"startTime,omitempty"` - // Represents time when the job was completed. It is not guaranteed to + // Represents the time when the job was completed. It is not guaranteed to // be set in happens-before order across separate operations. // It is represented in RFC3339 form and is in UTC. CompletionTime *metav1.Time `json:"completionTime,omitempty"` - // Represents last time when the job was reconciled. It is not guaranteed to + // Represents the last time when the job was reconciled. It is not guaranteed to // be set in happens-before order across separate operations. // It is represented in RFC3339 form and is in UTC. LastReconcileTime *metav1.Time `json:"lastReconcileTime,omitempty"` } -// ReplicaType represents the type of the replica. Each operator needs to define its -// own set of ReplicaTypes. +// ReplicaType represents the type of the job replica. Each operator (e.g. TensorFlow, PyTorch) +// needs to define its own set of ReplicaTypes. type ReplicaType string // ReplicaStatus represents the current observed state of the replica. @@ -61,20 +60,19 @@ type ReplicaStatus struct { } // +k8s:deepcopy-gen=true -// ReplicaSpec is a description of the replica +// ReplicaSpec is a description of the job replica. type ReplicaSpec struct { - // Replicas is the desired number of replicas of the given template. + // The desired number of replicas of the given template. // If unspecified, defaults to 1. Replicas *int32 `json:"replicas,omitempty"` - // Template is the object that describes the pod that - // will be created for this replica. RestartPolicy in PodTemplateSpec - // will be overide by RestartPolicy in ReplicaSpec + // Describes the pod that will be created for this replica. Note that + // RestartPolicy in PodTemplateSpec will be overidden by RestartPolicy in ReplicaSpec. Template v1.PodTemplateSpec `json:"template,omitempty"` // Restart policy for all replicas within the job. - // One of Always, OnFailure, Never and ExitCode. - // Default to Never. + // One of Always, OnFailure, Never, or ExitCode. + // Defaults to Never. RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"` } @@ -83,19 +81,25 @@ type ReplicaSpec struct { type JobCondition struct { // Type of job condition. Type JobConditionType `json:"type"` - // Status of the condition, one of True, False, Unknown. + + // Status of the condition, one of True, False, or Unknown. Status v1.ConditionStatus `json:"status"` + // The reason for the condition's last transition. Reason string `json:"reason,omitempty"` - // A human readable message indicating details about the transition. + + // A readable message indicating details about the transition. Message string `json:"message,omitempty"` + // The last time this condition was updated. LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"` + // Last time the condition transitioned from one status to another. LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` } -// JobConditionType defines all kinds of types of JobStatus. +// JobConditionType defines all possible types of JobStatus. Can be one of: +// Created, Running, Restarting, Succeeded, or Failed. type JobConditionType string const ( @@ -126,7 +130,8 @@ const ( JobFailed JobConditionType = "Failed" ) -// CleanPodPolicy describes how to deal with pods when the job is finished. +// CleanPodPolicy describes how to deal with pods when the job is finished. Can be one +// of: All, Running, or None. type CleanPodPolicy string const ( @@ -137,7 +142,7 @@ const ( ) // RestartPolicy describes how the replicas should be restarted. -// Only one of the following restart policies may be specified. +// Can be one of: Always, OnFailure, Never, or ExitCode. // If none of the following policies is specified, the default one // is RestartPolicyAlways. type RestartPolicy string diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/zz_generated.deepcopy.go similarity index 87% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1/zz_generated.deepcopy.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/zz_generated.deepcopy.go index 00fef9c00c3..d5326dddeae 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1/zz_generated.deepcopy.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ // Code generated by deepcopy-gen. DO NOT EDIT. -package v1beta1 +package v1 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *JobCondition) DeepCopyInto(out *JobCondition) { @@ -107,3 +107,19 @@ func (in *ReplicaSpec) DeepCopy() *ReplicaSpec { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReplicaStatus) DeepCopyInto(out *ReplicaStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaStatus. +func (in *ReplicaStatus) DeepCopy() *ReplicaStatus { + if in == nil { + return nil + } + out := new(ReplicaStatus) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1/zz_generated.defaults.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/zz_generated.defaults.go similarity index 98% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1/zz_generated.defaults.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/zz_generated.defaults.go index 7c1f2bfa91e..cf8b8f7c77c 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1/zz_generated.defaults.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1/zz_generated.defaults.go @@ -16,7 +16,7 @@ // Code generated by defaulter-gen. DO NOT EDIT. -package v1beta1 +package v1 import ( runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/doc.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/doc.go new file mode 100644 index 00000000000..b52bb41c86d --- /dev/null +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/doc.go @@ -0,0 +1,21 @@ +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +k8s:deepcopy-gen=package,register +// +k8s:defaulter-gen=TypeMeta +// +k8s:openapi-gen=true + +// Package v1beta2 is the v1beta2 version of the API. +// +groupName=kubeflow.org +package v1beta2 diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/openapi_generated.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/openapi_generated.go index 55ea2ad80cd..100e4aa08bf 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/openapi_generated.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/openapi_generated.go @@ -30,6 +30,176 @@ import ( func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { return map[string]common.OpenAPIDefinition{ + "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2.JobCondition": { + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JobCondition describes the state of the job at a certain point.", + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type of job condition.", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Status of the condition, one of True, False, Unknown.", + Type: []string{"string"}, + Format: "", + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Description: "The reason for the condition's last transition.", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "A human readable message indicating details about the transition.", + Type: []string{"string"}, + Format: "", + }, + }, + "lastUpdateTime": { + SchemaProps: spec.SchemaProps{ + Description: "The last time this condition was updated.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "lastTransitionTime": { + SchemaProps: spec.SchemaProps{ + Description: "Last time the condition transitioned from one status to another.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + }, + Required: []string{"type", "status"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + }, + "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2.JobStatus": { + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JobStatus represents the current observed state of the training Job.", + Properties: map[string]spec.Schema{ + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "Conditions is an array of current observed job conditions.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2.JobCondition"), + }, + }, + }, + }, + }, + "replicaStatuses": { + SchemaProps: spec.SchemaProps{ + Description: "ReplicaStatuses is map of ReplicaType and ReplicaStatus, specifies the status of each replica.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2.ReplicaStatus"), + }, + }, + }, + }, + }, + "startTime": { + SchemaProps: spec.SchemaProps{ + Description: "Represents time when the job was acknowledged by the job controller. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "completionTime": { + SchemaProps: spec.SchemaProps{ + Description: "Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "lastReconcileTime": { + SchemaProps: spec.SchemaProps{ + Description: "Represents last time when the job was reconciled. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + }, + Required: []string{"conditions", "replicaStatuses"}, + }, + }, + Dependencies: []string{ + "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2.JobCondition", "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2.ReplicaStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + }, + "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2.ReplicaSpec": { + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ReplicaSpec is a description of the replica", + Properties: map[string]spec.Schema{ + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "Replicas is the desired number of replicas of the given template. If unspecified, defaults to 1.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "Template is the object that describes the pod that will be created for this replica. RestartPolicy in PodTemplateSpec will be overide by RestartPolicy in ReplicaSpec", + Ref: ref("k8s.io/api/core/v1.PodTemplateSpec"), + }, + }, + "restartPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "Restart policy for all replicas within the job. One of Always, OnFailure, Never and ExitCode. Default to Never.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.PodTemplateSpec"}, + }, + "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2.ReplicaStatus": { + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ReplicaStatus represents the current observed state of the replica.", + Properties: map[string]spec.Schema{ + "active": { + SchemaProps: spec.SchemaProps{ + Description: "The number of actively running pods.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "succeeded": { + SchemaProps: spec.SchemaProps{ + Description: "The number of pods which reached phase Succeeded.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "failed": { + SchemaProps: spec.SchemaProps{ + Description: "The number of pods which reached phase Failed.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + Dependencies: []string{}, + }, "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource": { Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/common_types.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/types.go similarity index 100% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/common_types.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/types.go diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/zz_generated.deepcopy.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/zz_generated.deepcopy.go index fefeb94cec9..ddc9521b170 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/zz_generated.deepcopy.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/common/v1beta2/zz_generated.deepcopy.go @@ -107,3 +107,19 @@ func (in *ReplicaSpec) DeepCopy() *ReplicaSpec { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReplicaStatus) DeepCopyInto(out *ReplicaStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaStatus. +func (in *ReplicaStatus) DeepCopy() *ReplicaStatus { + if in == nil { + return nil + } + out := new(ReplicaStatus) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/constants.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/constants.go similarity index 93% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/constants.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/constants.go index 2295d8099f0..59d0c852a4e 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/constants.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/constants.go @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1beta1 +package v1 import ( - common "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1" + common "github.com/kubeflow/tf-operator/pkg/apis/common/v1" ) const ( diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/defaults.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/defaults.go similarity index 97% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/defaults.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/defaults.go index 0b61ff1204f..5dc0950e4f8 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/defaults.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/defaults.go @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1beta1 +package v1 import ( "strings" - common "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1" + common "github.com/kubeflow/tf-operator/pkg/apis/common/v1" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" ) diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/doc.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/doc.go new file mode 100644 index 00000000000..48b85e8c02a --- /dev/null +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/doc.go @@ -0,0 +1,21 @@ +// Copyright 2018 The Kubeflow Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +k8s:deepcopy-gen=package,register +// +k8s:defaulter-gen=TypeMeta +// +k8s:openapi-gen=true + +// Package v1 is the v1 version of the API. +// +groupName=kubeflow.org +package v1 diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/openapi_generated.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/openapi_generated.go similarity index 99% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/openapi_generated.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/openapi_generated.go index f00f3e74bbd..57d9d8efe90 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/openapi_generated.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/openapi_generated.go @@ -18,7 +18,7 @@ // This file was autogenerated by openapi-gen. Do not edit it manually! -package v1beta1 +package v1 import ( spec "github.com/go-openapi/spec" @@ -30,10 +30,10 @@ import ( func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { return map[string]common.OpenAPIDefinition{ - "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1.TFJob": { + "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1.TFJob": { Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "TFJob represents the configuration of signal TFJob", + Description: "Represents a TFJob resource.", Properties: map[string]spec.Schema{ "kind": { SchemaProps: spec.SchemaProps{ @@ -51,29 +51,29 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA }, "metadata": { SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata.", + Description: "Standard Kubernetes object's metadata.", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, "spec": { SchemaProps: spec.SchemaProps{ - Description: "Specification of the desired behavior of the TFJob.", - Ref: ref("github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1.TFJobSpec"), + Description: "Specification of the desired state of the TFJob.", + Ref: ref("github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1.TFJobSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ - Description: "Most recently observed status of the TFJob. This data may not be up to date. Populated by the system. Read-only.", - Ref: ref("github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1.JobStatus"), + Description: "Most recently observed status of the TFJob. Read-only (modified by the system).", + Ref: ref("github.com/kubeflow/tf-operator/pkg/apis/common/v1.JobStatus"), }, }, }, }, }, Dependencies: []string{ - "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1.JobStatus", "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1.TFJobSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + "github.com/kubeflow/tf-operator/pkg/apis/common/v1.JobStatus", "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1.TFJobSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, }, - "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1.TFJobList": { + "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1.TFJobList": { Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Description: "TFJobList is a list of TFJobs.", @@ -105,7 +105,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1.TFJob"), + Ref: ref("github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1.TFJob"), }, }, }, @@ -116,35 +116,49 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA }, }, Dependencies: []string{ - "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1.TFJob", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1.TFJob", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, }, - "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1.TFJobSpec": { + "github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1.TFJobSpec": { Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Description: "TFJobSpec is a desired state description of the TFJob.", Properties: map[string]spec.Schema{ + "activeDeadlineSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the duration (in seconds) since startTime during which the job can remain active before it is terminated. Must be a positive integer. This setting applies only to pods where restartPolicy is OnFailure or Always.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "backoffLimit": { + SchemaProps: spec.SchemaProps{ + Description: "Number of retries before marking this job as failed.", + Type: []string{"integer"}, + Format: "int32", + }, + }, "cleanPodPolicy": { SchemaProps: spec.SchemaProps{ - Description: "CleanPodPolicy defines the policy to kill pods after TFJob is succeeded. Default to Running.", + Description: "Defines the policy for cleaning up pods after the TFJob completes. Defaults to Running.", Type: []string{"string"}, Format: "", }, }, "ttlSecondsAfterFinished": { SchemaProps: spec.SchemaProps{ - Description: "TTLSecondsAfterFinished is the TTL to clean up tf-jobs (temporary before kubernetes adds the cleanup controller). It may take extra ReconcilePeriod seconds for the cleanup, since reconcile gets called periodically. Default to infinite.", + Description: "Defines the TTL for cleaning up finished TFJobs (temporary before kubernetes adds the cleanup controller). It may take extra ReconcilePeriod seconds for the cleanup, since reconcile gets called periodically. Defaults to infinite.", Type: []string{"integer"}, Format: "int32", }, }, "tfReplicaSpecs": { SchemaProps: spec.SchemaProps{ - Description: "TFReplicaSpecs is map of TFReplicaType and ReplicaSpec specifies the TF replicas to run. For example,\n {\n \"PS\": ReplicaSpec,\n \"Worker\": ReplicaSpec,\n }", + Description: "A map of TFReplicaType (type) to ReplicaSpec (value). Specifies the TF cluster configuration. For example,\n {\n \"PS\": ReplicaSpec,\n \"Worker\": ReplicaSpec,\n }", Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1.ReplicaSpec"), + Ref: ref("github.com/kubeflow/tf-operator/pkg/apis/common/v1.ReplicaSpec"), }, }, }, @@ -155,7 +169,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA }, }, Dependencies: []string{ - "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1.ReplicaSpec"}, + "github.com/kubeflow/tf-operator/pkg/apis/common/v1.ReplicaSpec"}, }, "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource": { Schema: spec.Schema{ diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/register.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/register.go similarity index 98% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/register.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/register.go index fb072d2f351..9c389d71d4e 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/register.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/register.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1beta1 +package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -34,7 +34,7 @@ const ( // Kind is the kind name. Kind = "TFJob" // GroupVersion is the version. - GroupVersion = "v1beta1" + GroupVersion = "v1" // Plural is the Plural for TFJob. Plural = "tfjobs" // Singular is the singular for TFJob. diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/types.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/types.go similarity index 69% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/types.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/types.go index 79eaad27aa5..dc4d9601bfc 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/types.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/types.go @@ -1,4 +1,4 @@ -// Copyright 2018 The Kubeflow Authors +// Copyright 2019 The Kubeflow Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,51 +12,57 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1beta1 +package v1 import ( - common "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1" + common "github.com/kubeflow/tf-operator/pkg/apis/common/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // +genclient -// +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +resource:path=tfjob -// TFJob represents the configuration of signal TFJob +// Represents a TFJob resource. type TFJob struct { + // Standard Kubernetes type metadata. metav1.TypeMeta `json:",inline"` - // Standard object's metadata. + // Standard Kubernetes object's metadata. metav1.ObjectMeta `json:"metadata,omitempty"` - // Specification of the desired behavior of the TFJob. + // Specification of the desired state of the TFJob. Spec TFJobSpec `json:"spec,omitempty"` // Most recently observed status of the TFJob. - // This data may not be up to date. - // Populated by the system. - // Read-only. + // Read-only (modified by the system). Status common.JobStatus `json:"status,omitempty"` } // TFJobSpec is a desired state description of the TFJob. type TFJobSpec struct { - // CleanPodPolicy defines the policy to kill pods after TFJob is - // succeeded. - // Default to Running. + // Specifies the duration (in seconds) since startTime during which the job can remain active + // before it is terminated. Must be a positive integer. + // This setting applies only to pods where restartPolicy is OnFailure or Always. + // +optional + ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` + + // Number of retries before marking this job as failed. + // +optional + BackoffLimit *int32 `json:"backoffLimit,omitempty"` + + // Defines the policy for cleaning up pods after the TFJob completes. + // Defaults to Running. CleanPodPolicy *common.CleanPodPolicy `json:"cleanPodPolicy,omitempty"` - // TTLSecondsAfterFinished is the TTL to clean up tf-jobs (temporary + // Defines the TTL for cleaning up finished TFJobs (temporary // before kubernetes adds the cleanup controller). // It may take extra ReconcilePeriod seconds for the cleanup, since // reconcile gets called periodically. - // Default to infinite. + // Defaults to infinite. TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` - // TFReplicaSpecs is map of TFReplicaType and ReplicaSpec - // specifies the TF replicas to run. + // A map of TFReplicaType (type) to ReplicaSpec (value). Specifies the TF cluster configuration. // For example, // { // "PS": ReplicaSpec, @@ -65,7 +71,8 @@ type TFJobSpec struct { TFReplicaSpecs map[TFReplicaType]*common.ReplicaSpec `json:"tfReplicaSpecs"` } -// TFReplicaType is the type for TFReplica. +// TFReplicaType is the type for TFReplica. Can be one of: "Chief"/"Master" (semantically equivalent), +// "Worker", "PS", or "Evaluator". type TFReplicaType common.ReplicaType const ( @@ -94,6 +101,7 @@ const ( // TFJobList is a list of TFJobs. type TFJobList struct { + // Standard type metadata. metav1.TypeMeta `json:",inline"` // Standard list metadata. diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/util.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/util.go similarity index 98% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/util.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/util.go index a2e9d7214ca..6eb73695818 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/util.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/util.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package v1beta1 +package v1 // IsChieforMaster returns true if the type is Master or Chief. func IsChieforMaster(typ TFReplicaType) bool { diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/zz_generated.deepcopy.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/zz_generated.deepcopy.go similarity index 86% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/zz_generated.deepcopy.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/zz_generated.deepcopy.go index 1a7886c3401..36aff3998d5 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/zz_generated.deepcopy.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/zz_generated.deepcopy.go @@ -16,10 +16,10 @@ // Code generated by deepcopy-gen. DO NOT EDIT. -package v1beta1 +package v1 import ( - commonv1beta1 "github.com/kubeflow/tf-operator/pkg/apis/common/v1beta1" + commonv1 "github.com/kubeflow/tf-operator/pkg/apis/common/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -87,9 +87,19 @@ func (in *TFJobList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TFJobSpec) DeepCopyInto(out *TFJobSpec) { *out = *in + if in.ActiveDeadlineSeconds != nil { + in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds + *out = new(int64) + **out = **in + } + if in.BackoffLimit != nil { + in, out := &in.BackoffLimit, &out.BackoffLimit + *out = new(int32) + **out = **in + } if in.CleanPodPolicy != nil { in, out := &in.CleanPodPolicy, &out.CleanPodPolicy - *out = new(commonv1beta1.CleanPodPolicy) + *out = new(commonv1.CleanPodPolicy) **out = **in } if in.TTLSecondsAfterFinished != nil { @@ -99,14 +109,14 @@ func (in *TFJobSpec) DeepCopyInto(out *TFJobSpec) { } if in.TFReplicaSpecs != nil { in, out := &in.TFReplicaSpecs, &out.TFReplicaSpecs - *out = make(map[TFReplicaType]*commonv1beta1.ReplicaSpec, len(*in)) + *out = make(map[TFReplicaType]*commonv1.ReplicaSpec, len(*in)) for key, val := range *in { - var outVal *commonv1beta1.ReplicaSpec + var outVal *commonv1.ReplicaSpec if val == nil { (*out)[key] = nil } else { in, out := &val, &outVal - *out = new(commonv1beta1.ReplicaSpec) + *out = new(commonv1.ReplicaSpec) (*in).DeepCopyInto(*out) } (*out)[key] = outVal diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/zz_generated.defaults.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/zz_generated.defaults.go similarity index 98% rename from vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/zz_generated.defaults.go rename to vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/zz_generated.defaults.go index ccc9535b978..fc89223996e 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta1/zz_generated.defaults.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1/zz_generated.defaults.go @@ -16,7 +16,7 @@ // Code generated by defaulter-gen. DO NOT EDIT. -package v1beta1 +package v1 import ( runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2/openapi_generated.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2/openapi_generated.go index edbc9a571d6..8ab476165ad 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2/openapi_generated.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2/openapi_generated.go @@ -123,6 +123,20 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA SchemaProps: spec.SchemaProps{ Description: "TFJobSpec is a desired state description of the TFJob.", Properties: map[string]spec.Schema{ + "activeDeadlineSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer. This method applies only to pods with restartPolicy == OnFailure or Always.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "backoffLimit": { + SchemaProps: spec.SchemaProps{ + Description: "Optional number of retries before marking this job failed.", + Type: []string{"integer"}, + Format: "int32", + }, + }, "cleanPodPolicy": { SchemaProps: spec.SchemaProps{ Description: "CleanPodPolicy defines the policy to kill pods after TFJob is succeeded. Default to Running.", diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2/types.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2/types.go index 60bda2c9302..73e295d0e33 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2/types.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2/types.go @@ -42,6 +42,16 @@ type TFJob struct { // TFJobSpec is a desired state description of the TFJob. type TFJobSpec struct { + // Specifies the duration in seconds relative to the startTime that the job may be active + // before the system tries to terminate it; value must be positive integer. + // This method applies only to pods with restartPolicy == OnFailure or Always. + // +optional + ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` + + // Optional number of retries before marking this job failed. + // +optional + BackoffLimit *int32 `json:"backoffLimit,omitempty"` + // CleanPodPolicy defines the policy to kill pods after TFJob is // succeeded. // Default to Running. diff --git a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2/zz_generated.deepcopy.go b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2/zz_generated.deepcopy.go index d8b4a81e4dd..05c8c3c840a 100644 --- a/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2/zz_generated.deepcopy.go +++ b/vendor/github.com/kubeflow/tf-operator/pkg/apis/tensorflow/v1beta2/zz_generated.deepcopy.go @@ -87,6 +87,16 @@ func (in *TFJobList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TFJobSpec) DeepCopyInto(out *TFJobSpec) { *out = *in + if in.ActiveDeadlineSeconds != nil { + in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds + *out = new(int64) + **out = **in + } + if in.BackoffLimit != nil { + in, out := &in.BackoffLimit, &out.BackoffLimit + *out = new(int32) + **out = **in + } if in.CleanPodPolicy != nil { in, out := &in.CleanPodPolicy, &out.CleanPodPolicy *out = new(commonv1beta2.CleanPodPolicy)