-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Mark Airflow directory in container as safe for git commands #29386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
00ab0ab to
76eb7e0
Compare
|
Almost... Had to explicitly add "/opt/airflow" |
|
OK. Package preparation passed the place where it errored out. Build PROD images should get fixed automatically after merging. |
|
Not really seems that the new git has also another back-compat problem with retrieving git revision revision retrieval which prepares Airflow package and returns empty-hash (impact actual airflow prepareation). Need to take a look later (in 1 hour or so). |
|
(Unless someone else wants to take a look till then). |
|
BTW. Got at least clarity how we got there:
This method (from airflow's setup.py) stopped returning git hash for airflow. |
There is a new setting/version of git in GitHub Actions that started checking the ownership of the Git repository. Since in case of the provider commands we run them inside docker image as root user (this is in order to isolate the provider package building from the main CI environment), the owner of such directory is different (runner user) than the user that runs the git command (root). This change marks the current git directory for such commands as safe, regardles from the discrepancy. This config is global and run inside the image, so it is safe to leave it after methods complete as containers are torn-down after completing package preparation. This PR also improves diagnostics. Previously the `git remote add` output was redirected to dev null as there was no way it could fail, but this turned to be false - the output of the `git remote add` commnd is now also printed for diagnostics.
76eb7e0 to
341cbbf
Compare
|
OK. Seems that it was the same reason - git complained about different user owning the .git repo and version was not retrievable. Added the same exclusion for building airflow packages. |
|
OK. Issue solved (there are tests failing in main due to some upgraded dependencies, but this is another issue and can be solved later. |
There is a new setting/version of git in GitHub Actions that started checking the ownership of the Git repository. Since in case of the provider commands we run them inside docker image as root user (this is in order to isolate the provider package building from the main CI environment), the owner of such directory is different (runner user) than the user that runs the git command (root). This change marks the current git directory for such commands as safe, regardles from the discrepancy. This config is global and run inside the image, so it is safe to leave it after methods complete as containers are torn-down after completing package preparation. This PR also improves diagnostics. Previously the `git remote add` output was redirected to dev null as there was no way it could fail, but this turned to be false - the output of the `git remote add` commnd is now also printed for diagnostics. (cherry picked from commit 2e1635a)
There is a new setting/version of git in GitHub Actions that started checking the ownership of the Git repository. Since in case of the provider commands we run them inside docker image as root user (this is in order to isolate the provider package building from the main CI environment), the owner of such directory is different (runner user) than the user that runs the git command (root). This change marks the current git directory for such commands as safe, regardles from the discrepancy. This config is global and run inside the image, so it is safe to leave it after methods complete as containers are torn-down after completing package preparation. This PR also improves diagnostics. Previously the `git remote add` output was redirected to dev null as there was no way it could fail, but this turned to be false - the output of the `git remote add` commnd is now also printed for diagnostics. (cherry picked from commit 2e1635a)
There is a new setting/version of git in GitHub Actions that started checking the ownership of the Git repository. Since in case of the provider commands we run them inside docker image as root user (this is in order to isolate the provider package building from the main CI environment), the owner of such directory is different (runner user) than the user that runs the git command (root).
This change marks the current git directory for such commands as safe, regardles from the discrepancy.
This config is global and run inside the image, so it is safe to leave it after methods complete as containers are torn-down after completing package preparation.
This PR also improves diagnostics. Previously the
git remote addoutput was redirected to dev null as there was no way it could fail, but this turned to be false - the output of thegit remote addcommnd is now also printed for diagnostics.^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.