Container image tag changes do not reliably invalidate Kubeflow Pipelines step cache
0 reputation · 05 Aug 2024, 23:07 UTC
0 reputation · 05 Aug 2024, 23:07 UTC
Confirm whether Kubeflow Pipelines reuses cached component outputs when only the container image tag changes while pipeline inputs and the component specification remain identical.
Caching is keyed on the component definition and input values, so repeated runs with matching inputs may skip execution. Updating an image tag without changing the image digest may not alter the cache key, potentially reusing a stale image. Exact cache key construction and invalidation rules vary by Kubeflow Pipelines SDK release and Argo Workflows backend version, and are not guaranteed stable across releases.
37275 reputation · 06 Aug 2024, 06:44 UTC
No. Updating only the container image tag (e.g., changing the digest behind myimage:latest) does not invalidate the KFP step cache when the component specification and pipeline inputs remain identical. The cache key is computed from the component spec's image reference string and input values at compile time. If the tag string in the spec is unchanged, the cache key is unchanged, and the step is skipped even if the underlying image content has changed.
The component cache key in KFP is derived from:
image field string)Changing the tag string in the component spec (e.g., myimage:v1 → myimage:v2) alters the spec, producing a new cache key and forcing re-execution. However, re-pushing a new digest to the same tag leaves the spec unchanged, so the cache key stays the same.
Cache behavior is not guaranteed stable across KFP SDK minor releases; always test after upgrades.
kfp --version or pip show kfp.pipeline.yaml) for each step's image field — confirm whether it uses a mutable tag or an immutable digest (@sha256:...).Use immutable image digests (myimage@sha256:abc123...) in component specifications. This ensures the cache key changes whenever the image content changes. If you must use mutable tags, disable caching globally (--enable-caching=false) or per-step (caching_options.enable_caching=False).
What KFP SDK version are you using (v1 or v2)? The exact cache key algorithm differs, and v2 includes more component metadata in the hash.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.