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 2022/04/10 15:44:28 UTC

[airflow] branch remove-breeze-legacy-build-image-from-ci created (now e740c1cda3)

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

potiuk pushed a change to branch remove-breeze-legacy-build-image-from-ci
in repository https://gitbox.apache.org/repos/asf/airflow.git


      at e740c1cda3 Push CI image using new Python Breeze

This branch includes the following new commits:

     new e740c1cda3 Push CI image using new Python Breeze

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[airflow] 01/01: Push CI image using new Python Breeze

Posted by po...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch remove-breeze-legacy-build-image-from-ci
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit e740c1cda353f5cac1bd7b23e984e3417a8f844a
Author: Jarek Potiuk <ja...@polidea.com>
AuthorDate: Sun Apr 10 17:41:43 2022 +0200

    Push CI image using new Python Breeze
    
    Fixes: #22821
---
 .github/workflows/build-images.yml                 | 19 ++++++-------
 .github/workflows/ci.yml                           | 20 ++++++-------
 dev/breeze/src/airflow_breeze/breeze.py            | 19 +++++++++++--
 .../build_image/ci/build_ci_image.py               | 11 ++++++--
 .../build_image/ci/build_ci_params.py              |  3 +-
 .../build_image/prod/build_prod_image.py           | 11 ++++++--
 .../build_image/prod/build_prod_params.py          |  7 +++++
 .../src/airflow_breeze/shell/shell_params.py       |  4 +--
 .../airflow_breeze/utils/docker_command_utils.py   | 26 ++++++++++++++---
 images/breeze/output-build-image.svg               |  5 ++--
 images/breeze/output-build-prod-image.svg          |  5 ++--
 scripts/ci/images/ci_push_ci_images.sh             | 33 ----------------------
 12 files changed, 90 insertions(+), 73 deletions(-)

diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml
index a6ff039ebc..33ddef1070 100644
--- a/.github/workflows/build-images.yml
+++ b/.github/workflows/build-images.yml
@@ -224,17 +224,14 @@ jobs:
       - run: python -m pip install --editable ./dev/breeze/
       - name: "Free space"
         run: airflow-freespace
-      - name: "Build CI image ${{ matrix.python-version }}:${{ env.IMAGE_TAG_FOR_THE_BUILD }}"
-        run: breeze build-image
-        env:
-          GITHUB_REGISTRY_PULL_IMAGE_TAG: "latest"
-          GITHUB_REGISTRY_PUSH_IMAGE_TAG: ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
-          UPGRADE_TO_NEWER_DEPENDENCIES: ${{ needs.build-info.outputs.upgradeToNewerDependencies }}
-          DOCKER_CACHE: ${{ needs.build-info.outputs.cacheDirective }}
-      - name: "Push CI image ${{ matrix.python-version }}:${{ env.IMAGE_TAG_FOR_THE_BUILD }}"
-        run: ./scripts/ci/images/ci_push_ci_images.sh
-        env:
-          GITHUB_REGISTRY_PUSH_IMAGE_TAG: ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
+      - name: "Build/Push CI image ${{ matrix.python-version }}:${{ env.IMAGE_TAG_FOR_THE_BUILD }}"
+        run: >
+          breeze build-image --push-image
+            --upgrade-to-newer-dependencies "${{ needs.build-info.outputs.upgradeToNewerDependencies }}"
+            --docker-cache "${{ needs.build-info.outputs.cacheDirective }}"
+            --github-registry-pull-image-tag "latest"
+            --github-registry-push-image-tag "${{ env.IMAGE_TAG_FOR_THE_BUILD }}"
+            --push-image
       - name: >
           Push empty CI images to finish waiting jobs:
           ${{ matrix.python-version }}:${{ env.IMAGE_TAG_FOR_THE_BUILD }}"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 308ca20946..b33fb7def3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -328,19 +328,15 @@ jobs:
       - name: "Free space"
         run: airflow-freespace
         if: needs.build-info.outputs.inWorkflowBuild == 'true'
-      - name: "Build CI image ${{ matrix.python-version }}:${{ env.IMAGE_TAG_FOR_THE_BUILD }}"
-        run: breeze build-image
-        if: needs.build-info.outputs.inWorkflowBuild == 'true'
-        env:
-          GITHUB_REGISTRY_PULL_IMAGE_TAG: "latest"
-          GITHUB_REGISTRY_PUSH_IMAGE_TAG: ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
-          UPGRADE_TO_NEWER_DEPENDENCIES: ${{ needs.build-info.outputs.upgradeToNewerDependencies }}
-          DOCKER_CACHE: ${{ needs.build-info.outputs.cacheDirective }}
-      - name: "Push CI image ${{ matrix.python-version }}:${{ env.IMAGE_TAG_FOR_THE_BUILD }}"
-        run: ./scripts/ci/images/ci_push_ci_images.sh
+      - name: "Build/Push CI image ${{ matrix.python-version }}:${{ env.IMAGE_TAG_FOR_THE_BUILD }}"
+        run: >
+          breeze build-image --push-image
+            --upgrade-to-newer-dependencies "${{ needs.build-info.outputs.upgradeToNewerDependencies }}"
+            --docker-cache "${{ needs.build-info.outputs.cacheDirective }}"
+            --github-registry-pull-image-tag "latest"
+            --github-registry-push-image-tag "${{ env.IMAGE_TAG_FOR_THE_BUILD }}"
+            --push-image
         if: needs.build-info.outputs.inWorkflowBuild == 'true'
-        env:
-          GITHUB_REGISTRY_PUSH_IMAGE_TAG: ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
       - name: "Candidates for pip resolver backtrack triggers: ${{ matrix.python-version }}"
         if: failure() || cancelled()
         run: airflow-find-newer-dependencies --max-age 1 --python "${{ matrix.python-version }}"
diff --git a/dev/breeze/src/airflow_breeze/breeze.py b/dev/breeze/src/airflow_breeze/breeze.py
index 499626b20c..37a6e8ad58 100755
--- a/dev/breeze/src/airflow_breeze/breeze.py
+++ b/dev/breeze/src/airflow_breeze/breeze.py
@@ -145,10 +145,11 @@ try:
                 ],
             },
             {
-                "name": "Preparing cache (for maintainers)",
+                "name": "Preparing cache and push (for maintainers and CI)",
                 "options": [
                     "--platform",
                     "--prepare-buildx-cache",
+                    "--push-image",
                 ],
             },
         ],
@@ -199,10 +200,11 @@ try:
                 ],
             },
             {
-                "name": "Preparing cache (for maintainers)",
+                "name": "Preparing cache and push (for maintainers and CI)",
                 "options": [
                     "--platform",
                     "--prepare-buildx-cache",
+                    "--push-image",
                 ],
             },
         ],
@@ -570,6 +572,13 @@ option_prepare_buildx_cache = click.option(
     envvar='PREPARE_BUILDX_CACHE',
 )
 
+option_push_image = click.option(
+    '--push-image',
+    help='Push image after building it.',
+    is_flag=True,
+    envvar='PUSH_IMAGE',
+)
+
 option_install_providers_from_sources = click.option(
     '--install-providers-from-sources',
     help="Install providers from sources when installing.",
@@ -748,6 +757,7 @@ def start_airflow(
 @option_docker_cache
 @option_image_tag
 @option_prepare_buildx_cache
+@option_push_image
 @option_install_providers_from_sources
 @option_additional_extras
 @option_additional_dev_apt_deps
@@ -786,6 +796,7 @@ def build_ci_image(
     platform: Optional[str],
     debian_version: Optional[str],
     prepare_buildx_cache: bool,
+    push_image: bool,
     answer: Optional[str],
     upgrade_to_newer_dependencies: str = "false",
 ):
@@ -819,6 +830,7 @@ def build_ci_image(
         platform=platform,
         debian_version=debian_version,
         prepare_buildx_cache=prepare_buildx_cache,
+        build_image=build_image,
         upgrade_to_newer_dependencies=upgrade_to_newer_dependencies,
     )
 
@@ -834,6 +846,7 @@ def build_ci_image(
 @option_docker_cache
 @option_image_tag
 @option_prepare_buildx_cache
+@option_push_image
 @click.option(
     '--installation-method',
     help="Install Airflow from: sources or PyPI.",
@@ -908,6 +921,7 @@ def build_prod_image(
     platform: Optional[str],
     debian_version: Optional[str],
     prepare_buildx_cache: bool,
+    push_image: bool,
     install_providers_from_sources: bool,
     extras: Optional[str],
     installation_method: Optional[str],
@@ -952,6 +966,7 @@ def build_prod_image(
         debian_version=debian_version,
         upgrade_to_newer_dependencies=upgrade_to_newer_dependencies,
         prepare_buildx_cache=prepare_buildx_cache,
+        push_image=push_image,
         install_providers_from_sources=install_providers_from_sources,
         extras=extras,
         installation_method=installation_method,
diff --git a/dev/breeze/src/airflow_breeze/build_image/ci/build_ci_image.py b/dev/breeze/src/airflow_breeze/build_image/ci/build_ci_image.py
index e7805170c3..9cc3bf80ab 100644
--- a/dev/breeze/src/airflow_breeze/build_image/ci/build_ci_image.py
+++ b/dev/breeze/src/airflow_breeze/build_image/ci/build_ci_image.py
@@ -20,7 +20,10 @@ from typing import Dict
 from airflow_breeze.build_image.ci.build_ci_params import BuildCiParams
 from airflow_breeze.utils.cache import synchronize_parameters_with_cache, touch_cache_file
 from airflow_breeze.utils.console import console
-from airflow_breeze.utils.docker_command_utils import construct_build_docker_command
+from airflow_breeze.utils.docker_command_utils import (
+    construct_docker_build_command,
+    construct_docker_push_command,
+)
 from airflow_breeze.utils.md5_build_check import calculate_md5_checksum_for_files
 from airflow_breeze.utils.path_utils import AIRFLOW_SOURCES_ROOT, BUILD_CACHE_DIR
 from airflow_breeze.utils.registry import login_to_docker_registry
@@ -102,7 +105,7 @@ def build_image(verbose: bool, dry_run: bool, **kwargs) -> None:
         text=True,
         check=False,
     )
-    cmd = construct_build_docker_command(
+    cmd = construct_docker_build_command(
         image_params=ci_image_params,
         verbose=verbose,
         required_args=REQUIRED_CI_IMAGE_ARGS,
@@ -120,3 +123,7 @@ def build_image(verbose: bool, dry_run: bool, **kwargs) -> None:
         calculate_md5_checksum_for_files(ci_image_params.md5sum_cache_dir, update=True)
     else:
         console.print("[blue]Not updating build cache because we are in `dry_run` mode.[/]")
+    if ci_image_params.push_image:
+        login_to_docker_registry(ci_image_params)
+        cmd = construct_docker_push_command(ci_image_params)
+        run_command(cmd, verbose=verbose, dry_run=dry_run, cwd=AIRFLOW_SOURCES_ROOT, text=True)
diff --git a/dev/breeze/src/airflow_breeze/build_image/ci/build_ci_params.py b/dev/breeze/src/airflow_breeze/build_image/ci/build_ci_params.py
index ac7901e4aa..96fa2574b4 100644
--- a/dev/breeze/src/airflow_breeze/build_image/ci/build_ci_params.py
+++ b/dev/breeze/src/airflow_breeze/build_image/ci/build_ci_params.py
@@ -63,6 +63,7 @@ class BuildCiParams:
     platform: str = f"linux/{os.uname().machine}"
     debian_version: str = "bullseye"
     prepare_buildx_cache: bool = False
+    push_image: bool = False
     skip_rebuild_check: bool = False
 
     @property
@@ -77,7 +78,7 @@ class BuildCiParams:
         return image
 
     @property
-    def airflow_ci_image_name_with_tag(self):
+    def airflow_image_name_with_tag(self):
         """Construct CI image link"""
         image = f'{self.airflow_base_image_name}/{self.airflow_branch}/ci/python{self.python}'
         return image if not self.image_tag else image + f":{self.image_tag}"
diff --git a/dev/breeze/src/airflow_breeze/build_image/prod/build_prod_image.py b/dev/breeze/src/airflow_breeze/build_image/prod/build_prod_image.py
index 2974d00d46..63ff780d20 100644
--- a/dev/breeze/src/airflow_breeze/build_image/prod/build_prod_image.py
+++ b/dev/breeze/src/airflow_breeze/build_image/prod/build_prod_image.py
@@ -22,7 +22,10 @@ from typing import Dict
 from airflow_breeze.build_image.prod.build_prod_params import BuildProdParams
 from airflow_breeze.utils.cache import synchronize_parameters_with_cache
 from airflow_breeze.utils.console import console
-from airflow_breeze.utils.docker_command_utils import construct_build_docker_command
+from airflow_breeze.utils.docker_command_utils import (
+    construct_docker_build_command,
+    construct_docker_push_command,
+)
 from airflow_breeze.utils.path_utils import AIRFLOW_SOURCES_ROOT, DOCKER_CONTEXT_DIR
 from airflow_breeze.utils.registry import login_to_docker_registry
 from airflow_breeze.utils.run_utils import filter_out_none, fix_group_permissions, run_command
@@ -163,7 +166,7 @@ def build_production_image(verbose: bool, dry_run: bool, **kwargs):
         check=False,
     )
     console.print(f"\n[blue]Building PROD Image for Python {prod_image_params.python}\n")
-    cmd = construct_build_docker_command(
+    cmd = construct_docker_build_command(
         image_params=prod_image_params,
         verbose=verbose,
         required_args=REQUIRED_PROD_IMAGE_ARGS,
@@ -171,3 +174,7 @@ def build_production_image(verbose: bool, dry_run: bool, **kwargs):
         production_image=True,
     )
     run_command(cmd, verbose=verbose, dry_run=dry_run, cwd=AIRFLOW_SOURCES_ROOT, text=True)
+    if prod_image_params.push_image:
+        login_to_docker_registry(prod_image_params)
+        cmd = construct_docker_push_command(prod_image_params)
+        run_command(cmd, verbose=verbose, dry_run=dry_run, cwd=AIRFLOW_SOURCES_ROOT, text=True)
diff --git a/dev/breeze/src/airflow_breeze/build_image/prod/build_prod_params.py b/dev/breeze/src/airflow_breeze/build_image/prod/build_prod_params.py
index 74667be5f0..80d1385ae2 100644
--- a/dev/breeze/src/airflow_breeze/build_image/prod/build_prod_params.py
+++ b/dev/breeze/src/airflow_breeze/build_image/prod/build_prod_params.py
@@ -50,6 +50,7 @@ class BuildProdParams:
     install_providers_from_sources: bool = True
     cleanup_docker_context_files: bool = False
     prepare_buildx_cache: bool = False
+    push_image: bool = False
     disable_pypi: bool = False
     upgrade_to_newer_dependencies: str = "false"
     airflow_version: str = get_airflow_version()
@@ -288,3 +289,9 @@ class BuildProdParams:
     @property
     def docker_context_files(self) -> str:
         return "docker-context-files"
+
+    @property
+    def airflow_image_name_with_tag(self):
+        """Construct PROD image link"""
+        image = f'{self.airflow_base_image_name}/{self.airflow_branch}/prod/python{self.python}'
+        return image if not self.image_tag else image + f":{self.image_tag}"
diff --git a/dev/breeze/src/airflow_breeze/shell/shell_params.py b/dev/breeze/src/airflow_breeze/shell/shell_params.py
index 4975fa6b34..ae25359df4 100644
--- a/dev/breeze/src/airflow_breeze/shell/shell_params.py
+++ b/dev/breeze/src/airflow_breeze/shell/shell_params.py
@@ -103,7 +103,7 @@ class ShellParams:
         return image
 
     @property
-    def airflow_ci_image_name_with_tag(self) -> str:
+    def airflow_image_name_with_tag(self) -> str:
         image = self.airflow_image_name
         return image if not self.tag else image + f":{self.tag}"
 
@@ -155,7 +155,7 @@ class ShellParams:
     def print_badge_info(self):
         console.print(f'Use {self.the_image_type} image')
         console.print(f'Branch Name: {self.airflow_branch}')
-        console.print(f'Docker Image: {self.airflow_ci_image_name_with_tag}')
+        console.print(f'Docker Image: {self.airflow_image_name_with_tag}')
         console.print(f'Airflow source version:{self.airflow_version}')
         console.print(f'Python Version: {self.python}')
         console.print(f'Backend: {self.backend} {self.backend_version}')
diff --git a/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py b/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py
index 70e5ebb302..77dffb4deb 100644
--- a/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py
+++ b/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py
@@ -236,7 +236,7 @@ def check_docker_compose_version(verbose: bool):
         )
 
 
-def construct_arguments_for_build_docker_command(
+def construct_arguments_for_docker_build_command(
     image_params: Union[BuildCiParams, BuildProdParams], required_args: List[str], optional_args: List[str]
 ) -> List[str]:
     """
@@ -259,7 +259,7 @@ def construct_arguments_for_build_docker_command(
     return args_command
 
 
-def construct_build_docker_command(
+def construct_docker_build_command(
     image_params: Union[BuildProdParams, BuildCiParams],
     verbose: bool,
     required_args: List[str],
@@ -275,7 +275,7 @@ def construct_build_docker_command(
     :param production_image: whether this is production image or ci image
     :return: Command to run as list of string
     """
-    arguments = construct_arguments_for_build_docker_command(
+    arguments = construct_arguments_for_docker_build_command(
         image_params, required_args=required_args, optional_args=optional_args
     )
     build_command = prepare_build_command(
@@ -294,7 +294,25 @@ def construct_build_docker_command(
     return final_command
 
 
+def construct_docker_push_command(
+    image_params: Union[BuildProdParams, BuildCiParams],
+) -> List[str]:
+    """
+    Constructs docker compose command based on the parameters passed.
+    :param image_params: parameters of the image
+    :return: Command to run as list of string
+    """
+    return ["docker", "push", image_params.airflow_image_name_with_tag]
+
+
 def set_value_to_default_if_not_set(env: Dict[str, str], name: str, default: str):
+    """
+    Set value of name parameter to default (indexed by name) if not set.
+    :param env: dictionary where to set the parameter
+    :param name: name of parameter
+    :param default: default value
+    :return:
+    """
     if env.get(name) is None:
         env[name] = os.environ.get(name, default)
 
@@ -346,7 +364,7 @@ def update_expected_environment_variables(env: Dict[str, str]) -> None:
 
 VARIABLES_TO_ENTER_DOCKER_COMPOSE = {
     "AIRFLOW_CI_IMAGE": "airflow_image_name",
-    "AIRFLOW_CI_IMAGE_WITH_TAG": "airflow_ci_image_name_with_tag",
+    "AIRFLOW_CI_IMAGE_WITH_TAG": "airflow_image_name_with_tag",
     "AIRFLOW_IMAGE_KUBERNETES": "airflow_image_kubernetes",
     "AIRFLOW_PROD_IMAGE": "airflow_image_name",
     "AIRFLOW_SOURCES": "airflow_sources",
diff --git a/images/breeze/output-build-image.svg b/images/breeze/output-build-image.svg
index 5cb1a030c7..e1807c970a 100644
--- a/images/breeze/output-build-image.svg
+++ b/images/breeze/output-build-image.svg
@@ -1,4 +1,4 @@
-<svg width="1720.0" height="1198" viewBox="0 0 1720.0 1198"
+<svg width="1720.0" height="1220" viewBox="0 0 1720.0 1220"
      xmlns="http://www.w3.org/2000/svg">
     <style>
         @font-face {
@@ -143,9 +143,10 @@
 <div><span class="r4">│</span><span class="r1">  </span><span class="r5">--dev-apt-deps</span><span class="r1">                      </span><span class="r1">Apt dev dependencies to use when building the images.</span><span class="r1"> </span><span class="r7">(TEXT)</span><span class="r1">                  </span><span class="r1">  </span><span class="r4">│</span></div>
 <div><span class="r4">│</span><span class="r1">  </span><span class="r5">--runtime-apt-deps</span><span class="r1">                  </span><span class="r1">Apt runtime dependencies to use when building the images.</span><span class="r1"> </span><span class="r7">(TEXT)</span><span class="r1">              </span><span class="r1">  </span><span class="r4">│</span></div>
 <div><span class="r4">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span></div>
-<div><span class="r4">╭─ Preparing cache (for maintainers) ──────────────────────────────────────────────────────────────────────────────────╮</span></div>
+<div><span class="r4">╭─ Preparing cache and push (for maintainers and CI) ──────────────────────────────────────────────────────────────────╮</span></div>
 <div><span class="r4">│</span><span class="r1">  </span><span class="r5">--platform</span><span class="r1">                </span><span class="r1">Platform for Airflow image.</span><span class="r1"> </span><span class="r7">(linux/amd64|linux/arm64|linux/amd64,linux/arm64)</span><span class="r1">           </span><span class="r1">  </span><span class="r4">│</span></div>
 <div><span class="r4">│</span><span class="r1">  </span><span class="r5">--prepare-buildx-cache</span><span class="r1">    </span><span class="r1">Prepares build cache rather than build images locally.                                  </span><span class="r1">  </span><span class="r4">│</span></div>
+<div><span class="r4">│</span><span class="r1">  </span><span class="r5">--push-image</span><span class="r1">              </span><span class="r1">Push image after building it.                                                           </span><span class="r1">  </span><span class="r4">│</span></div>
 <div><span class="r4">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span></div>
 <div><span class="r4">╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮</span></div>
 <div><span class="r4">│</span><span class="r1">  </span><span class="r5">--verbose</span><span class="r1">  </span><span class="r6">-v</span><span class="r1">  </span><span class="r1">Print verbose information about performed steps.                                                   </span><span class="r1">  </span><span class="r4">│</span></div>
diff --git a/images/breeze/output-build-prod-image.svg b/images/breeze/output-build-prod-image.svg
index 625ae140f8..f30e4a9f4f 100644
--- a/images/breeze/output-build-prod-image.svg
+++ b/images/breeze/output-build-prod-image.svg
@@ -1,4 +1,4 @@
-<svg width="1720.0" height="1484" viewBox="0 0 1720.0 1484"
+<svg width="1720.0" height="1506" viewBox="0 0 1720.0 1506"
      xmlns="http://www.w3.org/2000/svg">
     <style>
         @font-face {
@@ -156,9 +156,10 @@
 <div><span class="r4">│</span><span class="r1">  </span><span class="r5">--install-airflow-reference</span><span class="r1">               </span><span class="r1">Install Airflow using GitHub tag or branch.</span><span class="r1"> </span><span class="r7">(TEXT)</span><span class="r1">                      </span><span class="r1">  </span><span class="r4">│</span></div>
 <div><span class="r4">│</span><span class="r1">  </span><span class="r5">--installation-method</span><span class="r1">                     </span><span class="r1">Install Airflow from: sources or PyPI.</span><span class="r1"> </span><span class="r7">(.|apache-airflow)</span><span class="r1">               </span><span class="r1">  </span><span class="r4">│</span></div>
 <div><span class="r4">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span></div>
-<div><span class="r4">╭─ Preparing cache (for maintainers) ──────────────────────────────────────────────────────────────────────────────────╮</span></div>
+<div><span class="r4">╭─ Preparing cache and push (for maintainers and CI) ──────────────────────────────────────────────────────────────────╮</span></div>
 <div><span class="r4">│</span><span class="r1">  </span><span class="r5">--platform</span><span class="r1">                </span><span class="r1">Platform for Airflow image.</span><span class="r1"> </span><span class="r7">(linux/amd64|linux/arm64|linux/amd64,linux/arm64)</span><span class="r1">           </span><span class="r1">  </span><span class="r4">│</span></div>
 <div><span class="r4">│</span><span class="r1">  </span><span class="r5">--prepare-buildx-cache</span><span class="r1">    </span><span class="r1">Prepares build cache rather than build images locally.                                  </span><span class="r1">  </span><span class="r4">│</span></div>
+<div><span class="r4">│</span><span class="r1">  </span><span class="r5">--push-image</span><span class="r1">              </span><span class="r1">Push image after building it.                                                           </span><span class="r1">  </span><span class="r4">│</span></div>
 <div><span class="r4">╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span></div>
 <div><span class="r4">╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮</span></div>
 <div><span class="r4">│</span><span class="r1">  </span><span class="r5">--answer</span><span class="r1">   </span><span class="r6">-a</span><span class="r1">  </span><span class="r1">Force answer to questions.</span><span class="r1"> </span><span class="r7">(y|n|q|yes|no|quit)</span><span class="r1">                                                     </span><span class="r1">  </span><span class="r4">│</span></div>
diff --git a/scripts/ci/images/ci_push_ci_images.sh b/scripts/ci/images/ci_push_ci_images.sh
deleted file mode 100755
index 30e211ee45..0000000000
--- a/scripts/ci/images/ci_push_ci_images.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# shellcheck source=scripts/ci/libraries/_script_init.sh
-. "$( dirname "${BASH_SOURCE[0]}" )/../libraries/_script_init.sh"
-
-# Pushes Ci images with tags to registry in GitHub
-function push_ci_image_with_tag_to_github() {
-    start_end::group_start "Push CI image"
-    docker_v tag "${AIRFLOW_CI_IMAGE}" "${AIRFLOW_CI_IMAGE}:${GITHUB_REGISTRY_PUSH_IMAGE_TAG}"
-    push_pull_remove_images::push_image_with_retries "${AIRFLOW_CI_IMAGE}:${GITHUB_REGISTRY_PUSH_IMAGE_TAG}"
-    start_end::group_end
-}
-
-build_images::prepare_ci_build
-
-build_images::login_to_docker_registry
-
-push_ci_image_with_tag_to_github