ashb commented on a change in pull request #4938: [AIRFLOW-4117] Multi-staging
Image - Travis CI tests [Step 3/3]
URL: https://github.com/apache/airflow/pull/4938#discussion_r299365709
##########
File path: hooks/build
##########
@@ -200,29 +226,51 @@ echo
export
AIRFLOW_CONTAINER_PUSH_IMAGES=${AIRFLOW_CONTAINER_PUSH_IMAGES:=${NON_CI}}
# Whether to force pull images to populate cache
-export
AIRFLOW_CONTAINER_FORCE_PULL_IMAGES=${AIRFLOW_CONTAINER_FORCE_PULL_IMAGES:="true"}
+# This is set to true by default in CI test environment (we always pull latest
images first)
+export
AIRFLOW_CONTAINER_FORCE_PULL_IMAGES=${AIRFLOW_CONTAINER_FORCE_PULL_IMAGES:=${CI}}
+
+# Skips downloading and building the slim image of airflow
+# This is set to true by default in CI test environment (we only need full CI
image then)
+export
AIRFLOW_CONTAINER_SKIP_SLIM_CI_IMAGE=${AIRFLOW_CONTAINER_SKIP_SLIM_CI_IMAGE:=${CI}}
+echo "Skip slim image: ${AIRFLOW_CONTAINER_SKIP_SLIM_CI_IMAGE}"
-# Skips downloading and building the main, trimmed down image of airflow
-# This is set to true by default in CI environment (we only need CI image then)
-export
AIRFLOW_CONTAINER_SKIP_MAIN_IMAGE=${AIRFLOW_CONTAINER_SKIP_MAIN_IMAGE:=${CI}}
-echo "Skip main image: ${AIRFLOW_CONTAINER_SKIP_MAIN_IMAGE}"
+# Skips downloading and building the CI image, full CI-enabled image of airflow
+# This is set to true for pre-tests which do not need the whole CI image just
the slim one
+export
AIRFLOW_CONTAINER_SKIP_CI_IMAGE=${AIRFLOW_CONTAINER_SKIP_CI_IMAGE:="false"}
+echo "Skip CI image: ${AIRFLOW_CONTAINER_SKIP_CI_IMAGE}"
# Skips pulling the airflow images - this will use cache but will build it all
from scratch
export
AIRFLOW_CONTAINER_SKIP_PULLING_AIRFLOW_IMAGES=${AIRFLOW_CONTAINER_SKIP_PULLING_AIRFLOW_IMAGES:="false"}
echo "Skip pulling Airflow images:
${AIRFLOW_CONTAINER_SKIP_PULLING_AIRFLOW_IMAGES}"
+# Fixes permissions for git-checked out files. This is needed to have
consistent build cache across
+# Dockerhub, TravisCI and locally checked out code
export AIRFLOW_FIX_PERMISSIONS=${AIRFLOW_FIX_PERMISSIONS:="all"}
echo "Fixing permissions: ${AIRFLOW_FIX_PERMISSIONS}"
-# Base python image for the build
-PYTHON_BASE_IMAGE=python:${PYTHON_VERSION}-slim
+export AIRFLOW_CONTAINER_BUILD_NPM=${AIRFLOW_CONTAINER_BUILD_NPM:="true"}
+echo "Building NPM is enabled"
-# Image of the main airflow - this is a "reference" image of Airflow with
minimum requirements needed
-AIRFLOW_IMAGE="${LOCAL_IMAGE}-v${AIRFLOW_VERSION}"
-
-# Image of the Airflow CI - this is the image used to run tests in CI
environment
-AIRFLOW_CI_IMAGE="${LOCAL_IMAGE}-ci-v${AIRFLOW_VERSION}"
+# Base python image for the build
+export PYTHON_BASE_IMAGE=python:${PYTHON_VERSION}-slim
+
+if [[ "${AIRFLOW_RELEASE_BUILD}" == "true" ]]; then
+ export
AIRFLOW_SLIM_CI_IMAGE="${DOCKERHUB_USER}/${DOCKERHUB_REPO}:${AIRFLOW_VERSION}--python${PYTHON_VERSION}-ci-slim"
Review comment:
Typo?
```suggestion
export
AIRFLOW_SLIM_CI_IMAGE="${DOCKERHUB_USER}/${DOCKERHUB_REPO}:${AIRFLOW_VERSION}-python${PYTHON_VERSION}-ci-slim"
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services