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



##########
File path: scripts/in_container/prod/entrypoint_prod.sh
##########
@@ -116,6 +116,11 @@ if ! whoami &> /dev/null; then
   export HOME="${AIRFLOW_USER_HOME_DIR}"
 fi
 
+# Install extra python packages if requirements.txt is present.
+if [[ -f "${AIRFLOW_HOME}/requirements.txt" ]]; then
+    pip install --user -r "${AIRFLOW_HOME}/requirements.txt"

Review comment:
       This is not correct way of installing the dependencies. Look here:
   
   
https://github.com/apache/airflow/blob/master/scripts/docker/install_additional_dependencies.sh
   
   This script has been extracted yesterdy from the Dockerfile and it shows the 
right way of installing additional dependencies. It handles  eager upgrade case 
which is not relevant but the "else" part of the if is how the install should 
be done:
   
   `pip install --user --upgrade --upgrade-strategy only-if-needed`
   
   This way you will automatically upgrade existing dependencies in case any of 
the existing dependencies require it. This should be likely also configurable 
(one might want to disable it), but it should be the default IMHO (unless there 
are good reasons not to do it).
   
   Additionally it would be great to add a "pip check" step afterwards and fail 
if there are some consistency problems. This will force anyone  who adds their 
requirements this way will not add conflicting requirements. 
   
   




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