Skip to content

AIP-65: Add DAG versioning support - #42913

Merged
ephraimbuddy merged 49 commits into
apache:mainfrom
astronomer:versioned-dag2
Nov 5, 2024
Merged

AIP-65: Add DAG versioning support#42913
ephraimbuddy merged 49 commits into
apache:mainfrom
astronomer:versioned-dag2

Conversation

@ephraimbuddy

@ephraimbuddyephraimbuddy commented Oct 10, 2024

Copy link
Copy Markdown
Contributor

This commit introduces versioning for DAGs.

Changes:

  • Introduced DagVersion model to handle versioning of DAGs.
  • Added version_name field to DAG for use in tracking the dagversion by users
  • Modified DAG execution logic to reference dag_version_id instead of the dag_hash to ensure DAG runs are linked to specific versions.

The table relations:
Screenshot 2024-10-25 at 09 21 19

The versioning is based on the serialized dict changing. If a dag's serialized dict changes, a new serialized dag will be registered based on the hash diference, and consequently, a new dag version and dag code. The link from dag_version to TI is because of TaskInstance clearing. It helps us retain the previous dag version the task ran with.

Closes: #42333, #42334, #42336

@boring-cyborgboring-cyborgBot added area:API Airflow's REST/HTTP API area:CLI area:db-migrations PRs with DB migration area:dev-tools area:Scheduler including HA (high availability) scheduler area:serialization area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues kind:documentation labels Oct 10, 2024
Comment threadairflow/models/dag_version.py Outdated
@ephraimbuddy
ephraimbuddyforce-pushed the versioned-dag2 branch 5 times, most recently from ad4f57c to dd272b0CompareOctober 16, 2024 12:27
@ephraimbuddyephraimbuddy added the legacy api Whether legacy API changes should be allowed in PR label Oct 16, 2024
@ephraimbuddy
ephraimbuddyforce-pushed the versioned-dag2 branch 3 times, most recently from eb13cdd to 1b81f2fCompareOctober 16, 2024 13:27
@ephraimbuddy
ephraimbuddy marked this pull request as ready for review October 16, 2024 13:27

@uranusjruranusjr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enough

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIP-65: DAG history in UIarea:APIAirflow's REST/HTTP APIarea:CLIarea:db-migrationsPRs with DB migrationarea:dev-toolsarea:Schedulerincluding HA (high availability) schedulerarea:serializationarea:UIRelated to UI/UX. For Frontend Developers.area:webserverWebserver related Issueskind:documentationlegacy apiWhether legacy API changes should be allowed in PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calculate and track DAG version

7 participants

@ephraimbuddy@kaxil@dstandish@ashb@uranusjr@jedcunningham@jscheffl