Configure git-sync code deploys
Configure git-sync code deploys
Configure git-sync code deploys
Starting with Astronomer v0.27, you can deploy DAGs to an Astronomer Deployment using git-sync. After setting up this feature, you can deploy DAGs from a Git repository without any additional CI/CD. DAGs deployed with git-sync automatically appear in the Airflow UI without requiring additional action or causing downtime.
This guide provides setup steps for configuring git-sync as a DAG deploy option.
To enable the git-sync deploy feature, you need:
To configure a git-sync deploy mechanism for a Deployment on Astronomer, you need Workspace Editor permissions.
To deploy DAGs to a Deployment using a git-sync deploy mechanism, you need permission to push code to a Git repository configured for git-sync deploys.
Git-sync deploys must be explicitly enabled on Astronomer by a System Admin. To enable it, update your values.yaml file with the following values:
The Git repo you want to sync should contain a directory of DAGs that you want to deploy to Astronomer. You can include additional files in the repo, such as your other Astro project files, but note that this might affect performance when deploying new changes to DAGs.
If you want to deploy DAGs with a private Git repo, you additionally need to configure SSH so that your Astronomer Deployment can access the contents of the repo. This process varies slightly between Git repository management tools. For an example of this configuration, read GitLab’s SSH Key documentation.
Workspace editors can configure a new or existing Airflow Deployment to use a git-sync mechanism for DAG deploys. From there, any member of your organization with write permissions to the Git repository can deploy DAGs to the Deployment. To configure a Deployment for git-sync deploys:
In the Software UI, create a new Airflow Deployment or open an existing one.
Go to the DAG Deployment section of the Deployment’s Settings page.
For your Mechanism, select Git Sync.
Configure the following values:
./. Other changes outside the DAGs directory in your Git repository must be deployed using astro deployssh-keyscan -t rsa <provider-domain>. For an example of how to retrieve GitHub’s public key, refer to Apache Airflow documentation.Save your changes.
Once you configure your Deployment, any code pushes to your DAG directory of the specified Git repo and branch will appear in your Deployment with zero downtime.
AIRFLOW__SCHEDULER__DAG_DIR_LIST_INTERVAL in your Airflow deployment.