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 2021/04/11 20:50:07 UTC
[airflow] branch master updated: Avoids error on pushing PROD image
as cache (#15321)
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new 1dfbb8d Avoids error on pushing PROD image as cache (#15321)
1dfbb8d is described below
commit 1dfbb8d2031cb8a3e95e4bf91aa478857c5c3a85
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Sun Apr 11 22:49:48 2021 +0200
Avoids error on pushing PROD image as cache (#15321)
After stabilizing the builds on CI, the master builds started
to finally get green - except pushing to prod image cache which
continuous to fail as it missed python image to push.
This PR fixes it.
---
scripts/ci/images/ci_prepare_ci_image_on_ci.sh | 2 +-
scripts/ci/images/ci_prepare_prod_image_on_ci.sh | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/scripts/ci/images/ci_prepare_ci_image_on_ci.sh b/scripts/ci/images/ci_prepare_ci_image_on_ci.sh
index 8dd015f..ed76b48 100755
--- a/scripts/ci/images/ci_prepare_ci_image_on_ci.sh
+++ b/scripts/ci/images/ci_prepare_ci_image_on_ci.sh
@@ -43,7 +43,7 @@ function build_ci_image_on_ci() {
build_images::wait_for_image_tag "${GITHUB_REGISTRY_PYTHON_BASE_IMAGE}" \
"${python_tag_suffix}" "${AIRFLOW_PYTHON_BASE_IMAGE}"
- # And then the base image
+ # And then the actual image
build_images::wait_for_image_tag "${GITHUB_REGISTRY_AIRFLOW_CI_IMAGE}" \
":${GITHUB_REGISTRY_PULL_IMAGE_TAG}" "${AIRFLOW_CI_IMAGE}"
diff --git a/scripts/ci/images/ci_prepare_prod_image_on_ci.sh b/scripts/ci/images/ci_prepare_prod_image_on_ci.sh
index 516cc06..52ec2c6 100755
--- a/scripts/ci/images/ci_prepare_prod_image_on_ci.sh
+++ b/scripts/ci/images/ci_prepare_prod_image_on_ci.sh
@@ -33,9 +33,24 @@ function build_prod_images_on_ci() {
build_images::prepare_prod_build
if [[ ${USE_GITHUB_REGISTRY} == "true" && ${GITHUB_REGISTRY_WAIT_FOR_IMAGE} == "true" ]]; then
+ # Tries to wait for the images indefinitely
+ # skips further image checks - since we already have the target image
+
+ local python_tag_suffix=""
+ if [[ ${GITHUB_REGISTRY_PULL_IMAGE_TAG} != "latest" ]]; then
+ python_tag_suffix="-${GITHUB_REGISTRY_PULL_IMAGE_TAG}"
+ fi
+
+ # first we pull base python image. We will need it to re-push it after master build
+ # Becoming the new "latest" image for other builds
+ build_images::wait_for_image_tag "${GITHUB_REGISTRY_PYTHON_BASE_IMAGE}" \
+ "${python_tag_suffix}" "${AIRFLOW_PYTHON_BASE_IMAGE}"
+
+ # And then the actual image
build_images::wait_for_image_tag "${GITHUB_REGISTRY_AIRFLOW_PROD_IMAGE}" \
":${GITHUB_REGISTRY_PULL_IMAGE_TAG}" "${AIRFLOW_PROD_IMAGE}"
+ # And the prod build image
if [[ "${WAIT_FOR_PROD_BUILD_IMAGE=}" == "true" ]]; then
# If specified in variable - also waits for the build image
build_images::wait_for_image_tag "${GITHUB_REGISTRY_AIRFLOW_PROD_BUILD_IMAGE}" \