fix(backend): use pipeline version references for pinned recurring runs. Fixes #13933 - #13940
fix(backend): use pipeline version references for pinned recurring runs. Fixes #13933#13940demarna1 wants to merge 2 commits into
Conversation
…ns. Fixes kubeflow#13933 When a recurring run is pinned to a specific pipeline version, CreateJob resolved the template at creation time and embedded the compiled Argo workflow into the ScheduledWorkflow CR and the stored recurring run. This duplicated the stored pipeline version and baked in the launcher/driver images current at creation time, so platform upgrades (e.g. CVE patches) never reached existing recurring runs. Route pinned V2 pipeline versions onto the existing reference-based path used for "always use latest": store only the pipeline (version) reference on the ScheduledWorkflow and let the controller create runs through the CreateRun API, compiling the stored pipeline version fresh at trigger time. Job inputs are still validated up front via ValidateJobInputs. Embedding is preserved for raw manifest submissions and V1 (Argo) templates, including the v1 API pin-latest-at-creation shim. Existing recurring runs are unaffected: they keep their persisted manifests and continue to be reconciled by ReconcileSwfCrs, while new pinned jobs are skipped by its existing empty-manifest check. Signed-off-by: Noah DeMarco <noah.demarco@gmail.com>
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @demarna1. Thanks for your PR. I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
…urring runs Follow-ups to the pinned-recurring-run reference change: - The ScheduledWorkflow controller now expands [[ScheduledTime]], [[Index]] and [[CurrentTime]] in string parameters before calling CreateRun, using the same formatter as the embedded-workflow path, and records the trigger's scheduled time on the created run. [[RunUUID]] is left for the API server, which knows the run ID. - ReconcileSwfCrs no longer skips reference-based jobs: it rebuilds the reference ScheduledWorkflow from the stored recurring run and repairs CR drift, mirroring the ScheduledWorkflow shape CreateJob produces today, including the plugin-registered case. - The plugin-enabled CreateJob branch carries runtime parameters and pipeline root on the ScheduledWorkflow so they reach CreateRun. - Pinned V2 pipeline versions are compiled once at creation time so platform spec and compiler errors surface at creation instead of repeating on every trigger. - referenceScheduledWorkflow moved to the template package as NewReferenceScheduledWorkflow, and StringMapToCRDParameters sorts parameters by name so reconciliation's DeepEqual comparison is deterministic. Signed-off-by: Noah DeMarco <noah.demarco@gmail.com>
Description of your changes
Fixes #13933.
When a recurring run is pinned to a specific pipeline version (the normal UI flow of selecting a version),
CreateJobresolved the template at creation time and embedded the compiled Argo workflow into theScheduledWorkflowCR (spec.workflow.spec) and the stored recurring run (PipelineSpecManifest/WorkflowSpecManifest). This duplicated the durably stored pipeline version and baked in whatever launcher/driver image references were current at creation time — platform upgrades (e.g. patching a CVE in the launcher image) never reached already-created recurring runs.This PR routes pinned V2 pipeline versions onto the reference-based path that already exists for the "always use latest" case (#13440):
CreateJobnow stores onlypipelineId/pipelineVersionIdon theScheduledWorkflow(plus runtime parameters and pipeline root) and persists the recurring run without a manifest. Job inputs are still validated up front viaValidateJobInputs.RunService.CreateRunwith aPipelineVersionReferencecarrying the pinnedPipelineVersionId, so the run is compiled fresh from the stored pipeline version with the platform's current images. No controller changes were needed — this branch already forwards a non-empty pinned version id.referenceScheduledWorkflowhelper shared with the "latest" branch, and the manifest-persistence gate is now an explicitembedManifestflag instead of relying ontmplnil-ness.Behavior preserved:
PipelineSpecManifest/WorkflowSpecManifestsupplied) keep embedding, as before.ReconcileSwfCrs; new pinned jobs are skipped by its existing empty-manifest check, same as latest-path jobs.Per-trigger compilation cost matches what the "latest" path already incurs today.
Testing
TestCreateJob_ThroughPipelineVersionV2: pinned V2 version → stored job has no manifest, SWF carriespipelineVersionIdwithspec.workflow.specabsent and runtime parameters present.TestCreateJob_ThroughPipelineVersionV2_InvalidParams: extra runtime parameter is rejected at creation time.TestSubmitNewWorkflowIfNotAlreadySubmitted_PipelineVersionReference: closes an existing coverage gap on the controller's reference branch — asserts no Argo workflow is created directly and theCreateRunRequestcarries the pinnedPipelineVersionReference, recurring run id, and translated runtime config.TestCreateJob_ThroughPipelineVersion,TestCreateJob_ThroughPipelineIdAndPipelineVersion,TestCreateJob_ThroughWorkflowSpec*,TestReconcileSwfCrs, v1job_servertests) pass unmodified.Checklist
🤖 Generated with Claude Code