-
Notifications
You must be signed in to change notification settings - Fork 733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KEP-2170: Adding validation webhook for v2 trainjob #2307
base: master
Are you sure you want to change the base?
Conversation
892a40b
to
f1a06c4
Compare
ce983eb
to
736a759
Compare
Pull Request Test Coverage Report for Build 11784298214Details
💛 - Coveralls |
f85da83
to
ba32e68
Compare
ba32e68
to
20136ef
Compare
20136ef
to
0aa9ee0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for taking this, and moving this forward.
And Sorry for the delay.
Namespace: new.Namespace, | ||
Name: new.Spec.RuntimeRef.Name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you ever seen the isseus when we use the old object names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we get new
object here and not old
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I am validating updated object instead of the existing one
@@ -140,3 +143,115 @@ func (j *JobSet) ReconcilerBuilders() []runtime.ReconcilerBuilder { | |||
}, | |||
} | |||
} | |||
|
|||
func (j *JobSet) Validate(oldObj, newObj *kubeflowv2.TrainJob, runtimeInfo *runtime.Info) (admission.Warnings, field.ErrorList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that there are some conflicts between @andreyvelich PR and this.
@akshaychitneni Could you consult with @andreyvelich, then which PRs should we merge into the main, first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rebased with @andreyvelich's changes
pkg/webhook.v2/setup.go
Outdated
@@ -31,7 +31,7 @@ func Setup(mgr ctrl.Manager, runtimes map[string]runtime.Runtime) (string, error | |||
return kubeflowv2.TrainingRuntimeKind, err | |||
} | |||
if err := setupWebhookForTrainJob(mgr, runtimes); err != nil { | |||
return "TrainJob", err | |||
return kubeflowv2.TrainJobKind, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch.
pkg/webhook.v2/trainjob_webhook.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! This is what I imagined architechture in my KubeflowJobPipeline framework design phase.
failedCtrlName, err := controllerv2.SetupControllers(mgr, runtimes) | ||
gomega.ExpectWithOffset(1, err).NotTo(gomega.HaveOccurred(), "controller", failedCtrlName) | ||
gomega.ExpectWithOffset(1, failedCtrlName).To(gomega.BeEmpty()) | ||
if startControllers { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you ever seen any issues like null pointer when we start the controllers for webhook testing, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I have seen but we might not need to start the controllers just to validate create/update requests and leave to reconciler tests to cover reconciliation
0aa9ee0
to
1b675c5
Compare
a3ea261
to
4b4d76e
Compare
f4d1430
to
a93ffb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this effort @akshaychitneni!
I left initial comments.
pkg/constants/constants.go
Outdated
// JobExporter is the Job name for the exporter. | ||
JobExporter string = "exporter" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can we implement the validation for exporter in the future once we design it as part of: #2245 ?
We should discuss whether we want to use sidecar container or another ReplicatedJob for model checkpointing.
cc @saileshd1402 @akshaychitneni @tenzen-y
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. Makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akshaychitneni Please can you remove the values from your PR that we will not use for now (e.g. JobExporter).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
return r.framework.RunComponentBuilderPlugins(ctx, jobSetTemplate.DeepCopy(), info, trainJob) | ||
} | ||
|
||
func (r *TrainingRuntime) runtimeInfo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be part of Runtime interface: https://github.com/kubeflow/training-operator/blob/a93ffb7125c3899519058ba43fa1d5419b498e85/pkg/runtime.v2/interface.go#L32
And should we name this API more explicit (e.g. getRuntimeInfo()
or initializeRuntimeInfo()
) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be part of trainingRuntime as it depends on config from trainJob/trainingRuntume resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but the Info object will be used for every runtime that we register with our manager.
What is the main motivation to create this helper function to construct the Info object for the TrainingRuntime ?
Namespace: new.Namespace, | ||
Name: new.Spec.RuntimeRef.Name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we get new
object here and not old
?
numProcPerNodePath := specPath.Child("trainer").Child("numProcPerNode") | ||
if runtimeInfo.MLPolicy.MPI != nil { | ||
if _, err := strconv.Atoi(*newJobObj.Spec.Trainer.NumProcPerNode); err != nil { | ||
allErrs = append(allErrs, field.Invalid(numProcPerNodePath, newJobObj.Spec.Trainer.NumProcPerNode, "should have an int value")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, is this value compatible with the k8s API conventions: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md ?
numProcPerNodePath := specPath.Child("trainer").Child("numProcPerNode") | ||
if runtimeInfo.RuntimePolicy.MLPolicy.Torch != nil && newObj.Spec.Trainer.NumProcPerNode != nil { | ||
allowedStringValList := []string{"auto", "cpu", "gpu"} | ||
numProcPerNode := *newObj.Spec.Trainer.NumProcPerNode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akshaychitneni @tenzen-y Can't we use CEL for that validation since we just validate values for .nProcPerNode
parameter ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have included CEL validation for this path in trainingRuntimes #2313 but CEL can't be added here for trainJob config as it is requires referenced trainingRuntime config to validate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I see. Do we mean that in TrainJob NumProcPerNode can be different depends on the runtimeRef ?
E.g. for MPI we accept only int
values, but for Torch we accept auto
, cpu
, gpu
, and int
values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this already reloved, right? In that case, let's rely on the CEL validation.
return nil, nil | ||
} | ||
|
||
if newObj.Spec.ModelConfig != nil && newObj.Spec.ModelConfig.Input != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, for now we should check the initContainers in JobSet, as I mentioned here: https://github.com/kubeflow/training-operator/blob/master/pkg/runtime.v2/framework/plugins/jobset/builder.go#L87-L89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am checking the initContainers here https://github.com/kubeflow/training-operator/pull/2307/files#diff-935da6e0f990201db2f6ddf15c768526f70993d5a2408814013e96e3fedd5ebfR165. The condition here is only to check presence to initializer job if input modelconfig or dataset config is present in the trainJob
gomega.Expect(k8sClient.DeleteAllOf(ctx, &kubeflowv2.TrainJob{}, client.InNamespace(ns.Name))).To(gomega.Succeed()) | ||
}) | ||
|
||
ginkgo.When("Creating TrainJob", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tenzen-y @akshaychitneni What is right way to test our validations with integration or unit tests ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think integration tests might be helpful in this case as functioning of trainjob webhook relies on dependent objects like trainingRuntime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both are useful. Basically, we add UTs for all testing cases including all edge case to UTs so that we can easily identify root cause under any problems. The integration tests have objectives to verify if the entire webhook mechanism works correct.
if we rely only on integration (or E2E) tests, it's challenging to identify the root cause and debug.
241c4f1
to
cb8c6c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left very initial comments. I will revisit here after UTs are implemented.
pkg/constants/constants.go
Outdated
// JobExporter is the Job name for the exporter. | ||
JobExporter string = "exporter" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
@@ -20,6 +20,7 @@ import ( | |||
"context" | |||
"errors" | |||
"fmt" | |||
"k8s.io/utils/ptr" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to second group.
pkg/runtime.v2/util/runtime.go
Outdated
func RuntimeRefToGroupKind(runtimeRef kubeflowv2.RuntimeRef) schema.GroupKind { | ||
return schema.GroupKind{ | ||
Group: ptr.Deref(runtimeRef.APIGroup, ""), | ||
Kind: ptr.Deref(runtimeRef.Kind, ""), | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we move this function to https://github.com/kubeflow/trainer/blob/3f3a8d341e3a9244107591b0916260d14b9a0a79/pkg/runtime/core/registry.go?
It would be better to avoid util package as much as possible: https://go.dev/blog/package-names#bad-package-names
pkg/runtime.v2/util/runtime.go
Outdated
func RuntimeRefToGroupKind(runtimeRef kubeflowv2.RuntimeRef) schema.GroupKind { | ||
return schema.GroupKind{ | ||
Group: ptr.Deref(runtimeRef.APIGroup, ""), | ||
Kind: ptr.Deref(runtimeRef.Kind, ""), | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func RuntimeRefToGroupKind(runtimeRef kubeflowv2.RuntimeRef) schema.GroupKind { | |
return schema.GroupKind{ | |
Group: ptr.Deref(runtimeRef.APIGroup, ""), | |
Kind: ptr.Deref(runtimeRef.Kind, ""), | |
} | |
} | |
func RuntimeRefToRuntimeRegistryKey(runtimeRef kubeflowv2.RuntimeRef) string { | |
return schema.GroupKind{ | |
Group: ptr.Deref(runtimeRef.APIGroup, ""), | |
Kind: ptr.Deref(runtimeRef.Kind, ""), | |
}.String() | |
} |
Additionally, could we make more specific helper since this objective is for runtime registry?
numProcPerNodePath := specPath.Child("trainer").Child("numProcPerNode") | ||
if runtimeInfo.RuntimePolicy.MLPolicy.Torch != nil && newObj.Spec.Trainer.NumProcPerNode != nil { | ||
allowedStringValList := []string{"auto", "cpu", "gpu"} | ||
numProcPerNode := *newObj.Spec.Trainer.NumProcPerNode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this already reloved, right? In that case, let's rely on the CEL validation.
pkg/runtime.v2/util/runtime.go
Outdated
"errors" | ||
kubeflowv2 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v2alpha1" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"k8s.io/utils/ptr" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"errors" | |
kubeflowv2 "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v2alpha1" | |
"k8s.io/apimachinery/pkg/runtime/schema" | |
"k8s.io/utils/ptr" | |
"errors" | |
"k8s.io/apimachinery/pkg/runtime/schema" | |
"k8s.io/utils/ptr" | |
trainer "github.com/kubeflow/training-operator/pkg/apis/kubeflow.org/v2alpha1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add unit testings?
jobSetTemplate := jobsetv1alpha2.JobSet{ | ||
Spec: trainingRuntime.Spec.Template.Spec, | ||
} | ||
return r.framework.RunCustomValidationPlugins(jobSetTemplate.DeepCopy(), info, old, new) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm prefer current approach.
Ideally, combined all information to runtimeInfo, then use that each plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add UTs?
gomega.Expect(k8sClient.DeleteAllOf(ctx, &kubeflowv2.TrainJob{}, client.InNamespace(ns.Name))).To(gomega.Succeed()) | ||
}) | ||
|
||
ginkgo.When("Creating TrainJob", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both are useful. Basically, we add UTs for all testing cases including all edge case to UTs so that we can easily identify root cause under any problems. The integration tests have objectives to verify if the entire webhook mechanism works correct.
if we rely only on integration (or E2E) tests, it's challenging to identify the root cause and debug.
cb8c6c3
to
790cca6
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
790cca6
to
c3cf0b1
Compare
c3cf0b1
to
5fed3a9
Compare
fixing runtime Signed-off-by: Akshay Chitneni <[email protected]>
5fed3a9
to
32f04e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @akshaychitneni!
I left a few comments.
@kubeflow/wg-training-leads @Electronic-Waste @saileshd1402 @seanlaii please help with review.
@@ -140,3 +137,31 @@ func (t *Torch) EnforceMLPolicy(info *runtime.Info, trainJob *trainer.TrainJob) | |||
|
|||
return nil | |||
} | |||
|
|||
func (t *Torch) Validate(runtimeJobTemplate client.Object, runtimeInfo *runtime.Info, oldObj, newObj *trainer.TrainJob) (admission.Warnings, field.ErrorList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akshaychitneni Please can you keep this Validate()
function at the top of torch.go
file for consistency with other plugins (e.g. MPI:
trainer/pkg/runtime/framework/plugins/mpi/mpi.go
Lines 79 to 92 in 32f04e3
func (m *MPI) Validate(runtimeJobTemplate client.Object, runtimeInfo *runtime.Info, oldJobObj, newJobObj *trainer.TrainJob) (admission.Warnings, field.ErrorList) { | |
var allErrs field.ErrorList | |
specPath := field.NewPath("spec") | |
if newJobObj.Spec.Trainer != nil { | |
numProcPerNodePath := specPath.Child("trainer").Child("numProcPerNode") | |
if runtimeInfo.RuntimePolicy.MLPolicy != nil && runtimeInfo.RuntimePolicy.MLPolicy.MPI != nil { | |
numProcPerNode := *newJobObj.Spec.Trainer.NumProcPerNode | |
if numProcPerNode.Type != intstr.Int { | |
allErrs = append(allErrs, field.Invalid(numProcPerNodePath, newJobObj.Spec.Trainer.NumProcPerNode, "should have an int value")) | |
} | |
} | |
} | |
return nil, allErrs | |
} |
@@ -159,3 +164,52 @@ func (j *JobSet) TerminalCondition(ctx context.Context, trainJob *trainer.TrainJ | |||
} | |||
return nil, nil | |||
} | |||
|
|||
func (j *JobSet) Validate(runtimeJobTemplate client.Object, runtimeInfo *runtime.Info, oldObj, newObj *trainer.TrainJob) (admission.Warnings, field.ErrorList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question, can we move it after Name()
API.
// TorchEnvNamePrefix is the env name prefix for the distributed envs for torchrun. | ||
TorchEnvNamePrefix = "PET_" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this constant to the L60, and re-use it for other torchrun envs:
trainer/pkg/constants/constants.go
Line 60 in 32f04e3
// TorchEnvNumNodes is the env name for the number of training nodes. |
@@ -111,6 +114,8 @@ const ( | |||
// Distributed envs for mpirun. | |||
// Values for OpenMPI implementation. | |||
OpenMPIEnvHostFileLocation string = "OMPI_MCA_orte_default_hostfile" | |||
|
|||
UnsupportedRuntimeErrMsg string = "the specified runtime is not supported" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tenzen-y @akshaychitneni Do we want to keep this error in the trainjob_controller.go
or constants ?
@@ -83,10 +81,10 @@ func (r *TrainJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c | |||
return ctrl.Result{}, nil | |||
} | |||
|
|||
runtimeRefGK := runtimeRefToGroupKind(trainJob.Spec.RuntimeRef).String() | |||
runtimeRefGK := jobruntimes.RuntimeRefToRuntimeRegistryKey(trainJob.Spec.RuntimeRef) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call this function as:
runtimeRefGK := jobruntimes.RuntimeRefToRuntimeRegistryKey(trainJob.Spec.RuntimeRef) | |
runtimeRefGK := jobruntimes.RuntimeRefToGroupKind(trainJob.Spec.RuntimeRef) |
return r.framework.RunComponentBuilderPlugins(ctx, jobSetTemplate.DeepCopy(), info, trainJob) | ||
} | ||
|
||
func (r *TrainingRuntime) runtimeInfo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Back to my point here: #2307 (comment)
Do we really need to generate Info object when we perform validation ?
The validation of TrainingRuntime executes before TrainJob is created, so we don't really need to construct Info object from TrainJob + TrainingRuntime for the TrainJob validation.
@akshaychitneni @tenzen-y Am I missing something ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see that we use it here, since we need to fetch data from the TrainJob and ClusterTrainingRuntime to define what type of TrainJob validation we need to perform
trainer/pkg/runtime/framework/plugins/mpi/mpi.go
Lines 84 to 88 in 32f04e3
if runtimeInfo.RuntimePolicy.MLPolicy != nil && runtimeInfo.RuntimePolicy.MLPolicy.MPI != nil { | |
numProcPerNode := *newJobObj.Spec.Trainer.NumProcPerNode | |
if numProcPerNode.Type != intstr.Int { | |
allErrs = append(allErrs, field.Invalid(numProcPerNodePath, newJobObj.Spec.Trainer.NumProcPerNode, "should have an int value")) | |
} |
@tenzen-y Is that something that you had in mind when you designed the Runtime Framework ?
if !ok { | ||
return nil, fmt.Errorf("%s: %s", constants.UnsupportedRuntimeErrMsg, runtimeRefGK) | ||
} | ||
warnings, errorList := runtime.ValidateObjects(ctx, oldTrainJob, newTrainJob) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we use old TrainJob object in the ValidateObjects ?
func (m *MPI) Validate(oldObj, newObj *trainer.TrainJob) (admission.Warnings, field.ErrorList) { | ||
return nil, nil | ||
func (m *MPI) Validate(runtimeJobTemplate client.Object, runtimeInfo *runtime.Info, oldJobObj, newJobObj *trainer.TrainJob) (admission.Warnings, field.ErrorList) { | ||
var allErrs field.ErrorList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to be consistent with Enforce API, and just exit this validation if validation is not required:
var allErrs field.ErrorList | |
var allErrs field.ErrorList | |
if info == nil || info.RuntimePolicy.MLPolicy == nil || info.RuntimePolicy.MLPolicy.MPI == nil { | |
return nil, allErrs | |
} | |
} | ||
} | ||
|
||
if slices.ContainsFunc(newObj.Spec.Trainer.Env, func(x corev1.EnvVar) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this TODO:
// TODO (andreyvelich): Add validation to check that TrainJob doesn't have "PET_" envs. |
if newObj.Spec.ModelConfig != nil && newObj.Spec.ModelConfig.Input != nil { | ||
if !slices.ContainsFunc(jobSet.Spec.ReplicatedJobs, func(x jobsetv1alpha2.ReplicatedJob) bool { | ||
return x.Name == constants.JobInitializer | ||
}) { | ||
allErrs = append(allErrs, field.Invalid(runtimeRefPath, newObj.Spec.RuntimeRef, fmt.Sprintf("trainingRuntime should have %s job when trainJob is configured with input modelConfig", constants.JobInitializer))) | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, we can simplify this since if user sets DatasetConfig or ModelConfig we need to check that ReplicatedJob contains Initializer Job.
Adds validation webhook for v2 trainjob.
Relates to #2209
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
Fixes #<issue number>, #<issue number>, ...
format, will close the issue(s) when PR gets merged):Fixes # #2209
Checklist: