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/01/24 17:35:48 UTC

[airflow] 04/04: Logs in to Github Registry when preparing cache (#21069)

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

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

commit bcc3f7f9d471f4edbcfffa68d21695a6f9c827ac
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Mon Jan 24 17:59:25 2022 +0100

    Logs in to Github Registry when preparing cache (#21069)
    
    Whe we are preparing cache on CI, we should login to the
    GitHub registry (using GITHUB_TOKEN) in order for --cache-to
    to be able to push images.
---
 scripts/ci/libraries/_build_images.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/ci/libraries/_build_images.sh b/scripts/ci/libraries/_build_images.sh
index c052261..470a26d 100644
--- a/scripts/ci/libraries/_build_images.sh
+++ b/scripts/ci/libraries/_build_images.sh
@@ -470,6 +470,8 @@ function build_images::build_ci_image() {
         exit 1
     fi
     if [[ ${PREPARE_BUILDX_CACHE} == "true" ]]; then
+        # we need to login to docker registry so that we can push cache there
+        build_images::login_to_docker_registry
         docker_ci_cache_directive+=(
             "--cache-to=type=registry,ref=${AIRFLOW_CI_IMAGE}:cache"
             "--load"
@@ -624,6 +626,8 @@ function build_images::build_prod_images() {
         exit 1
     fi
     if [[ ${PREPARE_BUILDX_CACHE} == "true" ]]; then
+        # we need to login to docker registry so that we can push cache there
+        build_images::login_to_docker_registry
         # Cache for prod image contains also build stage for buildx when mode=max specified!
         docker_cache_prod_directive+=(
             "--cache-to=type=registry,ref=${AIRFLOW_PROD_IMAGE}:cache,mode=max"