Skip to content

Commit d4d0500

Browse files
committed
Install rustup and cargo in CI and prod build images
1 parent 4ef0498 commit d4d0500

4 files changed

Lines changed: 35 additions & 3 deletions

File tree

.github/workflows/additional-ci-image-checks.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,10 @@ jobs:
116116
(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
117117
118118
# Check that after earlier cache push, breeze command will build quickly
119+
# This build is a bit slow from in-the scratch builds, so we should run it only in
120+
# regular PRs
119121
check-that-image-builds-quickly:
120-
timeout-minutes: 17
122+
timeout-minutes: 25
121123
name: Check that image builds quickly
122124
runs-on: ${{ fromJSON(inputs.runners) }}
123125
env:
@@ -141,4 +143,6 @@ jobs:
141143
- name: "Install Breeze"
142144
uses: ./.github/actions/breeze
143145
- name: "Check that image builds quickly"
144-
run: breeze shell --max-time 900 --platform "${PLATFORM}"
146+
# Synchronize to be a little bit shorter than above timeout-minutes to make sure that
147+
# if the build takes too long the job will fail with logs. 22 minutes * 60 s = 1320 seconds
148+
run: breeze shell --max-time 1320 --platform "${PLATFORM}"

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ fi
122122
AIRFLOW_PYTHON_VERSION=${AIRFLOW_PYTHON_VERSION:-3.10.18}
123123
PYTHON_LTO=${PYTHON_LTO:-true}
124124
GOLANG_MAJOR_MINOR_VERSION=${GOLANG_MAJOR_MINOR_VERSION:-1.24.4}
125+
RUSTUP_DEFAULT_TOOLCHAIN=${RUSTUP_DEFAULT_TOOLCHAIN:-stable}
125126
COSIGN_VERSION=${COSIGN_VERSION:-3.0.5}
126127

127128
if [[ "${1}" == "runtime" ]]; then
@@ -493,6 +494,11 @@ function install_golang() {
493494
rm -rf /usr/local/go && tar -C /usr/local -xzf go"${GOLANG_MAJOR_MINOR_VERSION}".linux.tar.gz
494495
}
495496

497+
function install_rustup() {
498+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
499+
sh -s -- -y --default-toolchain "${RUSTUP_DEFAULT_TOOLCHAIN}"
500+
}
501+
496502
function apt_clean() {
497503
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
498504
rm -rf /var/lib/apt/lists/* /var/log/*
@@ -508,6 +514,7 @@ else
508514
install_debian_dev_dependencies
509515
install_python
510516
install_additional_dev_dependencies
517+
install_rustup
511518
if [[ "${INSTALLATION_TYPE}" == "CI" ]]; then
512519
install_golang
513520
fi
@@ -1843,6 +1850,10 @@ ENV DEV_APT_DEPS=${DEV_APT_DEPS} \
18431850

18441851
ARG PYTHON_LTO
18451852

1853+
ENV RUSTUP_HOME="/usr/local/rustup"
1854+
ENV CARGO_HOME="/usr/local/cargo"
1855+
ENV PATH="${CARGO_HOME}/bin:${PATH}"
1856+
18461857
COPY --from=scripts install_os_dependencies.sh /scripts/docker/
18471858
RUN PYTHON_LTO=${PYTHON_LTO} bash /scripts/docker/install_os_dependencies.sh dev
18481859

Dockerfile.ci

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ fi
6262
AIRFLOW_PYTHON_VERSION=${AIRFLOW_PYTHON_VERSION:-3.10.18}
6363
PYTHON_LTO=${PYTHON_LTO:-true}
6464
GOLANG_MAJOR_MINOR_VERSION=${GOLANG_MAJOR_MINOR_VERSION:-1.24.4}
65+
RUSTUP_DEFAULT_TOOLCHAIN=${RUSTUP_DEFAULT_TOOLCHAIN:-stable}
6566
COSIGN_VERSION=${COSIGN_VERSION:-3.0.5}
6667

6768
if [[ "${1}" == "runtime" ]]; then
@@ -433,6 +434,11 @@ function install_golang() {
433434
rm -rf /usr/local/go && tar -C /usr/local -xzf go"${GOLANG_MAJOR_MINOR_VERSION}".linux.tar.gz
434435
}
435436

437+
function install_rustup() {
438+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
439+
sh -s -- -y --default-toolchain "${RUSTUP_DEFAULT_TOOLCHAIN}"
440+
}
441+
436442
function apt_clean() {
437443
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
438444
rm -rf /var/lib/apt/lists/* /var/log/*
@@ -448,6 +454,7 @@ else
448454
install_debian_dev_dependencies
449455
install_python
450456
install_additional_dev_dependencies
457+
install_rustup
451458
if [[ "${INSTALLATION_TYPE}" == "CI" ]]; then
452459
install_golang
453460
fi
@@ -1646,6 +1653,9 @@ ENV DEV_APT_COMMAND=${DEV_APT_COMMAND} \
16461653
ARG AIRFLOW_PYTHON_VERSION="3.12.13"
16471654
ENV AIRFLOW_PYTHON_VERSION=${AIRFLOW_PYTHON_VERSION}
16481655
ENV GOLANG_MAJOR_MINOR_VERSION="1.26.1"
1656+
ENV RUSTUP_HOME="/usr/local/rustup"
1657+
ENV CARGO_HOME="/usr/local/cargo"
1658+
ENV PATH="${CARGO_HOME}/bin:${PATH}"
16491659

16501660
ARG PYTHON_LTO
16511661

@@ -1805,7 +1815,7 @@ ENV AIRFLOW_PIP_VERSION=${AIRFLOW_PIP_VERSION} \
18051815
AIRFLOW_PREK_VERSION=${AIRFLOW_PREK_VERSION}
18061816

18071817
# The PATH is needed for python to find installed and cargo to build the wheels
1808-
ENV PATH="/usr/python/bin:/root/.local/bin:/root/.cargo/bin:${PATH}"
1818+
ENV PATH="/usr/python/bin:/root/.local/bin:${PATH}"
18091819
# Useful for creating a cache id based on the underlying architecture, preventing the use of cached python packages from
18101820
# an incorrect architecture.
18111821
ARG TARGETARCH

scripts/docker/install_os_dependencies.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ fi
2828
AIRFLOW_PYTHON_VERSION=${AIRFLOW_PYTHON_VERSION:-3.10.18}
2929
PYTHON_LTO=${PYTHON_LTO:-true}
3030
GOLANG_MAJOR_MINOR_VERSION=${GOLANG_MAJOR_MINOR_VERSION:-1.24.4}
31+
RUSTUP_DEFAULT_TOOLCHAIN=${RUSTUP_DEFAULT_TOOLCHAIN:-stable}
3132
COSIGN_VERSION=${COSIGN_VERSION:-3.0.5}
3233

3334
if [[ "${1}" == "runtime" ]]; then
@@ -399,6 +400,11 @@ function install_golang() {
399400
rm -rf /usr/local/go && tar -C /usr/local -xzf go"${GOLANG_MAJOR_MINOR_VERSION}".linux.tar.gz
400401
}
401402

403+
function install_rustup() {
404+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
405+
sh -s -- -y --default-toolchain "${RUSTUP_DEFAULT_TOOLCHAIN}"
406+
}
407+
402408
function apt_clean() {
403409
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
404410
rm -rf /var/lib/apt/lists/* /var/log/*
@@ -414,6 +420,7 @@ else
414420
install_debian_dev_dependencies
415421
install_python
416422
install_additional_dev_dependencies
423+
install_rustup
417424
if [[ "${INSTALLATION_TYPE}" == "CI" ]]; then
418425
install_golang
419426
fi

0 commit comments

Comments
 (0)