Skip to content

Support extra field for Coordinator - #68694

Merged
jason810496 merged 2 commits into
apache:mainfrom
jason810496:feature/lang-sdk/coordinator-pod-template-file
Jun 22, 2026
Merged

Support extra field for Coordinator #68694
jason810496 merged 2 commits into
apache:mainfrom
jason810496:feature/lang-sdk/coordinator-pod-template-file

Conversation

@jason810496

@jason810496jason810496 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Why

While verifying KuberntesExecutor setup for Multi-Lang feature, I found that we need a new config mapping to represent coordinator -> pod_template_file. For example, KubernetesExecutor needs image with JVM runtime for Java-Task.

How

Here're several directions that I went through:

  1. (Current choice) Generic extra object on the [sdk] coordinators entry. Regarding the extra field naming, I also considered executor, deployment, etc. But I prefer as extra to make it more extendable as user might introduce other optional fields in extra for non-deployment purpose (e.g. referencing conn_id).
{
"jdk-17": {
"classpath": "airflow.sdk.coordinators.java.JavaCoordinator",
"kwargs": {"java_executable": "/usr/lib/jvm/java-17-openjdk/bin/java", "jvm_args": ["-Xmx1024m"]},
"extra": {"pod_template_file": "/opt/airflow/pod_templates/java.yaml"}
}
}
  1. An optional pod_template_file field at first level -- Cons: coupling the optional / provider-level field at first level, needs coordinator code change for every new field.
{
"jdk-17": {
"classpath": "airflow.sdk.coordinators.java.JavaCoordinator",
"kwargs": {"java_executable": "/usr/lib/jvm/java-17-openjdk/bin/java", "jvm_args": ["-Xmx1024m"]},
"pod_template_file": "/opt/airflow/pod_templates/java.yaml"
}
}
  1. An optional pod_template_file in kwargs level -- Same cons as point 2.
{
"jdk-17": {
"classpath": "airflow.sdk.coordinators.java.JavaCoordinator",
"kwargs": {
"java_executable": "/usr/lib/jvm/java-17-openjdk/bin/java",
"jvm_args": ["-Xmx1024m"],
"pod_template_file": "/opt/airflow/pod_templates/java.yaml"
},
}
}
  1. A fully decouple config setup -- AIRFLOW__KUBERNETES__COORDINATOR_TO_POD_TEMPLATE_FILE
AIRFLOW__SDK__COORDINATORS='{"jdk-17": {"classpath": "airflow.sdk.coordinators.java.JavaCoordinator", "kwargs": {"jars_root": ["/files/java-bundles"]}}}'
AIRFLOW__SDK__QUEUE_TO_COORDINATOR='{"java": "jdk-17"}'
AIRFLOW__KUBERNETES__COORDINATOR_TO_POD_TEMPLATE_FILE='{"jdk-17": "/opt/airflow/pod_templates/java.yaml"}'

The cons is quite obvious, user have to understand the queue -> coordinator -> pod_template relationship to setup the Multi-Lang with KubernetesExecutor properly. IMO, it's a too complicated, and it's fine to store the optional metadata in core level config but parsing the optional info at provider level.

What

  • Add an extra field to _CoordinatorSpec (kept separate from kwargs) and CoordinatorManager.extra_for_queue.
    • The CoordinatorManager.extra_for_queue method will not instantiate the coordinator instance.

Next


Was generative AI tooling used to co-author this PR?

@jason810496jason810496 self-assigned this Jun 18, 2026
@jason810496jason810496 added area:coordinator Coordinator: The interface to spawn Lang-SDK subprocesses affected_version:3.3 Use this label to add issues found during 3.3.0 testing labels Jun 18, 2026
@jason810496jason810496 added this to the Airflow 3.3.0 milestone Jun 18, 2026
@jason810496
jason810496 marked this pull request as ready for review June 18, 2026 03:48
@jason810496
jason810496force-pushed the feature/lang-sdk/coordinator-pod-template-file branch from 0d27857 to 009f333CompareJune 18, 2026 05:59
@jason810496
jason810496force-pushed the feature/lang-sdk/coordinator-pod-template-file branch from 009f333 to e954c5bCompareJune 18, 2026 08:54
@jason810496
jason810496force-pushed the feature/lang-sdk/coordinator-pod-template-file branch from e954c5b to 28b4033CompareJune 18, 2026 12:08
@jason810496jason810496 removed area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues labels Jun 19, 2026
@jason810496
jason810496force-pushed the feature/lang-sdk/coordinator-pod-template-file branch from 28b4033 to 7df6d3bCompareJune 19, 2026 05:04
@jason810496jason810496 added the backport-to-v3-3-test Backport to v3-3-test label Jun 22, 2026
@jason810496

Copy link
Copy Markdown
MemberAuthor

Hi all,
Would appreciate review on this one to get in beta2 when you have a moment, thanks.

@jason810496
jason810496force-pushed the feature/lang-sdk/coordinator-pod-template-file branch from 7df6d3b to d8d6f47CompareJune 22, 2026 10:35
Comment threadairflow-core/src/airflow/config_templates/config.yml Outdated
Comment threadtask-sdk/tests/task_sdk/execution_time/test_coordinator.py Outdated
Coordinator config entries need a place to carry deployment metadata that
other components consume without coupling it to the coordinator instance.
The coordinator itself never receives this metadata; components such as
KubernetesExecutor read it by queue when launching worker pods.
@jason810496
jason810496force-pushed the feature/lang-sdk/coordinator-pod-template-file branch from d8d6f47 to 0477d7aCompareJune 22, 2026 12:04
@jason810496

Copy link
Copy Markdown
MemberAuthor

The Mypy provider CI failure is not related so I will merge this.

@jason810496
jason810496 merged commit 4824280 into apache:mainJun 22, 2026
99 of 100 checks passed
@github-project-automationgithub-project-automationBot moved this from Backlog to Done in Java-SDKJun 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

StatusBranchResult
v3-3-testPR Link

cetingokhan pushed a commit to cetingokhan/airflow that referenced this pull request Jun 24, 2026
* Add optional extra metadata to lang-SDK coordinator config entries
Coordinator config entries need a place to carry deployment metadata that
other components consume without coupling it to the coordinator instance.
The coordinator itself never receives this metadata; components such as
KubernetesExecutor read it by queue when launching worker pods.
* Address Wei's comment
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affected_version:3.3Use this label to add issues found during 3.3.0 testingarea:ConfigTemplatesarea:coordinatorCoordinator: The interface to spawn Lang-SDK subprocessesarea:task-sdkbackport-to-v3-3-testBackport to v3-3-testkind:documentation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants

@jason810496@Lee-W@phanikumv