Switch to slim base images for components and frontend#12927
Switch to slim base images for components and frontend#12927jsonmp-k8 wants to merge 1 commit intokubeflow:masterfrom
Conversation
|
🎉 Welcome to the Kubeflow Pipelines repo! 🎉 Thanks for opening your first PR! We're excited to have you onboard 🚀 Next steps:
Feel free to ask questions in the comments. |
There was a problem hiding this comment.
Pull request overview
This PR switches from full base images to slim variants across Dockerfiles, SDK defaults, and component definitions to reduce container image sizes. The change affects the default KFP component base image (reducing it from ~900MB to ~150MB), backend/frontend Dockerfiles, and numerous existing component definitions across the codebase.
Changes:
- Updates the SDK's
_DEFAULT_BASE_IMAGEfrompython:3.11topython:3.11-slim - Switches backend Dockerfile to use
python:3.11-slim(compiler stage) anddebian:stable-slim(runtime stage) - Switches frontend Dockerfile to use
node:22.19-slimfor the build stage - Updates 18 component definitions to use slim Python base images (3.7-slim, 3.8-slim, 3.9-slim, 3.11-slim)
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/kfp/dsl/component_factory.py | Changes default base image constant to python:3.11-slim |
| sdk/python/kfp/dsl/component_decorator.py | Updates docstring example to use python:3.11-slim |
| backend/Dockerfile | Switches compiler stage to python:3.11-slim and runtime stage to debian:stable-slim |
| frontend/Dockerfile | Switches build stage to node:22.19-slim |
| samples/core/secret/secret.py | Updates to python:3.7-slim |
| components/snowflake/snowflake_unload_data.py | Updates to python:3.11-slim |
| components/snowflake/component.yaml | Updates compiled YAML to python:3.11-slim |
| components/kubeflow/pytorch-launcher/sample.py | Updates to python:3.11-slim |
| components/google-cloud/.../prepare_data_for_train/component.py | Updates to python:3.8-slim |
| components/google-cloud/...starry_net/upload_decomposition_plots/component.py | Updates to python:3.9-slim |
| components/google-cloud/...starry_net/set_train_args/component.py | Updates to python:3.9-slim |
| components/google-cloud/...starry_net/set_tfrecord_args/component.py | Updates to python:3.9-slim |
| components/google-cloud/...starry_net/set_test_set/component.py | Updates to python:3.9-slim |
| components/google-cloud/...starry_net/set_eval_args/component.py | Updates to python:3.9-slim |
| components/google-cloud/...starry_net/set_dataprep_args/component.py | Updates to python:3.9-slim |
| components/google-cloud/...starry_net/maybe_set_tfrecord_args/component.py | Updates to python:3.9-slim |
| components/google-cloud/...starry_net/get_training_artifacts/component.py | Updates to python:3.9-slim |
| backend/test/resources/artifact_pipeline.py | Updates test to python:3.11-slim |
232e756 to
1185a59
Compare
|
/ok-to-test |
112afbb to
a0399cf
Compare
Use slim variants of base images in component definitions and frontend Dockerfile to reduce container image sizes. This targets components that do not require system tools like git or gcc at runtime. Changes: - frontend: node:22.19 -> node:22.19-slim - Google Cloud starry_net components: python:3.9 -> python:3.9-slim - Google Cloud forecasting: python:3.8 -> python:3.8-slim - Snowflake components: python:3.11 -> python:3.11-slim - PyTorch launcher sample: python:3.11 -> python:3.11-slim The SDK default base image (python:3.11) is intentionally not changed as lightweight Python components rely on system tools (e.g. git) that are not available in slim images. Signed-off-by: Jaison Paul <paul.jaison@gmail.com>
a0399cf to
d0cead2
Compare
|
[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 |
Summary
Use slim variants of base images in component definitions and the frontend Dockerfile to reduce container image sizes. This targets components that do not require system tools like git or gcc at runtime.
node:22.19->node:22.19-slimpython:3.9->python:3.9-slimpython:3.8->python:3.8-slimpython:3.11->python:3.11-slimpython:3.11->python:3.11-slimThe SDK default base image (
python:3.11) is intentionally unchanged, as lightweight Python components rely on system tools (e.g.git) that are not available in slim images.Test plan
node:22.19-slim