This is an automated email from the ASF dual-hosted git repository.
shahar1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 02f2c852c80 Shrink the CI image by skipping unused Rust docs and the
Go archive (#74076)
02f2c852c80 is described below
commit 02f2c852c808ff4d44833224859000d3ff0e2b38
Author: Yossi Eliaz <[email protected]>
AuthorDate: Sat Oct 3 10:43:49 2026 +0300
Shrink the CI image by skipping unused Rust docs and the Go archive (#74076)
* Shrink the CI image by skipping unused Rust docs and the Go archive
Every CI job restores and loads the CI image, and the OS dependencies layer
carried the default rustup profile (rust-docs, clippy, rustfmt: ~810 MB in
~65k files) plus the downloaded Go archive (~70 MB) left in the image root.
Only rustc and cargo are used, to build wheels from source. Rebuilding the
published image without them removes 65,775 files and 814 MB, and loading it
was 6.6% faster in all ten paired local runs.
* Drop drift-prone size figures from rustup profile comment
The script also feeds the PROD build stage, and the rust-docs size
changes with every stable toolchain, so keep only the constraint.
---------
Co-authored-by: Shahar Epstein <[email protected]>
---
Dockerfile | 5 ++++-
Dockerfile.ci | 5 ++++-
scripts/docker/install_os_dependencies.sh | 5 ++++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index ae3606c0803..08e1f19dc33 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -498,6 +498,7 @@ function install_python() {
function install_golang() {
curl --retry 3 --retry-delay 5
"https://dl.google.com/go/go${GOLANG_MAJOR_MINOR_VERSION}.linux-$(dpkg
--print-architecture).tar.gz" -o "go${GOLANG_MAJOR_MINOR_VERSION}.linux.tar.gz"
rm -rf /usr/local/go && tar -C /usr/local -xzf
go"${GOLANG_MAJOR_MINOR_VERSION}".linux.tar.gz
+ rm -f go"${GOLANG_MAJOR_MINOR_VERSION}".linux.tar.gz
}
function install_jdk() {
@@ -571,7 +572,9 @@ function install_rustup() {
-o /tmp/rustup-init
echo "${rustup_sha256} /tmp/rustup-init" | sha256sum --check
chmod +x /tmp/rustup-init
- /tmp/rustup-init -y --default-toolchain "${RUSTUP_DEFAULT_TOOLCHAIN}"
+ # Building wheels from source needs only rustc and cargo. The default
profile also adds
+ # rust-docs, clippy and rustfmt, which add tens of thousands of files to
the image.
+ /tmp/rustup-init -y --profile minimal --default-toolchain
"${RUSTUP_DEFAULT_TOOLCHAIN}"
rm -f /tmp/rustup-init
}
diff --git a/Dockerfile.ci b/Dockerfile.ci
index 66962b106a9..f7ce2971649 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -438,6 +438,7 @@ function install_python() {
function install_golang() {
curl --retry 3 --retry-delay 5
"https://dl.google.com/go/go${GOLANG_MAJOR_MINOR_VERSION}.linux-$(dpkg
--print-architecture).tar.gz" -o "go${GOLANG_MAJOR_MINOR_VERSION}.linux.tar.gz"
rm -rf /usr/local/go && tar -C /usr/local -xzf
go"${GOLANG_MAJOR_MINOR_VERSION}".linux.tar.gz
+ rm -f go"${GOLANG_MAJOR_MINOR_VERSION}".linux.tar.gz
}
function install_jdk() {
@@ -511,7 +512,9 @@ function install_rustup() {
-o /tmp/rustup-init
echo "${rustup_sha256} /tmp/rustup-init" | sha256sum --check
chmod +x /tmp/rustup-init
- /tmp/rustup-init -y --default-toolchain "${RUSTUP_DEFAULT_TOOLCHAIN}"
+ # Building wheels from source needs only rustc and cargo. The default
profile also adds
+ # rust-docs, clippy and rustfmt, which add tens of thousands of files to
the image.
+ /tmp/rustup-init -y --profile minimal --default-toolchain
"${RUSTUP_DEFAULT_TOOLCHAIN}"
rm -f /tmp/rustup-init
}
diff --git a/scripts/docker/install_os_dependencies.sh
b/scripts/docker/install_os_dependencies.sh
index d802fe8e0ed..01991dc669f 100644
--- a/scripts/docker/install_os_dependencies.sh
+++ b/scripts/docker/install_os_dependencies.sh
@@ -406,6 +406,7 @@ function install_python() {
function install_golang() {
curl --retry 3 --retry-delay 5
"https://dl.google.com/go/go${GOLANG_MAJOR_MINOR_VERSION}.linux-$(dpkg
--print-architecture).tar.gz" -o "go${GOLANG_MAJOR_MINOR_VERSION}.linux.tar.gz"
rm -rf /usr/local/go && tar -C /usr/local -xzf
go"${GOLANG_MAJOR_MINOR_VERSION}".linux.tar.gz
+ rm -f go"${GOLANG_MAJOR_MINOR_VERSION}".linux.tar.gz
}
function install_jdk() {
@@ -479,7 +480,9 @@ function install_rustup() {
-o /tmp/rustup-init
echo "${rustup_sha256} /tmp/rustup-init" | sha256sum --check
chmod +x /tmp/rustup-init
- /tmp/rustup-init -y --default-toolchain "${RUSTUP_DEFAULT_TOOLCHAIN}"
+ # Building wheels from source needs only rustc and cargo. The default
profile also adds
+ # rust-docs, clippy and rustfmt, which add tens of thousands of files to
the image.
+ /tmp/rustup-init -y --profile minimal --default-toolchain
"${RUSTUP_DEFAULT_TOOLCHAIN}"
rm -f /tmp/rustup-init
}