feat(docs): Extend KEP-2170 with Initializer plugin design
What this PR does / why we need it:
Extends KEP-2170 with a new ### The Initializer Plugin section specifying a
dedicated Pipeline Framework plugin that owns dataset/model initializer
wiring. Also adds EnforceInitializer to the Build Phase extension points.
Motivation
Today the initializer wiring lives inside the JobSet plugin's builder
(pkg/runtime/framework/plugins/jobset/builder.go:42-102), which:
- Conflates JobSet assembly with Initializer configuration
- Forces TrainJobs to use only Runtimes that already ship initializer ReplicatedJob templates (blocks #2886)
- Leaves no natural home for sharing (KEP-3310, #3311)
What this PR adds
### The Initializer Pluginsection under Design DetailsEnforceInitializerextension point in the Pipeline Framework list- Schema sketches for
Container.EnvFromandConfiguration.InitializerDefaults
Related: #2886, #3311
Checklist:
- [ ] Docs included if any changes are user facing
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign terrytangyuan for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
cc @andreyvelich @tenzen-y @astefanutti
@akshaychitneni Could you also update Implementation History please? https://github.com/kubeflow/trainer/tree/master/proposals/2170-kubeflow-trainer-v2#implementation-history
@akshaychitneni @andreyvelich do we need to worry about how this interacts with the snapshot mechanism? Eg if the defaults are updated should they be applied only to new train jobs or should existing train jobs also be updated?
Can we consider these defaults as "initial" config that can be overridden by the runtime or train job? If we can, do we need a plug-in for this? Can we just change the runtime loading logic to be "load me the effective runtime, applying any defaults if necessary"?
Eg if the defaults are updated should they be applied only to new train jobs or should existing train jobs also be updated? Can we consider these defaults as "initial" config that can be overridden by the runtime or train job?
IMO, it should only be applied to the newly created TrainJobs. If the Config is updated after TrainJob is already created, it should not change it.
Eg if the defaults are updated should they be applied only to new train jobs or should existing train jobs also be updated? Can we consider these defaults as "initial" config that can be overridden by the runtime or train job?
IMO, it should only be applied to the newly created TrainJobs. If the Config is updated after TrainJob is already created, it should not change it.
I agree with this. In which case we need to update the snapshot mechanism to snapshot the effective runtime (ie after the defaults have been applied).
@akshaychitneni could we update the snapshot kep once we have agreed a spec?
Hii, Following from the discussion of @robert-bell and @andreyvelich, one possible improvement could be to explicitly document the boundary between initializer defaults and runtime defaults.
It seems useful to keep the Initializer plugin runtime-agnostic and PodSet-aware, while leaving runtime-specific translation such as JobSet volumeClaimPolicies to the runtime ComponentBuilder. For the defaults API, maybe we can start with a focused initializer-specific shape, but group PVC-related fields under something like volumeClaimPolicy so fields such as storageClassName, accessModes, and resources can be extended without growing many top-level fields.
This may address #2886 while still leaving room for future shared initializer support from #3311.
Hii, Following from the discussion of @robert-bell and @andreyvelich, one possible improvement could be to explicitly document the boundary between initializer defaults and runtime defaults.
It seems useful to keep the Initializer plugin runtime-agnostic and PodSet-aware, while leaving runtime-specific translation such as JobSet
volumeClaimPoliciesto the runtimeComponentBuilder. For the defaults API, maybe we can start with a focused initializer-specific shape, but group PVC-related fields under something likevolumeClaimPolicyso fields such asstorageClassName,accessModes, and resources can be extended without growing many top-level fields.This may address #2886 while still leaving room for future shared initializer support from #3311.
Based on the discussion in https://github.com/kubeflow/trainer/pull/3701#discussion_r3567573524, moved with runtime defaults having jobset spec for now
@andreyvelich @robert-bell checking if you have any other comments from moving this forward. With recent discussion in the call, I believe initialization should be in the prebuild phase and can be included once we land the refactored api
I might be missing context from the call discussion, but the KEP text still describes EnforceInitializer as a Build Phase extension point that runs alongside EnforceMLPolicy and EnforcePodGroupPolicy, while your latest comment mentions moving initialization to the prebuild phase. Should the section be updated to reflect that before this merges, or is that intentionally deferred to the refactored API PR?
Thanks @akshaychitneni. This looks in good shape. Just a small query and suggestion.
Re: prebuild vs. build - I think this is a prebuild step? It's configuring the initializer pods before build?
@robert-bell yes this is prebuild phase
Updated runtime snapshot KEP and also included minimal default spec fields that can later be extended. @robert-bell @andreyvelich