Skip to content

Commit 412bc8e

Browse files
ytoprakcpotiuk
authored andcommitted
Switch official Docker images to Debian Trixie
1 parent af0704e commit 412bc8e

46 files changed

Lines changed: 268 additions & 150 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci-image-build.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ on: # yamllint disable-line rule:truthy
6262
required: true
6363
type: string
6464
debian-version:
65-
description: "Base Debian distribution to use for the build (bookworm)"
65+
description: "Base Debian distribution to use for the build (trixie)"
6666
type: string
67-
default: "bookworm"
67+
default: "trixie"
6868
install-mysql-client-type:
6969
description: "MySQL client type to use during build (mariadb/mysql)"
7070
type: string

‎.github/workflows/prod-image-build.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ on: # yamllint disable-line rule:truthy
6161
default: "false"
6262
type: string
6363
debian-version:
64-
description: "Base Debian distribution to use for the build (bookworm)"
64+
description: "Base Debian distribution to use for the build (trixie)"
6565
type: string
66-
default: "bookworm"
66+
default: "trixie"
6767
install-mysql-client-type:
6868
description: "MySQL client type to use during build (mariadb/mysql)"
6969
type: string

‎.github/workflows/push-image-cache.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ on: # yamllint disable-line rule:truthy
3737
required: true
3838
type: string
3939
debian-version:
40-
description: "Base Debian distribution to use for the build (bookworm)"
40+
description: "Base Debian distribution to use for the build (trixie)"
4141
type: string
42-
default: "bookworm"
42+
default: "trixie"
4343
install-mysql-client-type:
4444
description: "MySQL client type to use during build (mariadb/mysql)"
4545
type: string

‎Dockerfile‎

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ARG AIRFLOW_USER_HOME_DIR=/home/airflow
5050
# latest released version here
5151
ARG AIRFLOW_VERSION="3.3.1"
5252

53-
ARG BASE_IMAGE="debian:bookworm-slim"
53+
ARG BASE_IMAGE="debian:trixie-slim"
5454
ARG AIRFLOW_PYTHON_VERSION="3.13.15"
5555

5656
# PYTHON_LTO: Controls whether Python is built with Link-Time Optimization (LTO).
@@ -155,7 +155,6 @@ git \
155155
graphviz \
156156
graphviz-dev \
157157
krb5-user \
158-
lcov \
159158
ldap-utils \
160159
libbluetooth-dev \
161160
libbz2-dev \
@@ -185,7 +184,6 @@ libzstd-dev \
185184
locales \
186185
lsb-release \
187186
lzma \
188-
lzma-dev \
189187
openssh-client \
190188
openssl \
191189
pkg-config \
@@ -206,6 +204,15 @@ zlib1g-dev \
206204
fi
207205
}
208206

207+
function get_post_python_dev_apt_deps() {
208+
if [[ "${POST_PYTHON_DEV_APT_DEPS=}" == "" ]]; then
209+
POST_PYTHON_DEV_APT_DEPS="\
210+
lcov \
211+
"
212+
export POST_PYTHON_DEV_APT_DEPS
213+
fi
214+
}
215+
209216
function get_runtime_apt_deps() {
210217
local debian_version
211218
local debian_version_apt_deps
@@ -217,8 +224,8 @@ function get_runtime_apt_deps() {
217224
echo
218225
debian_version_apt_deps="\
219226
libffi8 \
220-
libldap-2.5-0 \
221-
libssl3 \
227+
libldap2 \
228+
libssl3t64 \
222229
netcat-openbsd\
223230
"
224231
echo
@@ -304,6 +311,13 @@ function install_additional_dev_dependencies() {
304311
fi
305312
}
306313

314+
function install_post_python_dev_dependencies() {
315+
if [[ "${POST_PYTHON_DEV_APT_DEPS=}" != "" ]]; then
316+
# shellcheck disable=SC2086
317+
apt-get install -y --no-install-recommends ${POST_PYTHON_DEV_APT_DEPS}
318+
fi
319+
}
320+
307321
function link_python() {
308322
# link python binaries to /usr/local/bin and /usr/python/bin with and without 3 suffix
309323
# Links in /usr/local/bin are needed for tools that expect python to be there
@@ -374,20 +388,27 @@ function install_cosign() {
374388
}
375389

376390
function install_python() {
377-
# If system python (3.11 in bookworm) is installed (via automatic installation of some dependencies for example), we need
378-
# to fail and make sure that it is not there, because there can be strange interactions if we install
379-
# newer version and system libraries are installed, because
380-
# when you create a virtualenv part of the shared libraries of Python can be taken from the system
381-
# Installation leading to weird errors when you want to install some modules - for example when you install ssl:
382-
# /usr/python/lib/python3.11/lib-dynload/_ssl.cpython-311-aarch64-linux-gnu.so: undefined symbol: _PyModule_Add
383-
if dpkg -l | grep '^ii' | grep '^ii libpython' >/dev/null; then
391+
# Airflow images build and use their own Python under /usr/python. If Debian's system Python
392+
# is installed before that custom Python is built, native extensions can accidentally link
393+
# against a mix of system Python libraries and /usr/python libraries. That can produce hard to
394+
# diagnose import/linker errors later.
395+
local installed_libpython_packages
396+
installed_libpython_packages="$(
397+
dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' 'libpython*' 2>/dev/null \
398+
| awk '$1 ~ /^ii/ {print $2}' \
399+
| sort || true
400+
)"
401+
if [[ "${installed_libpython_packages}" != "" ]]; then
384402
echo
385403
echo "ERROR! System python is installed by one of the previous steps"
386404
echo
387-
echo "Please make sure that no python packages are installed by default. Displaying the reason why libpython3.11 is installed:"
405+
echo "Please make sure that no python packages are installed by default. Displaying why these packages are installed:"
406+
echo "${installed_libpython_packages}"
388407
echo
389408
apt-get install -yqq aptitude >/dev/null
390-
aptitude why libpython3.11
409+
while read -r libpython_package; do
410+
aptitude why "${libpython_package}" || true
411+
done <<< "${installed_libpython_packages}"
391412
echo
392413
exit 1
393414
else
@@ -587,8 +608,10 @@ if [[ "${INSTALLATION_TYPE}" == "RUNTIME" ]]; then
587608
apt_clean
588609
else
589610
get_dev_apt_deps
611+
get_post_python_dev_apt_deps
590612
install_debian_dev_dependencies
591613
install_python
614+
install_post_python_dev_dependencies
592615
install_additional_dev_dependencies
593616
install_rustup
594617
if [[ "${INSTALLATION_TYPE}" == "CI" ]]; then
@@ -611,7 +634,7 @@ set -euo pipefail
611634
common::get_colors
612635
declare -a packages
613636

614-
readonly MARIADB_LTS_VERSION="10.11"
637+
readonly MARIADB_LTS_VERSION="11.8"
615638

616639
: "${INSTALL_MYSQL_CLIENT:?Should be true or false}"
617640
: "${INSTALL_MYSQL_CLIENT_TYPE:-mariadb}"
@@ -675,9 +698,9 @@ install_mariadb_client() {
675698
# `libmariadb-dev` -> `libmariadb-dev-compat`
676699
# `mariadb-client-core` -> `mariadb-client` or `mariadb-client-compat` (11+)
677700
if [[ "${1}" == "dev" ]]; then
678-
packages=("libmariadb-dev-compat" "mariadb-client")
701+
packages=("libmariadb-dev-compat" "mariadb-client" "mariadb-client-compat")
679702
elif [[ "${1}" == "prod" ]]; then
680-
packages=("libmariadb3-compat" "mariadb-client")
703+
packages=("libmariadb3-compat" "mariadb-client" "mariadb-client-compat")
681704
else
682705
echo
683706
echo "${COLOR_RED}Specify either prod or dev${COLOR_RESET}"
@@ -730,7 +753,7 @@ function install_mssql_client() {
730753
fi
731754
packages=("msodbcsql18")
732755

733-
common::import_trusted_gpg "EB3E94ADBE1229CF" "microsoft"
756+
common::import_trusted_gpg "EE4D7792F748182B" "microsoft"
734757

735758
echo
736759
echo "${COLOR_BLUE}Installing mssql client${COLOR_RESET}"

‎Dockerfile.ci‎

Lines changed: 60 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#
3333
# Related: https://github.com/apache/airflow/issues/58337
3434
ARG PYTHON_LTO="true"
35-
ARG BASE_IMAGE="debian:bookworm-slim"
35+
ARG BASE_IMAGE="debian:trixie-slim"
3636

3737
##############################################################################################
3838
# This is the script image where we keep all inlined bash scripts needed in other segments
@@ -95,7 +95,6 @@ git \
9595
graphviz \
9696
graphviz-dev \
9797
krb5-user \
98-
lcov \
9998
ldap-utils \
10099
libbluetooth-dev \
101100
libbz2-dev \
@@ -125,7 +124,6 @@ libzstd-dev \
125124
locales \
126125
lsb-release \
127126
lzma \
128-
lzma-dev \
129127
openssh-client \
130128
openssl \
131129
pkg-config \
@@ -146,6 +144,15 @@ zlib1g-dev \
146144
fi
147145
}
148146

147+
function get_post_python_dev_apt_deps() {
148+
if [[ "${POST_PYTHON_DEV_APT_DEPS=}" == "" ]]; then
149+
POST_PYTHON_DEV_APT_DEPS="\
150+
lcov \
151+
"
152+
export POST_PYTHON_DEV_APT_DEPS
153+
fi
154+
}
155+
149156
function get_runtime_apt_deps() {
150157
local debian_version
151158
local debian_version_apt_deps
@@ -157,8 +164,8 @@ function get_runtime_apt_deps() {
157164
echo
158165
debian_version_apt_deps="\
159166
libffi8 \
160-
libldap-2.5-0 \
161-
libssl3 \
167+
libldap2 \
168+
libssl3t64 \
162169
netcat-openbsd\
163170
"
164171
echo
@@ -244,6 +251,13 @@ function install_additional_dev_dependencies() {
244251
fi
245252
}
246253

254+
function install_post_python_dev_dependencies() {
255+
if [[ "${POST_PYTHON_DEV_APT_DEPS=}" != "" ]]; then
256+
# shellcheck disable=SC2086
257+
apt-get install -y --no-install-recommends ${POST_PYTHON_DEV_APT_DEPS}
258+
fi
259+
}
260+
247261
function link_python() {
248262
# link python binaries to /usr/local/bin and /usr/python/bin with and without 3 suffix
249263
# Links in /usr/local/bin are needed for tools that expect python to be there
@@ -314,20 +328,27 @@ function install_cosign() {
314328
}
315329

316330
function install_python() {
317-
# If system python (3.11 in bookworm) is installed (via automatic installation of some dependencies for example), we need
318-
# to fail and make sure that it is not there, because there can be strange interactions if we install
319-
# newer version and system libraries are installed, because
320-
# when you create a virtualenv part of the shared libraries of Python can be taken from the system
321-
# Installation leading to weird errors when you want to install some modules - for example when you install ssl:
322-
# /usr/python/lib/python3.11/lib-dynload/_ssl.cpython-311-aarch64-linux-gnu.so: undefined symbol: _PyModule_Add
323-
if dpkg -l | grep '^ii' | grep '^ii libpython' >/dev/null; then
331+
# Airflow images build and use their own Python under /usr/python. If Debian's system Python
332+
# is installed before that custom Python is built, native extensions can accidentally link
333+
# against a mix of system Python libraries and /usr/python libraries. That can produce hard to
334+
# diagnose import/linker errors later.
335+
local installed_libpython_packages
336+
installed_libpython_packages="$(
337+
dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' 'libpython*' 2>/dev/null \
338+
| awk '$1 ~ /^ii/ {print $2}' \
339+
| sort || true
340+
)"
341+
if [[ "${installed_libpython_packages}" != "" ]]; then
324342
echo
325343
echo "ERROR! System python is installed by one of the previous steps"
326344
echo
327-
echo "Please make sure that no python packages are installed by default. Displaying the reason why libpython3.11 is installed:"
345+
echo "Please make sure that no python packages are installed by default. Displaying why these packages are installed:"
346+
echo "${installed_libpython_packages}"
328347
echo
329348
apt-get install -yqq aptitude >/dev/null
330-
aptitude why libpython3.11
349+
while read -r libpython_package; do
350+
aptitude why "${libpython_package}" || true
351+
done <<< "${installed_libpython_packages}"
331352
echo
332353
exit 1
333354
else
@@ -527,8 +548,10 @@ if [[ "${INSTALLATION_TYPE}" == "RUNTIME" ]]; then
527548
apt_clean
528549
else
529550
get_dev_apt_deps
551+
get_post_python_dev_apt_deps
530552
install_debian_dev_dependencies
531553
install_python
554+
install_post_python_dev_dependencies
532555
install_additional_dev_dependencies
533556
install_rustup
534557
if [[ "${INSTALLATION_TYPE}" == "CI" ]]; then
@@ -551,7 +574,7 @@ set -euo pipefail
551574
common::get_colors
552575
declare -a packages
553576

554-
readonly MARIADB_LTS_VERSION="10.11"
577+
readonly MARIADB_LTS_VERSION="11.8"
555578

556579
: "${INSTALL_MYSQL_CLIENT:?Should be true or false}"
557580
: "${INSTALL_MYSQL_CLIENT_TYPE:-mariadb}"
@@ -615,9 +638,9 @@ install_mariadb_client() {
615638
# `libmariadb-dev` -> `libmariadb-dev-compat`
616639
# `mariadb-client-core` -> `mariadb-client` or `mariadb-client-compat` (11+)
617640
if [[ "${1}" == "dev" ]]; then
618-
packages=("libmariadb-dev-compat" "mariadb-client")
641+
packages=("libmariadb-dev-compat" "mariadb-client" "mariadb-client-compat")
619642
elif [[ "${1}" == "prod" ]]; then
620-
packages=("libmariadb3-compat" "mariadb-client")
643+
packages=("libmariadb3-compat" "mariadb-client" "mariadb-client-compat")
621644
else
622645
echo
623646
echo "${COLOR_RED}Specify either prod or dev${COLOR_RESET}"
@@ -670,7 +693,7 @@ function install_mssql_client() {
670693
fi
671694
packages=("msodbcsql18")
672695

673-
common::import_trusted_gpg "EB3E94ADBE1229CF" "microsoft"
696+
common::import_trusted_gpg "EE4D7792F748182B" "microsoft"
674697

675698
echo
676699
echo "${COLOR_BLUE}Installing mssql client${COLOR_RESET}"
@@ -1334,13 +1357,26 @@ SSH_CONFIG
13341357

13351358
sudo service ssh restart >/dev/null 2>&1
13361359

1337-
# Sometimes the server is not quick enough to load the keys!
1338-
while [[ $(ssh-keyscan -H localhost 2>/dev/null | wc -l) != "3" ]] ; do
1339-
echo "Not all keys yet loaded by the server"
1360+
# Sometimes the server is not quick enough to load the keys.
1361+
# Different OpenSSH versions can expose a different number of host key types,
1362+
# so wait for any host key instead of an exact count.
1363+
ssh_keyscan_output=""
1364+
for _ in {1..200}; do
1365+
ssh_keyscan_output="$(ssh-keyscan -H localhost 2>/dev/null || true)"
1366+
if [[ "${ssh_keyscan_output}" != "" ]]; then
1367+
break
1368+
fi
1369+
echo "SSH host keys not loaded by the server yet"
13401370
sleep 0.05
13411371
done
13421372

1343-
ssh-keyscan -H localhost > "${breeze_ssh_dir}/known_hosts" 2>/dev/null
1373+
if [[ "${ssh_keyscan_output}" == "" ]]; then
1374+
echo "SSH host keys were not available after waiting for ssh service to start"
1375+
sudo service ssh status || true
1376+
exit 1
1377+
fi
1378+
1379+
echo "${ssh_keyscan_output}" > "${breeze_ssh_dir}/known_hosts"
13441380
fi
13451381

13461382
if [[ ${INTEGRATION_LOCALSTACK:-"false"} == "true" ]]; then
@@ -1764,8 +1800,8 @@ ARG DEV_APT_COMMAND=""
17641800
ARG ADDITIONAL_DEV_APT_COMMAND=""
17651801
ARG ADDITIONAL_DEV_ENV_VARS=""
17661802
ARG ADDITIONAL_DEV_APT_DEPS="bash-completion dumb-init git gdb graphviz krb5-user \
1767-
less libenchant-2-2 libgcc-11-dev libgeos-dev libpq-dev net-tools netcat-openbsd \
1768-
openssh-server postgresql-client software-properties-common rsync tmux unzip vim xxd"
1803+
less libenchant-2-2 libgeos-dev libpq-dev net-tools netcat-openbsd \
1804+
openssh-server postgresql-client rsync tmux unzip vim xxd"
17691805

17701806
ARG ADDITIONAL_DEV_APT_ENV=""
17711807

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ The work to add Windows support is tracked via [#10388](https://github.com/apach
124124
it is not a high priority. You should only use Linux-based distros as "Production" execution environment
125125
as this is the only environment that is supported. The only distro that is used in our CI tests and that
126126
is used in the [Community managed DockerHub image](https://hub.docker.com/p/apache/airflow) is
127-
`Debian Bookworm`.
127+
`Debian Trixie`.
128128

129129
<!-- END Requirements, please keep comment here to allow auto update of PyPI readme.md -->
130130
<!-- START Getting started, please keep comment here to allow auto update of PyPI readme.md -->

‎airflow-core/docs/howto/docker-compose/index.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Older versions of ``docker-compose`` do not support all the features required by
4848

4949
.. code-block:: bash
5050
51-
docker run --rm "debian:bookworm-slim" bash -c 'numfmt --to iec $(echo $(($(getconf _PHYS_PAGES) * $(getconf PAGE_SIZE))))'
51+
docker run --rm "debian:trixie-slim" bash -c 'numfmt --to iec $(echo $(($(getconf _PHYS_PAGES) * $(getconf PAGE_SIZE))))'
5252
5353
.. warning::
5454

‎airflow-core/docs/installation/dependencies.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ System dependencies
7575
You need certain system level requirements in order to install Airflow.
7676
Those are requirements that are known to be needed for Linux Debian distributions:
7777

78-
Debian Bookworm (12)
78+
Debian Trixie (13)
7979
====================
8080

81-
Debian Bookworm is our platform of choice for development and testing. It is the most up-to-date
81+
Debian Trixie is our platform of choice for development and testing. It is the most up-to-date
8282
Debian distribution and it is the one we use for our CI/CD system. It is also the one we recommend
8383
for development and testing as well as production use.
8484

0 commit comments

Comments
 (0)