Skip to content

fix(backend): use pipeline version references for pinned recurring runs. Fixes #13933 - #13940

Open
demarna1 wants to merge 2 commits into
kubeflow:masterfrom
demarna1:fix-13933-reference-pinned-recurring-runs
Open

fix(backend): use pipeline version references for pinned recurring runs. Fixes #13933#13940
demarna1 wants to merge 2 commits into
kubeflow:masterfrom
demarna1:fix-13933-reference-pinned-recurring-runs

Conversation

@demarna1

Copy link
Copy Markdown
Contributor

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), CreateJob resolved the template at creation time and embedded the compiled Argo workflow into the ScheduledWorkflow CR (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):

  • CreateJob now stores only pipelineId/pipelineVersionId on the ScheduledWorkflow (plus runtime parameters and pipeline root) and persists the recurring run without a manifest. Job inputs are still validated up front via ValidateJobInputs.
  • At trigger time, the ScheduledWorkflow controller's existing reference branch calls RunService.CreateRun with a PipelineVersionReference carrying the pinned PipelineVersionId, 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.
  • The duplicated reference-SWF construction is extracted into a referenceScheduledWorkflow helper shared with the "latest" branch, and the manifest-persistence gate is now an explicit embedManifest flag instead of relying on tmpl nil-ness.

Behavior preserved:

  • Raw manifest submissions (PipelineSpecManifest/WorkflowSpecManifest supplied) keep embedding, as before.
  • V1 (Argo) templates keep embedding, including the v1beta1 API's pin-latest-at-creation shim.
  • Existing recurring runs are unaffected: they keep their persisted manifests and continue to be reconciled by ReconcileSwfCrs; new pinned jobs are skipped by its existing empty-manifest check, same as latest-path jobs.
  • Like the latest path, the recurring run's service account is no longer defaulted from the compiled spec at creation time; the default is applied when the run is compiled at trigger time.

Per-trigger compilation cost matches what the "latest" path already incurs today.

Testing

  • New TestCreateJob_ThroughPipelineVersionV2: pinned V2 version → stored job has no manifest, SWF carries pipelineVersionId with spec.workflow.spec absent and runtime parameters present.
  • New TestCreateJob_ThroughPipelineVersionV2_InvalidParams: extra runtime parameter is rejected at creation time.
  • New TestSubmitNewWorkflowIfNotAlreadySubmitted_PipelineVersionReference: closes an existing coverage gap on the controller's reference branch — asserts no Argo workflow is created directly and the CreateRunRequest carries the pinned PipelineVersionReference, recurring run id, and translated runtime config.
  • Existing pinned-V1 and raw-manifest tests (TestCreateJob_ThroughPipelineVersion, TestCreateJob_ThroughPipelineIdAndPipelineVersion, TestCreateJob_ThroughWorkflowSpec*, TestReconcileSwfCrs, v1 job_server tests) pass unmodified.
  • Full backend unit sweep (per repo guide, excluding integration/compiler/E2E suites) passes.

Checklist

🤖 Generated with Claude Code

…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>
@google-oss-prow
google-oss-prow Bot requested a review from alyssacgoins July 31, 2026 02:29
@google-oss-prow

Copy link
Copy Markdown

[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 nsingla for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop embedding compiled workflow manifests in ScheduledWorkflow for version-pinned recurring runs

1 participant