-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(backend): support yaml with platform-specific specs #8983
Conversation
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 @Linchin!
I left a few comments (some of them may be important)
/test kubeflow-pipeline-backend-test |
/lgtm Thank you, @Linchin! |
assert.Equal(t, expectedTemplate, templateV2Spec) | ||
} | ||
|
||
func TestNewTemplate_WithExecutorConfig(t *testing.T) { |
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.
nit: WithPlatformSpec? Cause IR contains executor config, also the message is called PlatformSpec
:
pipelines/api/v2alpha1/pipeline_spec.proto
Line 1003 in dabc027
message PlatformSpec { |
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.
Good point, I will rename the function.
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.
done.
return nil, util.NewInvalidInputErrorWithDetails(ErrorInvalidPipelineSpec, "invalid v2 pipeline spec: root component is empty") | ||
} | ||
v2Spec.spec = &spec | ||
} else if isKubernetesExecutorConfig(valueBytes) { |
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.
Again on the naming, maybe PlatformSpec
instead of ExecutorConfig
?
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, I just updated it.
@@ -217,3 +271,16 @@ func (t *V2Spec) RunWorkflow(modelRun *model.Run, options RunWorkflowOptions) (u | |||
executionSpec.SetPodMetadataLabels(util.LabelKeyWorkflowRunId, options.RunId) | |||
return executionSpec, nil | |||
} | |||
|
|||
func isKubernetesExecutorConfig(template []byte) 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.
This method should check for key == kubernetes
, there could be other platform specs in the future.
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.
What is the purpose of making sure the kubernetes
exists? As we allow pipeline spec without platform spec here, we can probably let it pass with a non-kubernetes platform spec. WDYT?
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 don't need to make sure kubernetes
exists, but we do need to prevent mis-recognize other
platform specs as kubernetes
spec. The current change in the PR would treat any platform spec as kubernetes
spec.
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.
A question that may be unrelated: should we keep all platforms' configs in memory, or only pick out the k8s related one?
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 added a check for the key "Kubernetes".
/test kubeflow-pipeline-backend-test |
if err != nil { | ||
return false | ||
} | ||
_, ok := platformSpec.Platforms["kubernetes"] |
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.
The function name should match what it checks, per this line of code, only kubernetes
platform spec should return True
, if that's the intention, the function name should reflect kubernetes
as well.
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! I just updated the function 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.
/lgtm
/approve
Thanks!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chensun The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* support yaml with platform-specific info * run go mod tidy and fix comments * license, test and small fixes * fix integration test and add test * address comments * address comments
Description of your changes:
Fixes #8758
Checklist: