Skip to content

Commit

Permalink
Switch "latest" image to point to newest supported Python version (ap…
Browse files Browse the repository at this point in the history
…ache#36003)

Following the lazy consensus to change the "latest" image
to point to "newest" Python version, we are changing the release
method to follow it.

https://lists.apache.org/thread/0oxnvct24xlqsj76z42w2ttw2d043oy3
  • Loading branch information
potiuk authored Dec 1, 2023
1 parent ab87cd0 commit 4117f1b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from airflow_breeze.global_constants import (
ALLOWED_DEBIAN_VERSIONS,
ALLOWED_PLATFORMS,
ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS,
APACHE_AIRFLOW_GITHUB_REPOSITORY,
CURRENT_PYTHON_MAJOR_MINOR_VERSIONS,
DEFAULT_PYTHON_MAJOR_MINOR_VERSION,
Expand Down Expand Up @@ -1368,19 +1369,18 @@ def release_prod_images(
f"{dockerhub_repo}:{airflow_version}-python{python}",
f"{dockerhub_repo}:latest-python{python}",
)
if python == DEFAULT_PYTHON_MAJOR_MINOR_VERSION:
# only tag latest "default" image when we build default python version
# otherwise if the non-default images complete before the default one, their jobs will fail
if slim_images:
alias_image(
f"{dockerhub_repo}:slim-{airflow_version}",
f"{dockerhub_repo}:slim-latest",
)
else:
alias_image(
f"{dockerhub_repo}:{airflow_version}",
f"{dockerhub_repo}:latest",
)
if python == ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS[-1]:
# only tag latest "default" image when we build the latest allowed python version
if slim_images:
alias_image(
f"{dockerhub_repo}:slim-{airflow_version}",
f"{dockerhub_repo}:slim-latest",
)
else:
alias_image(
f"{dockerhub_repo}:{airflow_version}",
f"{dockerhub_repo}:latest",
)


def is_package_in_dist(dist_files: list[str], package: str) -> bool:
Expand Down
8 changes: 8 additions & 0 deletions docs/docker-stack/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ Airflow 2.8
working with ``Debian Bookworm``. While all reference images of Airflow 2.8.0 are built on ``Debian Bookworm``,
it is still possible to build deprecated custom ``Debian Bullseye`` based image in 2.8.0 following the

* The "latest" image (i.e. default Airflow image when ``apache/airflow`` is used or
``apache/airflow:slim-latest``) uses now the newest supported Python version. Previously it was using
the "default" Python version which was Python 3.8 as of Airflow 2.7. With Airflow reference images
released for Airflow 2.8.0, the images are going to use Python 3.11 as this is the latest supported
version for Airflow 2.8 line. Users can use Python 3.8 by using ``apache/airflow:2.8.0-python3.8`` and
``apache/airflow:slim-2.8.0-python-3.8`` images respectively so while the change is potentially
breaking, it is very easy to switch to the previous behaviour.


Airflow 2.7
~~~~~~~~~~~
Expand Down

0 comments on commit 4117f1b

Please sign in to comment.