potiuk commented on a change in pull request #13409:
URL: https://github.com/apache/airflow/pull/13409#discussion_r550769457



##########
File path: Dockerfile
##########
@@ -179,16 +179,25 @@ RUN pip install --upgrade "pip==${AIRFLOW_PIP_VERSION}"
 ARG AIRFLOW_PRE_CACHED_PIP_PACKAGES="false"
 ENV AIRFLOW_PRE_CACHED_PIP_PACKAGES=${AIRFLOW_PRE_CACHED_PIP_PACKAGES}
 
+# By default we install providers from PyPI but in case of Breze build we want 
to install providers
+# from local sources without the neeed of preparing provider packages upfront. 
This value is
+# automatically overridden by Breeze scripts.
+ARG INSTALL_PROVIDERS_FROM_SOURCES="false"
+ENV INSTALL_PROVIDERS_FROM_SOURCES=${INSTALL_PROVIDERS_FROM_SOURCES}
+
 # In case of Production build image segment we want to pre-install master 
version of airflow
 # dependencies from GitHub so that we do not have to always reinstall it from 
the scratch.
+# The Airflow (and providers in case INSTALL_PROVIDERS_FROM_SOURCES is "false")
+# are uninstalled, only depeendencies remain
 RUN if [[ ${AIRFLOW_PRE_CACHED_PIP_PACKAGES} == "true" ]]; then \
        if [[ ${INSTALL_MYSQL_CLIENT} != "true" ]]; then \
           AIRFLOW_EXTRAS=${AIRFLOW_EXTRAS/mysql,}; \
        fi; \
        pip install --user \
           
"https://github.com/${AIRFLOW_REPO}/archive/${AIRFLOW_BRANCH}.tar.gz#egg=apache-airflow[${AIRFLOW_EXTRAS}]";
 \
-          --constraint "${AIRFLOW_CONSTRAINTS_LOCATION}" \
-          && pip uninstall --yes apache-airflow; \
+          --constraint "${AIRFLOW_CONSTRAINTS_LOCATION}"; \
+       pip freeze | grep apache-airflow-providers | grep -v '@' | xargs pip 
uninstall --yes || true ; \

Review comment:
       For 'cache' installation we only care about dependencies. So removing 
airflow + providers here makes sense - they will be installed further down.




----------------------------------------------------------------
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]


Reply via email to