To run your code on Astronomer Software, you need to deploy it to an Airflow Deployment. You can deploy part or all of an Astro project to an Airflow Deployment using the Astro CLI. When you deploy a project, the Astro CLI builds your all files in your Astro project, including DAGs, into a Docker image. It then pushes this image to an image registry on your Astronomer Software cluster where your Deployment accesses the image and uses it to run Airflow containers. For guidance on automating this process, refer to Deploy to Astronomer via CI/CD. To learn how to add Python and OS-level packages or otherwise customize your Docker image, read Customize your image. This document covers deploying a complete project image to Astro. To deploy DAGs only, see:Documentation Index
Fetch the complete documentation index at: https://astronomer-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Astronomer recommends that all users use the Astro CLI to test their code locally before pushing it to an Airflow Deployment on Astronomer. For guidelines on developing locally, seeCLI Quickstart.
What happens during a project deploy
Everything in the project directory where you ran$ astro dev init is bundled into a Docker image and deployed to your Airflow Deployment on your Astronomer platform. This includes system-level dependencies, Python-level dependencies, DAGs, and your Dockerfile.
Astronomer exclusively deploys the code in your project and does not push any of the metadata associated with your local Airflow environment, including task history and Airflow connections or variables set locally in the Airflow UI.
For more information about what gets built into your image, read Customize your image.
Prerequisites
In order to push code to a Deployment on Astronomer, you must have:- The Astro CLI installed.
- Access to an Astronomer platform at
https://app.BASEDOMAIN. - An Astronomer Workspace with at least one active Airflow Deployment.
Step 1: Authenticate to Astronomer
To authenticate with the Astro CLI, run:Step 2: Confirm Your Workspace and Deployment
From the Astro CLI, you can push code to any Airflow Deployment you have access to as long as you have the appropriate deployment-level permissions. For more information on both Workspace and Deployment-level permissions on Astronomer, see User permissions. Before you deploy to Astronomer, make sure that the Airflow Deployment you’d like to deploy to is within the Workspace you’re operating in. To see the list of Workspaces you have access to, run:Step 3: Deploy to Astronomer
Finally, make sure you’re in the correct Astro project directory. When you’re ready to deploy your DAGs, run:If your code deploy fails and you configured your CLI to use Podman, you might need to set an additional environment variable. SeeTroubleshoot your Podman configuration.