Files
55550f8df5 Adding out of the box support to TrainJob (#2560)
* Out-of-the-box support TrainJob

Signed-off-by: Ram Lau <[email protected]>

* Example for Pytorch Distributed

Signed-off-by: Ram Lau <[email protected]>

* Update examples/v1beta1/kubeflow-training-operator/trainjob-pytorch.yaml

Co-authored-by: Andrey Velichkevich <[email protected]>
Signed-off-by: Ram Lau <[email protected]>

* Create folder for Trainer as suggested

Signed-off-by: Ram Lau <[email protected]>

* Movethe exmaple of trainjob to the new folder

Signed-off-by: Ram Lau <[email protected]>

* Ref the primaryContainerName to that of ClusterTrainingRuntime

Signed-off-by: Ram Lau <[email protected]>

* tenzen-y steps down from Katib approver role (#2561)

Signed-off-by: Yuki Iwai <[email protected]>
Signed-off-by: Ram Lau <[email protected]>

* Set Default value for TrainJob Success, Failure Condition and PrimaryPodLabels in the trial Template

Signed-off-by: Ram Lau <[email protected]>

* Enchance Handling for default value of Success, Fail Cond & Pod Label

Signed-off-by: Ram Lau <[email protected]>

* Bug fix for default value condition

Signed-off-by: Ram Lau <[email protected]>

* code format by hack/update-gofmt.sh

Signed-off-by: Ram Lau <[email protected]>

* add TrainJob trial Resources to cert manager config

Signed-off-by: Ram Lau <[email protected]>

* add trainjob to controller rbac

Signed-off-by: Ram Lau <[email protected]>

* Grant JobSet permission to Katib controller

Signed-off-by: Andrey Velichkevich <[email protected]>

* Remove create/delete RBAC for TrainJob

Signed-off-by: Andrey Velichkevich <[email protected]>

* Fix docker build with libpcre2

Signed-off-by: Andrey Velichkevich <[email protected]>

---------

Signed-off-by: Ram Lau <[email protected]>
Signed-off-by: Yuki Iwai <[email protected]>
Signed-off-by: Andrey Velichkevich <[email protected]>
Co-authored-by: Andrey Velichkevich <[email protected]>
Co-authored-by: Yuki Iwai <[email protected]>
2025-08-23 00:01:07 +00:00

61 lines
2.8 KiB
Go

/*
Copyright 2022 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 v1beta1
const (
// DefaultTrialParallelCount is the default value of spec.parallelTrialCount.
DefaultTrialParallelCount = 3
// DefaultResumePolicy is the default value of spec.resumePolicy.
DefaultResumePolicy = NeverResume
// DefaultJobSuccessCondition is the default value of spec.trialTemplate.successCondition for Job.
DefaultJobSuccessCondition = "status.conditions.#(type==\"Complete\")#|#(status==\"True\")#"
// DefaultJobFailureCondition is the default value of spec.trialTemplate.failureCondition for Job.
DefaultJobFailureCondition = "status.conditions.#(type==\"Failed\")#|#(status==\"True\")#"
// DefaultKubeflowJobSuccessCondition is the default value of spec.trialTemplate.successCondition for Kubeflow Training Job.
DefaultKubeflowJobSuccessCondition = "status.conditions.#(type==\"Succeeded\")#|#(status==\"True\")#"
// DefaultKubeflowJobFailureCondition is the default value of spec.trialTemplate.failureCondition for Kubeflow Training Job.
DefaultKubeflowJobFailureCondition = "status.conditions.#(type==\"Failed\")#|#(status==\"True\")#"
// DefaultTrainJobSuccessCondition is the default value of spec.trialTemplate.successCondition for Training Operator Job.
DefaultTrainJobSuccessCondition = "status.conditions.#(type==\"Complete\")#|#(status==\"True\")#"
// DefaultTrainJobFailureCondition is the default value of spec.trialTemplate.failureCondition for Training Operator Job.
DefaultTrainJobFailureCondition = "status.conditions.#(type==\"Failed\")#|#(status==\"True\")#"
)
var (
// DefaultKubeflowJobPrimaryPodLabels is the default value of spec.trialTemplate.primaryPodLabels for Kubeflow Training Job.
DefaultKubeflowJobPrimaryPodLabels = map[string]string{"training.kubeflow.org/job-role": "master"}
// DefaultKubeflowJobPrimaryPodLabels is the default value of spec.trialTemplate.primaryPodLabels for Training Operator Job.
DefaultTrainJobPrimaryPodLabels = map[string]string{"jobset.sigs.k8s.io/replicatedjob-name": "node", "batch.kubernetes.io/job-completion-index": "0"}
// KubeflowJobKinds is the list of Kubeflow Training Job kinds.
KubeflowJobKinds = map[string]bool{
"TFJob": true,
"PyTorchJob": true,
"XGBoostJob": true,
"MPIJob": true,
"TrainJob": true,
}
)