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


   Optimize dockerfiles for local rebuilds
       
   This is one of the last final refactorings of the image before
   it is eligible to become an "official image".
   
   The project for that is here with few remaining issues:
   
   https://github.com/apache/airflow/projects/3
   
   When you build dockerfiles locally for development the layer
   invalidation could happen earlier than you wanted - some of the
   variables (like COMMIT_SHA) were affecting the cache of Docker
   in the way that they forced either invalidation of the pre-cached
   packages installed or forced to recreate assets when they were
   not touched.
   
   Some of the variables there were not needed (for
   example PIP_INSTALL_USER flag as well.
   
   PIP was upgraded to version 21.3.1 (latest released)
   
   AIRLFOW_INSTALL_USER_FLAG is not needed - we always install
   Airflow with --user flag in Production Docker file and this
   is controlled by PIP_USER variable.
   
   In some places `--upgrade` flag for pip were used where it had
   no real usage (when airflow was installed in specific version)
   this has been also cleaned up as part of the PR.
   
   Additional PIP version diagnostics is printed to make sure
   that the right version of PIP from the right PATH is used.
   
   All `stderr` output has been carefully removed (except the
   warning of PIP which is accompanied by a reassuring message
   that we know what we are doing.
   
   Fixes: #20259
   
   This PR improves the experience of iterating over docker image
   building by decreasing unnecesary layer invalidations.
   
   <!--
   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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to