Skip to content
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

🐞 This repo and Airflow Repo conflict over desired state of dags folder. #6419

Open
jhpyke opened this issue Dec 20, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@jhpyke
Copy link
Contributor

jhpyke commented Dec 20, 2024

Describe the bug.

Currently, we provision airflow_local_settings.py, a file that allows us to set status messages in the Airflow UI, from this repo. However, to be processed, Airflow requires the script live in the DAGs folder. This then means that after this repo pushes these files, it puts the state of that folder in conflict with the Sync Dags to S3 script in the Airflow repo.

This script runs
aws s3 sync ./environments/${{ matrix.env }}/dags/ s3://mojap-airflow-${{ matrix.env }}/dags/ --exclude "*" --include "*.py" --delete
every time a DAG is altered by a user. When this occurs, the --delete flag means. that our airflow_local_settings.py is correctly identifed by the script as not existing in the Airflow repo, and is as such destroyed. This back and forth of placing and deleting the file will occur each time someone does a PR to the relevant sections of either repo, and as such should be resolved so we can put up long-lasting status messages.

To Reproduce

  1. Run a terraform plan/apply on analytical-platform-data-production/airflow
  2. Observe the two airflow_local_settings.py files being created in the Airflow S3 buckets.
  3. See the status message appear in Airflow
  4. Sync Dags in the Airflow repo
  5. See the status message dissapear after a short delay.

Expected Behaviour

We should be able to store airflow_local_settings.py in the bucket without it being removed.

Additional context

Can either move the local settings to being managed from within the Airflow repo, or we can re-write the sync action so it will correct ignore any DAGs not in a sub-directory. Either will achieve what we want here.

@jhpyke jhpyke added the bug Something isn't working label Dec 20, 2024
@jhpyke jhpyke changed the title 🐞 This repo and the 'Airflow' Repo conflict over desired state of dags folder. 🐞 This repo and Airflow Repo conflict over desired state of dags folder. Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 👀 TODO
Development

No branches or pull requests

1 participant