You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/05 11:43:37 UTC

[GitHub] [airflow] potiuk opened a new pull request #20678: Modernizes usage of PIP in Airflow images

potiuk opened a new pull request #20678:
URL: https://github.com/apache/airflow/pull/20678


   * removes PIP_INSTALL_USER variable
   * upgrades PIP to 21.3.1
   * removes AIRFLOW_INSTALL_USER_FLAG as it is not needed
   * removes spurious usage of --upgrade flag for PIP
   * adds better diagnostics during the build for PIP location and version
   
   Separated out from #20238
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
   


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on a change in pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#discussion_r778768590



##########
File path: dev/README_RELEASE_PROVIDER_PACKAGES.md
##########
@@ -611,9 +611,9 @@ provider packages. This is especially helpful when you want to test integrations
 additional tools. Below is an example Dockerfile, which installs providers for Google/
 
 ```dockerfile
-FROM apache/airflow:2.0.0
+FROM apache/airflow:2.2.3
 
-RUN pip install --upgrade --user apache-airflow-providers-google==2.0.0.rc1
+RUN pip install  --user apache-airflow-providers-google==2.2.2.rc1

Review comment:
       ```suggestion
   RUN pip install --user apache-airflow-providers-google==2.2.2.rc1
   ```
   
   Nit

##########
File path: scripts/docker/install_airflow.sh
##########
@@ -56,26 +56,26 @@ function install_airflow() {
             pip uninstall apache-airflow --yes
             pip install ${AIRFLOW_INSTALL_EDITABLE_FLAG} \
                 "${AIRFLOW_INSTALLATION_METHOD}[${AIRFLOW_EXTRAS}]${AIRFLOW_VERSION_SPECIFICATION}"
-        fi
+            fi

Review comment:
       This seems unintended?
   
   ```suggestion
           fi
   ```

##########
File path: scripts/docker/install_pip_version.sh
##########
@@ -30,11 +30,13 @@
 . "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
 
 function install_pip_version() {
-    pip install --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}" && mkdir -p /root/.local/bin
+    pip install --disable-pip-version-check --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}" &&
+        mkdir -p ${HOME}/.local/bin

Review comment:
       Why is the final `mkdir` needed?

##########
File path: scripts/docker/common.sh
##########
@@ -60,3 +59,9 @@ function common::get_constraints_location() {
         AIRFLOW_CONSTRAINTS_LOCATION="${constraints_base}/${AIRFLOW_CONSTRAINTS}-${python_version}.txt"
     fi
 }
+
+function common::show_pip_version_and_location() {
+   echo "PATH=${PATH}"
+   echo "PIP on path: $(which pip)"

Review comment:
       ```suggestion
      echo "pip on path: $(which pip)"
   ```
   
   Consistency?




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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#issuecomment-1006426341


   We use to (and I did in #20679) write this kind of message when split out bigger work into separate commits: `Based on #20678 - so please take a look at the last commit only.` 


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#discussion_r778970533



##########
File path: scripts/docker/install_additional_dependencies.sh
##########
@@ -36,26 +35,26 @@ function install_additional_dependencies() {
         echo
         echo Installing additional dependencies while upgrading to newer dependencies
         echo
-        pip install ${AIRFLOW_INSTALL_USER_FLAG} --upgrade --upgrade-strategy eager \
+        pip install --upgrade --upgrade-strategy eager \
             ${ADDITIONAL_PYTHON_DEPS} ${EAGER_UPGRADE_ADDITIONAL_REQUIREMENTS}
         # make sure correct PIP version is used
-        pip install ${AIRFLOW_INSTALL_USER_FLAG} --upgrade "pip==${AIRFLOW_PIP_VERSION}"

Review comment:
       Nope we have
   ```
       PIP_USER="true"
   ```




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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#issuecomment-1005891613


   Addressed.


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk closed pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
potiuk closed pull request #20678:
URL: https://github.com/apache/airflow/pull/20678


   


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
uranusjr commented on pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#issuecomment-1006262208


   Covered by #20679.


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr closed pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
uranusjr closed pull request #20678:
URL: https://github.com/apache/airflow/pull/20678


   


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#discussion_r778972140



##########
File path: Dockerfile
##########
@@ -40,10 +40,11 @@ ARG ADDITIONAL_PYTHON_DEPS=""
 
 ARG AIRFLOW_HOME=/opt/airflow
 ARG AIRFLOW_UID="50000"
+ARG AIRFLOW_USER_HOME_DIR=/home/airflow

Review comment:
       Laked from the following change. 




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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk edited a comment on pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#issuecomment-1006423730


   For the future - @uranusjr - > I wanted to merge those two separately. They contained a lot of context in the "commit messages" and i separated them out deliberately (and planned to merge #20678 first and rebase #20679 on top). By squashing those two - we lost the context in the commit messages and all the changes were squashed :( .  


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk closed pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
potiuk closed pull request #20678:
URL: https://github.com/apache/airflow/pull/20678


   


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#issuecomment-1006257557


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#issuecomment-1005644993


   All should be addressed.


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on a change in pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
uranusjr commented on a change in pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#discussion_r778923449



##########
File path: scripts/docker/install_pip_version.sh
##########
@@ -30,11 +30,13 @@
 . "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
 
 function install_pip_version() {
-    pip install --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}" && mkdir -p /root/.local/bin
+    pip install --disable-pip-version-check --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}" &&
+        mkdir -p ${HOME}/.local/bin

Review comment:
       pip only checks whether `~/.local/bin` is in PATH, not whether it exists.




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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on a change in pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#discussion_r778940042



##########
File path: scripts/docker/install_additional_dependencies.sh
##########
@@ -36,26 +35,26 @@ function install_additional_dependencies() {
         echo
         echo Installing additional dependencies while upgrading to newer dependencies
         echo
-        pip install ${AIRFLOW_INSTALL_USER_FLAG} --upgrade --upgrade-strategy eager \
+        pip install --upgrade --upgrade-strategy eager \
             ${ADDITIONAL_PYTHON_DEPS} ${EAGER_UPGRADE_ADDITIONAL_REQUIREMENTS}
         # make sure correct PIP version is used
-        pip install ${AIRFLOW_INSTALL_USER_FLAG} --upgrade "pip==${AIRFLOW_PIP_VERSION}"

Review comment:
       Latest pip uses `--user` by default?




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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#issuecomment-1006423730


   For the future - @uranusjr - > I wanted to merge those two separately. They contained a lot of context in the "commit messages" and i separated them out deliberately (and planned to merge #20678 first and rebase #20679 on top) by squashing those two - we lost the context in the commit messages and all the changes were squashed :( .  


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#discussion_r778973216



##########
File path: scripts/docker/install_additional_dependencies.sh
##########
@@ -36,26 +35,26 @@ function install_additional_dependencies() {
         echo
         echo Installing additional dependencies while upgrading to newer dependencies
         echo
-        pip install ${AIRFLOW_INSTALL_USER_FLAG} --upgrade --upgrade-strategy eager \
+        pip install --upgrade --upgrade-strategy eager \
             ${ADDITIONAL_PYTHON_DEPS} ${EAGER_UPGRADE_ADDITIONAL_REQUIREMENTS}
         # make sure correct PIP version is used
-        pip install ${AIRFLOW_INSTALL_USER_FLAG} --upgrade "pip==${AIRFLOW_PIP_VERSION}"

Review comment:
       Apparently looks like I even added comment about it :)
   ```
   # By default PIP will install everything in ~/.local
   ARG PIP_USER="true"
   ```




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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#discussion_r778781006



##########
File path: scripts/docker/install_pip_version.sh
##########
@@ -30,11 +30,13 @@
 . "$( dirname "${BASH_SOURCE[0]}" )/common.sh"
 
 function install_pip_version() {
-    pip install --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}" && mkdir -p /root/.local/bin
+    pip install --disable-pip-version-check --no-cache-dir --upgrade "pip==${AIRFLOW_PIP_VERSION}" &&
+        mkdir -p ${HOME}/.local/bin

Review comment:
       As far as I remember it related to the warnings printed by PIP. 
   
   If we have no `bin` directory on PATH there is a warning generated by `pip` when --user flag is used and `~/.local/bin` is not in the PATH.
   
   We have (in Dockerfiles) this one to avoid the warning:
   
   ```
       PATH=${PATH}:/root/.local/bin
   ```
   
   And I just feel uncomfortable having a directory that is not existing on the PATH (not sure if `pip` checks if the directory is present, but i prefer to have it regardless).




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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#discussion_r778778319



##########
File path: scripts/docker/install_airflow.sh
##########
@@ -56,26 +56,26 @@ function install_airflow() {
             pip uninstall apache-airflow --yes
             pip install ${AIRFLOW_INSTALL_EDITABLE_FLAG} \
                 "${AIRFLOW_INSTALLATION_METHOD}[${AIRFLOW_EXTRAS}]${AIRFLOW_VERSION_SPECIFICATION}"
-        fi
+            fi

Review comment:
       Right




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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] ashb commented on a change in pull request #20678: Modernizes usage of PIP in Airflow images

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #20678:
URL: https://github.com/apache/airflow/pull/20678#discussion_r778939274



##########
File path: Dockerfile
##########
@@ -40,10 +40,11 @@ ARG ADDITIONAL_PYTHON_DEPS=""
 
 ARG AIRFLOW_HOME=/opt/airflow
 ARG AIRFLOW_UID="50000"
+ARG AIRFLOW_USER_HOME_DIR=/home/airflow

Review comment:
       Why do we need to add this up here? It doesn't seem to be used until the stage that (re-)defines 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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org