Upgrade Astro Runtime
New versions of Astro Runtime are released regularly to support new Astro and Apache Airflow functionality. To take advantage of new features and bug and security fixes, Astronomer recommends upgrading Astro Runtime as new versions are available.
Upgrade Considerations
Consider the following when you upgrade Astro Runtime:
- All versions of the Astro CLI support all versions of Astro Runtime. There are no dependencies between the two products.
- Upgrading to certain versions of Runtime might result in extended upgrade times or otherwise disruptive changes to your environment. To learn more, see Version-specific upgrade considerations.
- Astronomer does not support downgrading a Deployment on Astro to a lower version of Astro Runtime.
To stay up to date on the latest versions of Astro Runtime, see Astro Runtime release notes. For more information on Astro Runtime versioning and support, see Astro Runtime versioning and lifecycle policy. For a full collection of Astro Runtime Docker images, go to the Astro Runtime repository on Quay.io.
Prerequisites
- An Astro project.
- An Astro Deployment.
- The Astro CLI.
If you're upgrading a local Airflow environment, you don't need an Astro Deployment and you can skip steps 3-4.
Step 1: Update Your Dockerfile
In your Astro project, open your
Dockerfile
.Change the Docker image in the
FROM
statement of yourDockerfile
to a new version of Astro Runtime.To upgrade to the latest version of Runtime, for example, change the
FROM
statement in your Dockerfile to:FROM quay.io/astronomer/astro-runtime:6.0.3
You must always specify the major, minor, and patch version of any given Astro Runtime version.
Step 2: Test Astro Runtime locally
Astronomer recommends testing new versions of Astro Runtime locally before upgrading a Deployment on Astro.
Save the changes to your
Dockerfile
.Open your project directory in your terminal and run
astro dev restart
. This restarts the Docker containers for the Airflow webserver, scheduler, triggerer, and Postgres metadata database.Access the Airflow UI of your local environment by navigating to
http://localhost:8080
in your browser.Confirm that your local upgrade was successful by scrolling to the bottom of any page. You should see your new Astro Runtime version in the footer as well as the version of Airflow it is based on.
Step 3: Deploy to Astronomer
To push your upgraded project to an Astro Deployment, run:
astro deploy
For more information about deploying to Astro, see Deploy code.
Once you upgrade to a Deployment on Astro to a new version of Astro Runtime, you cannot roll back or downgrade to a lower version. If you attempt to do so, you will see an error in the Astro CLI and your request to deploy will not succeed.
Step 4: Confirm your upgrade on Astro
In the Cloud UI, select a Workspace and then select a Deployment.
Click Open Airflow.
In the Airflow UI, scroll to the bottom of any page. You should see your new Runtime version in the footer:
You will also see an Image tag for your deploy. This tag is shown only for Deployments on Astro and is not generated for changes in a local environment.
Version upgrade considerations
This topic contains information about upgrading to specific versions of Astro Runtime. This includes breaking changes, database migrations, and other considerations.
Runtime 5 (Airflow 2.3)
Changes to the Airflow metadata database
Astro Runtime 5.0.0, based on Airflow 2.3, includes changes to the schema of the Airflow metadata database. When you first upgrade to Runtime 5.0.0, consider the following:
Upgrading to Runtime 5.0.0 can take 10 to 30 minutes or more depending on the number of task instances that have been recorded in the metadata database throughout the lifetime of your Deployment on Astro.
Once you upgrade successfully to Runtime 5, you might see errors in the Airflow UI that warn you of incompatible data in certain tables of the database. For example:
Airflow found incompatible data in the `dangling_rendered_task_instance_fields` table in your metadata database, and moved...
These warnings have no impact on your tasks or DAGs and can be ignored. If you want to remove these warning messages from the Airflow UI, reach out to Astronomer support. If requested, Astronomer can drop incompatible tables from your metadata database.
For more information on Airflow 2.3, see "Apache Airflow 2.3.0 is here" or the Airflow 2.3.0 changelog.