You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2023/09/07 17:52:23 UTC

[airflow] branch v2-7-test updated: Only tag :latest image when default python version is used (#34182)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v2-7-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v2-7-test by this push:
     new 1fd5491636 Only tag :latest image when default python version is used (#34182)
1fd5491636 is described below

commit 1fd5491636ea03af68fe212a5a9c022795f49c54
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Thu Sep 7 19:50:01 2023 +0200

    Only tag :latest image when default python version is used (#34182)
    
    We should only tag :latest image when default image is used because
    this step always tags `apache/airflow:X.Y.Z` (defaulti Python) to become
    the `apache/airflow:latest`. This step was previously run for all Python
    versions which could have two effects:
    
    * if non-default image completed before the default such tagging
      would fail as the `apache/airflow:X.Y.Z` was not ready yet to
      be used as target of `apache/airflow:latesti` tag
    
    * if non-default image completed later, it would be no-op because
      the `apache/airflow:latest` already pointed to `apache/airflow:X.Y.Z`
    
    (cherry picked from commit 51d8b1079b05575c1cf0ca35fcf97ec3c9e1a75b)
---
 .../commands/release_management_commands.py        | 23 ++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
index bd3303215f..a28db65d9f 100644
--- a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
@@ -1032,16 +1032,19 @@ def release_prod_images(
                     f"{dockerhub_repo}:{airflow_version}-python{python}",
                     f"{dockerhub_repo}:latest-python{python}",
                 )
-        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 == 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",
+                )
 
 
 def is_package_in_dist(dist_files: list[str], package: str) -> bool: