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/08/10 20:36:21 UTC
[airflow] 10/22: Do not pull CI image for ownership fixing on first,
fresh breeze run (#17419)
This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v2-1-test-jarek-cherry-picks
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 70794b00175e01c18d72fca3ce8eb58ef306e76b
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Wed Aug 4 22:00:33 2021 +0200
Do not pull CI image for ownership fixing on first, fresh breeze run (#17419)
When you run Breeze on fresh machine, this script pulled the CI
image before any operation. It is not harmful in most cases but
it unnecessarily delays the first real image check and rebuild,
where fixing ownership is not really needed (as we've never run
Breeze before).
(cherry picked from commit 537c25417814d86bcee195ee03027840ce5837b6)
---
scripts/ci/tools/fix_ownership.sh | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/scripts/ci/tools/fix_ownership.sh b/scripts/ci/tools/fix_ownership.sh
index 6ed1161..de15621 100755
--- a/scripts/ci/tools/fix_ownership.sh
+++ b/scripts/ci/tools/fix_ownership.sh
@@ -33,8 +33,12 @@ sanity_checks::sanitize_mounted_files
read -r -a EXTRA_DOCKER_FLAGS <<<"$(local_mounts::convert_local_mounts_to_docker_params)"
-docker_v run --entrypoint /bin/bash "${EXTRA_DOCKER_FLAGS[@]}" \
- --rm \
- --env-file "${AIRFLOW_SOURCES}/scripts/ci/docker-compose/_docker.env" \
- "${AIRFLOW_CI_IMAGE}" \
- -c /opt/airflow/scripts/in_container/run_fix_ownership.sh || true
+if docker image inspect "${AIRFLOW_CI_IMAGE}" >/dev/null 2>&1; then
+ docker_v run --entrypoint /bin/bash "${EXTRA_DOCKER_FLAGS[@]}" \
+ --rm \
+ --env-file "${AIRFLOW_SOURCES}/scripts/ci/docker-compose/_docker.env" \
+ "${AIRFLOW_CI_IMAGE}" \
+ -c /opt/airflow/scripts/in_container/run_fix_ownership.sh || true
+else
+ echo "Skip fixing ownership as seems that you do not have the ${AIRFLOW_CI_IMAGE} image yet"
+fi