potiuk commented on a change in pull request #13422:
URL: https://github.com/apache/airflow/pull/13422#discussion_r550769201
##########
File path: scripts/ci/libraries/_build_images.sh
##########
@@ -913,31 +913,40 @@ function build_images::determine_docker_cache_strategy() {
}
-function build_images::build_prod_images_from_packages() {
+function build_image::assert_variable() {
+ local variable_name="${1}"
+ local expected_value="${2}"
+ local variable_value=${!variable_name}
+ if [[ ${variable_value} != "${expected_value}" ]]; then
+ echo
+ echo "${COLOR_RED_ERROR}: Variable ${variable_name}: expected_value:
'${expected_value}' but was '${variable_value}'!${COLOR_RESET}"
+ echo
+ exit 1
+ fi
+}
+
+function build_images::build_prod_images_from_locally_built_airflow_packages()
{
+ # We do not install from PyPI
+ build_image::assert_variable INSTALL_FROM_PYPI "false"
+ # But then we reinstall airflow and providers from prepared packages in
the docker context files
+ build_image::assert_variable INSTALL_FROM_DOCKER_CONTEXT_FILES "true"
+ # But we install everything from scratch to make a "clean" installation in
case any dependencies got removed
+ build_image::assert_variable AIRFLOW_PRE_CACHED_PIP_PACKAGES "false"
+
# Cleanup dist and docker-context-files folders
mkdir -pv "${AIRFLOW_SOURCES}/dist"
mkdir -pv "${AIRFLOW_SOURCES}/docker-context-files"
rm -f "${AIRFLOW_SOURCES}/dist/"*.{whl,tar.gz}
rm -f "${AIRFLOW_SOURCES}/docker-context-files/"*.{whl,tar.gz}
- runs::run_pip_download
Review comment:
We do not need to run pip download now. This is good because this code
is run from master, so previously we could not change the requirements for that
pip download. In the #13409 we are going to add per-image requirements and
since they will be in the images, not scripts, they are safe to run in
`workflow_run`
----------------------------------------------------------------
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]