Migrating Airflow DAGs from Cloudera Data Engineering to Cloudera Workflow Orchestrator

Move Airflow DAGs from Cloudera Data Engineering virtual clusters to the Git repository of Cloudera Workflow Orchestrator by using a workload plan. Code Migrator refactors the DAGs for the target Airflow version, and you review the changes before Cloudera Migration Assistant merges them.

  • The Cloudera Data Engineering service and the Cloudera Workflow Orchestrator instance are registered. See Registering Cloudera Data Engineering services and Registering Cloudera Workflow Orchestrator.
  • You have an AWC User Connection and a Git Connection for Cloudera Workflow Orchestrator. See Managing user connections.
  • Code Migrator is available. It is displayed when Enable LLM is on in the engine configuration of the Cloudera Migration Assistant engine.
  • The agents can reach the Cloudera Data Engineering service, the Cloudera Workflow Orchestrator instance, and the Git repository.
  • You have the cma-migrator or cma-admin role.
  1. Scan the Cloudera Data Engineering service for Airflow DAGs.
    See Scanning clusters.
  2. Scan the Cloudera Workflow Orchestrator instance.
  3. Create a workload plan with the Cloudera Data Engineering service as the source and the Cloudera Workflow Orchestrator instance as the destination.
    Select the Airflow connection in Connection ID, select CDE Airflow Migration as the type, and select the virtual clusters to migrate. See Creating migration plans.
  4. On the Plans page, open the plan.
  5. Click the Collections tab.
  6. Add the DAGs that you want to migrate to a collection.
  7. Click the Metadata tab.
    The source DAGs are displayed on the left, and the target DAGs on the right.
  8. Map the DAGs to the target repository:
    • To map one DAG, click Map DAG to GitHub on its row.
    • To map several DAGs, select them and click Map DAGs to GitHub.
  9. Click the Data tab.
  10. Check that each mapped DAG and its resource files are displayed at the expected paths on the target side.
    If a path is wrong, unmap the DAG on the Metadata tab and map it again.
  11. Click the Workloads tab.
  12. Click CDE Airflow.
  13. In Select Airflow, select a DAG.
  14. Compare the Source and Target details of the DAG: Name, Dag ID, and Schedule.
    If a DAG has a red warning icon, its target DAG ID is a duplicate. See Resolving DAG name conflicts.
  15. Click Save.
  16. Create and run an execution.
    See Running plan executions.
  17. When the execution reaches the Review code changes step, review the branches that Code Migrator created.
  18. Click Mark As Completed.

The execution runs these steps in order:

Table 1. Steps of CDE Airflow Migration executions
Step What it does
Export from CDE Copies the mapped DAGs and their resource files to an intermediate Git repository, on a plan branch.
Migrate Code using AI Starts Code Migrator jobs that refactor the DAGs for the target Airflow version. Each job writes its changes to its own branch, forked from the plan branch.
Review code changes A manual step. You review the changes in the intermediate repository, and then mark the step as completed.
Finalize changes Merges the branches of the Code Migrator jobs into the plan branch.
Push changes in Git Creates a change with the migrated DAGs in the Git repository of Cloudera Workflow Orchestrator.
Create Spark migration plan Finds the Spark jobs that the migrated DAGs run, and creates a CDE Spark Migration plan for them, named [***AIRFLOW PLAN***] - Spark jobs, for each target cluster. Each job is mapped to the target virtual cluster of its Airflow connection. The step does not run the new plan.
Clean up temporary files Merges the plan branch into the base branch of the intermediate Git repository.

The migrated DAGs fail until the Spark jobs that they run exist on the target. Run the Spark plan that the execution created next. See Migrating Cloudera Data Engineering Spark jobs.

Test the DAGs in Cloudera Workflow Orchestrator before you rely on them. Your source Cloudera Data Engineering service is not changed, and its DAGs keep running on their schedules. Cloudera Migration Assistant does not prevent a DAG from running on both platforms. See Phased migrations.