Page MenuHomePhabricator

Upgrade airflow-main to 3.3.x
Open, In Progress, MediumPublic

Description

We are upgrading Airflow to version 3.3.x, mostly for security reasons, as Airflow 2.x is not supported anymore. Unfortunately, there are lots of APIs changes. This task is tracking the upgrade of main instance, as defined in Gitlab in airflow-dags/main and Gerrit in deployment-charts/.../airflow-main.

Most of the changes are tracked as subtasks of T423248.

Stages

  • Ensure that all DAGs are serialisable in Airflow 3
  • Testing the Dags in airflow-devenv to figure out the scope (see Accessing Airflow 3).
  • Code upgrades to make sure most of the airflow-dags codebase is working
  • Validation of the main instance in airflow-devenv
  • Planning the switchover

PoCs for the main instance are:

  • ???

Details

Related Changes in Gerrit:

Event Timeline

atsuko triaged this task as Medium priority.

@JAllemandou do you know what Dags can I safely run and how?

Summary from meeting today between @atsuko and myself:

  • We want to test classes of DAGs that represent usage patterns
  • @JAllemandou will try to define the DAG classes using an iterative approach (most used usage patterns first) and to find examples to be tested for those classes
atsuko changed the task status from Open to In Progress.Aug 26 2026, 9:32 AM

I'm marking the task as In progress so I can track which instances are taken care of.

I asked Claude to help me with the categorization, and I think it did a great job: https://claude.ai/code/artifact/1e94957f-b4a2-4426-b1eb-84b8e04cd757
Ping @xcollazo and @Antoine_Quhen on this for review please :)

Thanks for driving the Airflow upgrade @atsuko!

@JAllemandou, overall I agree with the method for determining the short list of DAGs to test. A couple of additions:

  • PythonOperator is very permissive and can host a potpourri of custom config, arbitrary libraries, and other Airflow tweaks, so more "PythonOperator example" may be needed for full coverage.
  • get_sensor_for / get_maintenance_tasks: it might be worth increasing unit test coverage before the upgrade (an agent could help here).

Testing in dev-env isn't easy: you have to set up the inputs (tables, HDFS dirs, connections, ...) and then sanity-check the results. I think it would save time to let the original team/author handle the tests for their own DAGs (I'm happy to help).

As an alternative, analytics_test/dags/custom_operators_tryout_dag.py was designed to test uncommon operators. In your case it might simplify things to ask an AI to create a small number of DAGs that cover all the operators already identified by @JAllemandou, using completely synthetic data.

I asked Claude to help me with the categorization, and I think it did a great job: https://claude.ai/code/artifact/1e94957f-b4a2-4426-b1eb-84b8e04cd757
Ping @xcollazo and @Antoine_Quhen on this for review please :)

I think this approach of categorization makes sense.

But I also think that a significant amount of the migration pain will come not from the opeartors themselves, but from our custom code that uses APIs that have changed significantly, like our DagProperties, PoolRegistry, and anything else that depends on the airflow.models.* models.

I would suggest that we tackle those mechanism first, and the analytics-test instance is the perfect environment to iterate on that.

JAllemandou added a subscriber: Ahoelzl.

Thanks @Antoine_Quhen and @xcollazo for your comments.

To my understanding, @atsuko is already tackling the "custom code that uses APIs" we have (pools for instance).

I think the Data Engineering team will own testing the DAGs, so we'll need to decide if we wish to follow the path of using the list Claude built, or custome DAGS built on purpose. I don't really have an opinion on this.

@Ahoelzl - I'm reassigning this task to you to prioritise and discuss assignments with the team.

Moving this two work items from the big research task. I need help fixing database access in these 2 files, or at least guidance on how to test related DAGs

Those are extremely easy with the new REST API client

create a small number of DAGs that cover all the operators already identified by @JAllemandou, using completely synthetic data.

@Antoine_Quhen Could you please clarify who it was referred to? Unfortunately, I don't have any context on data structures and actual processes.

But I also think that a significant amount of the migration pain will come not from the opeartors themselves, but from our custom code that uses APIs that have changed significantly, like our DagProperties, PoolRegistry, and anything else that depends on the airflow.models.* models.

I believe DagProperties is working, we tested it at least on a surface level on other instances. PoolRegistry and other session-related operations (which is the most of airflow.models.* invocations) are either already fixed, or can be trivially re-written with REST API as per T434896.

I would say that the categorisation misses two points: 1) all the syntactic operations will be caught on either DAG instantiation or in tests/conftest.py CI (after T437994 is done), and 2) many operators and patterns can be tested in other instances that are more suited for testing (e.g. analytics-test T435477 and test-k8s T433383). Applying this consideration can significantly reduce the amount of verification needed.

I believe DagProperties is working, we tested it at least on a surface level on other instances.

Awesome!

Moving this two work items from the big research task. I need help fixing database access in these 2 files, or at least guidance on how to test related DAGs

Those are extremely easy with the new REST API client

Got patches up for these:
https://gitlab.wikimedia.org/repos/data-engineering/airflow-dags/-/merge_requests/2735
https://gitlab.wikimedia.org/repos/data-engineering/airflow-dags/-/merge_requests/2737

Change #1353296 had a related patch set uploaded (by Atsuko; author: Atsuko):

[operations/deployment-charts@master] airflow3: tuning dag-processor

https://gerrit.wikimedia.org/r/1353296

Fixed high-load on dag-processor, now all DAGs are loaded in a reasonable time (under 5 minutes, need to tune CPU allocation vs number of threads a bit more).

Change #1353296 merged by jenkins-bot:

[operations/deployment-charts@master] airflow3: tuning dag-processor

https://gerrit.wikimedia.org/r/1353296

@Ahoelzl there are lots of tests that need refactoring for the new API, T440709. I'm leaving it here as an up-for-grab item for Data Engineering space, would you please help me prioritise/schedule it?