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



##########
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:
       Nope. We were excluding the "@" linesĀ (grep -v ""@")  because pip 
uninstall did not work with those ('apache-airflow@URL).
   * `pip uninstall apache-airflow-providers-google==1.0.0` works
   * `pip uninstall apache-airflow@http://.....` does not work
   
   However we do not need this grep any-more because I added full 
'apache-airlfow-providers  grep to remove providers separately and 
apache-airflow separately in the next line, so the whole grep -v "@" can be 
removed and we do not need to do any cut . 
   
   Removed it.




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