Skip to content

Support extra field for Coordinator #68694

Open
jason810496 wants to merge 1 commit into
apache:mainfrom
jason810496:feature/lang-sdk/coordinator-pod-template-file
Open

Support extra field for Coordinator #68694
jason810496 wants to merge 1 commit into
apache:mainfrom
jason810496:feature/lang-sdk/coordinator-pod-template-file

Conversation

@jason810496

@jason810496 jason810496 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?

@jason810496 jason810496 self-assigned this Jun 18, 2026
@jason810496 jason810496 added AIP-108: Coordinator Change this to an 'area:' label after AIP acceptance. affected_version:3.3.0beta Use this label to add issues found during 3.3.0 testing labels Jun 18, 2026
@jason810496 jason810496 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 jason810496 force-pushed the feature/lang-sdk/coordinator-pod-template-file branch from 0d27857 to 009f333 Compare June 18, 2026 05:59
@jason810496 jason810496 force-pushed the feature/lang-sdk/coordinator-pod-template-file branch from 009f333 to e954c5b Compare June 18, 2026 08:54
@jason810496 jason810496 force-pushed the feature/lang-sdk/coordinator-pod-template-file branch from e954c5b to 28b4033 Compare June 18, 2026 12:08
@jason810496 jason810496 requested a review from phanikumv June 19, 2026 04:42
@jason810496 jason810496 removed area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues labels Jun 19, 2026
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 jason810496 force-pushed the feature/lang-sdk/coordinator-pod-template-file branch from 28b4033 to 7df6d3b Compare June 19, 2026 05:04
Comment thread airflow-core/docs/authoring-and-scheduling/language-sdks/index.rst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affected_version:3.3.0beta Use this label to add issues found during 3.3.0 testing AIP-108: Coordinator Change this to an 'area:' label after AIP acceptance. area:ConfigTemplates area:task-sdk kind:documentation

Development

Successfully merging this pull request may close these issues.

2 participants