-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge kubeflow/common.v1 to mpi-operator
Signed-off-by: lowang_bh <[email protected]> java gen Python SDK Signed-off-by: lowang_bh <[email protected]>
- Loading branch information
Showing
26 changed files
with
603 additions
and
535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// 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. | ||
|
||
package v2beta1 | ||
|
||
import ( | ||
v1 "k8s.io/api/core/v1" | ||
) | ||
|
||
// +k8s:openapi-gen=true | ||
// +k8s:deepcopy-gen=true | ||
// ReplicaSpec is a description of the replica | ||
type ReplicaSpec struct { | ||
// Replicas is 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 | ||
Template v1.PodTemplateSpec `json:"template,omitempty"` | ||
|
||
// Restart policy for all replicas within the job. | ||
// One of Always, OnFailure, Never and ExitCode. | ||
// Default to Never. | ||
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty"` | ||
} | ||
|
||
// +k8s:openapi-gen=true | ||
// RestartPolicy describes how the replicas should be restarted. | ||
// Only one of the following restart policies may be specified. | ||
// If none of the following policies is specified, the default one | ||
// is RestartPolicyAlways. | ||
type RestartPolicy string | ||
|
||
const ( | ||
RestartPolicyAlways RestartPolicy = "Always" | ||
RestartPolicyOnFailure RestartPolicy = "OnFailure" | ||
RestartPolicyNever RestartPolicy = "Never" | ||
|
||
// RestartPolicyExitCode policy means that user should add exit code by themselves, | ||
// The job operator will check these exit codes to | ||
// determine the behavior when an error occurs: | ||
// - 1-127: permanent error, do not restart. | ||
// - 128-255: retryable error, will restart the pod. | ||
RestartPolicyExitCode RestartPolicy = "ExitCode" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.