amoghrajesh commented on code in PR #76575: URL: https://github.com/apache/airflow/pull/76575#discussion_r4520363581
########## dev/registry/fill_durable_versions.py: ########## @@ -0,0 +1,166 @@ +#!/usr/bin/env python3 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +"""Date each durable module in modules.json against the provider tags that first shipped it. + +Runs on the host rather than in Breeze with the rest of the module extraction, because it reads +the ``providers-<id>/<version>`` git tags and Breeze does not mount ``.git``. + +Usage: + python dev/registry/fill_durable_versions.py --modules dev/registry/modules.json +""" + +from __future__ import annotations + +import argparse +import functools +import json +import subprocess +import sys +from pathlib import Path + +from packaging.version import InvalidVersion, Version + +AIRFLOW_ROOT = Path(__file__).parent.parent.parent + +# What to look for in the gating class's file to date the capability. Both tokens are the +# mechanism itself, not its declaration: KubernetesPodOperator reconnected via task_state_store +# in 10.20.0 but only declared `__supports_durable_execution` for the registry in 10.21.0, and +# dating it by the declaration would report a release later than the behaviour shipped. +DURABLE_TOKENS = { + "marker": "task_state_store", Review Comment: [review comments](https://github.com/apache/airflow/pull/76575/commits/a3336a66735e8ed82f8886e9ec95c58ccc27d89e) ########## dev/registry/registry_contract_models.py: ########## @@ -146,6 +146,11 @@ class ModuleContract(BaseModel): provider_name: str | None = None supports_durable_execution: bool = False supports_deferrable: bool = False + durable_mechanism: Literal["marker", "resumable_mixin"] | None = None Review Comment: [review comments](https://github.com/apache/airflow/pull/76575/commits/a3336a66735e8ed82f8886e9ec95c58ccc27d89e) ########## registry/src/durable.njk: ########## @@ -16,7 +16,7 @@ mainClass: durable-page <dl class="capabilities"> <div> <dt><span class="durable-badge">Durable</span> {{ counts.durable }}</dt> - <dd>On retry, reconnects to the job it already started, or replays the progress it saved, instead of starting over. Controlled by the operator's <code>durable</code> flag: on by default for most, opt-in for the AI agent operators. Several only reconnect on Airflow 3.3+.</dd> + <dd>On retry, reconnects to the job it already started, or replays the progress it saved, instead of starting over. Controlled by the operator's <code>durable</code> flag; each module below says which provider version it needs, and whether you have to opt in. Needs Airflow 3.3 or later.</dd> Review Comment: [review comments](https://github.com/apache/airflow/pull/76575/commits/a3336a66735e8ed82f8886e9ec95c58ccc27d89e) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
