fix: write Airflow dependency file as runtime user#135
Open
Haihan-Jiang wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #134.
install_airflow_depsnow creates and appends torequirements_with_airflow_version.txtthrough/home/airflow/run_as_user.sh. This keeps the generated requirements file owned/writable by the runtime Airflow user when local dev containers are configured to run as the host user.A new unit test executes the
install_airflow_depsshell function with stubbedrun_as_userandsudocommands, then verifies the requirements file content and that the copy/append operations were delegated throughrun_as_user.Validation
.venv/bin/python -m pytest tests/unit/test_entrypoint.py -q.venv/bin/python -m pytest tests/unit -qbash -n composer_local_dev/docker_files/entrypoint.shpython3 -m py_compile tests/unit/test_entrypoint.py