This feature is in Public Preview.
- Dag bundles carry Dag files. Each Dag bundle has a name, its own version history, and its own deploys.
- Non-Dag bundles carry supporting code, such as a dbt project. Each non-Dag bundle is identified by the path it’s mounted at, and is served alongside one or more Dag bundles.
main. It’s the default target for astro deploy --dags, and you can’t delete it. On Airflow 3 Deployments, you can create more named Dag bundles and deploy to each one separately.
Multiple Dag bundles are useful when several teams or repositories share a Deployment. Each team deploys its own bundle without carrying the other teams’ code, and a change to one bundle doesn’t redeploy the rest.
Airflow 3Creating Dag bundles other than
main requires an Airflow 3.x Deployment. Airflow 2 Deployments keep the single main bundle.Prerequisites
- An Astro Deployment running Airflow 3 with Dag-only deploys enabled.
- The Astro CLI version 1.46 or later.
- Workspace Author permissions or higher to create, update, and delete bundles. Workspace Member permissions are enough to view them.
How bundles relate to each other
A Deployment has one or more Dag bundles and any number of non-Dag bundles, up to a combined limit. Each non-Dag bundle is associated with at least one Dag bundle, which determines the Airflow workers that download it. For example, a Deployment shared by a finance team and a machine learning team might have three Dag bundles,main, finance, and ml, alongside a dbt project mounted at /usr/local/airflow/dbt/revenue and shared helper code mounted at /usr/local/airflow/include/shared.
The finance team deploys to finance on its own schedule, and the machine learning team deploys to ml on its own schedule. Neither deploy affects the other. The dbt project is served alongside finance only, and the shared helper code is served alongside both.
Create a Dag bundle
Astro creates themain bundle automatically when you enable Dag-only deploys. For every other Dag bundle, you must create it before you can deploy to it — Astro doesn’t create them automatically.
Bundle names must be 1-32 characters and can contain only lowercase letters, numbers, dashes, and underscores. The name main is reserved.
- Astro UI
- Astro CLI
- In the Astro UI, click Deployments, then select a Deployment.
- Click Bundles, then click Dag.
- Click New Dag bundle.
- Enter a Name, optionally add a Description, then click Create bundle.
Deploy Dags to a named bundle
Use the--dag-bundle-name flag to target a bundle:
--dag-bundle-name, a Dag deploy targets main, so existing commands and CI/CD pipelines keep working unchanged:
finance replaces the Dags in finance and leaves every other bundle alone.
You can’t use
--dag-bundle-name with --image. Named bundles apply only to deploys that include Dags.Deploy a non-Dag bundle
A non-Dag bundle is created the first time you deploy to a mount path that the Deployment hasn’t seen before. To deploy one and choose where it mounts:--non-dags-mount-pathis required. It’s the absolute path the bundle mounts at on your Airflow components, and it’s how Astro identifies the bundle. It can’t overlap/usr/local/airflow/dags.--non-dags-bundle-typeis a free-form label, such asdbt. It defaults tonone.
main unless you associate it with other Dag bundles. To change the association after the first deploy, update the bundle rather than redeploying it.
You can also register a non-Dag bundle before you deploy to it. In the Astro UI, click Bundles, click Non-Dag, then click New non-Dag bundle and set its Mount path and Served alongside bundles. The bundle stays empty until your first deploy to that mount path.
To deploy a dbt project with the dedicated dbt commands instead, see Deploy dbt projects to Astro.
View the bundles on a Deployment
- Astro UI
- Astro CLI
- In the Astro UI, click Deployments, then select a Deployment.
- Click Bundles.
- Click Dag or Non-Dag.
main carries a Default badge.Non-Dag lists each non-Dag bundle with its Mount path, Type, Description, Served alongside Dag bundles, Version, and Last deploy.A bundle that’s still rolling out shows a Deploying badge next to its version. A bundle you’ve deleted shows Deletion pending until your Deployment finishes removing it.Change which Dag bundles serve a non-Dag bundle
Set the complete list of Dag bundles you want the non-Dag bundle served alongside. The new list replaces the existing one and can’t be empty.- Astro UI
- Astro CLI
- In the Astro UI, click Deployments, then select a Deployment.
- Click Bundles, then click Non-Dag.
- Open the actions menu for the bundle, then click Edit bundle.
- Change Served alongside, then click Save.
Delete a bundle
Deleting a Dag bundle stops Astro from serving its Dags to your Deployment. Airflow might then drop the Dag records for those Dags, and task runs still in flight might fail. Deleting a non-Dag bundle removes its files from the Airflow components that served it. Neither deletes your source code.On Astro Runtime 3.0-1 through 3.2-4, Airflow doesn’t remove a deleted bundle’s Dag records automatically. Remove them manually after you delete the bundle.
- Astro UI
- Astro CLI
- In the Astro UI, click Deployments, then select a Deployment.
- Click Bundles, then click Dag or Non-Dag.
- Open the actions menu for the bundle you want to delete, then click Delete bundle.
- Enter the bundle’s name, or its mount path for a non-Dag bundle, then click Delete bundle.
- You can’t delete
main. - You can’t delete a Dag bundle if that would leave a non-Dag bundle with no Dag bundle to be served alongside. Associate those non-Dag bundles with another Dag bundle, or delete them, first.
Limits and requirements
Dag IDs must be unique across bundles
Airflow identifies a Dag by its Dag ID alone, so a Dag ID must be unique across every bundle on a Deployment, not only within one bundle. If the same Dag ID exists in two bundles, the bundle that parsed most recently wins. That can change from one parse to the next, so the Dag can alternate between bundles. Any consistent behavior you observe isn’t guaranteed to continue. On Airflow 3.4 and later, Airflow also records a duplicate Dag ID warning naming the other file and bundle. Before you split code into bundles, check that you don’t have duplicate Dag IDs across the repositories you’re splitting.Deploy history and rollbacks
Each bundle deploy is its own entry in your Deployment’s deploy history, recording which bundle it changed. See Deploy history and rollbacks. Rollbacks apply to the whole Deployment, not to one bundle. Rolling back returns every bundle to the state captured in the deploy you select, which means:- Bundles that changed after that deploy return to their earlier versions.
- Bundles you created after that deploy are deleted.
- Bundles you deleted after that deploy are restored.