airflow.executors.local_kubernetes_executor

Module Contents

Classes

LocalKubernetesExecutor

LocalKubernetesExecutor consists of LocalExecutor and KubernetesExecutor.

class airflow.executors.local_kubernetes_executor.LocalKubernetesExecutor(local_executor, kubernetes_executor)[source]

Bases: airflow.utils.log.logging_mixin.LoggingMixin

LocalKubernetesExecutor consists of LocalExecutor and KubernetesExecutor. It chooses the executor to use based on the queue defined on the task. When the task’s queue is the value of kubernetes_queue in section [local_kubernetes_executor] of the configuration (default value: kubernetes), KubernetesExecutor is selected to run the task, otherwise, LocalExecutor is used.

supports_ad_hoc_ti_run :bool = True[source]
callback_sink :BaseCallbackSink | None[source]
KUBERNETES_QUEUE[source]
property queued_tasks[source]

Return queued tasks from local and kubernetes executor

property running[source]

Return running tasks from local and kubernetes executor

property job_id[source]

This is a class attribute in BaseExecutor but since this is not really an executor, but a wrapper of executors we implement as property so we can have custom setter.

start()[source]
property slots_available[source]

Number of new tasks this executor instance can accept

queue_command(task_instance, command, priority=1, queue=None)[source]

Queues command via local or kubernetes executor

queue_task_instance(task_instance, mark_success=False, pickle_id=None, ignore_all_deps=False, ignore_depends_on_past=False, ignore_task_deps=False, ignore_ti_state=False, pool=None, cfg_path=None)[source]

Queues task instance via local or kubernetes executor

has_task(task_instance)[source]

Checks if a task is either queued or running in either local or kubernetes executor.

Parameters

task_instance (airflow.models.taskinstance.TaskInstance) – TaskInstance

Returns

True if the task is known to this executor

Return type

bool

heartbeat()[source]

Heartbeat sent to trigger new jobs in local and kubernetes executor

get_event_buffer(dag_ids=None)[source]

Returns and flush the event buffer from local and kubernetes executor

Parameters

dag_ids (list[str] | None) – dag_ids to return events for, if None returns all

Returns

a dict of events

Return type

dict[airflow.models.taskinstance.TaskInstanceKey, airflow.executors.base_executor.EventBufferValueType]

try_adopt_task_instances(tis)[source]

Try to adopt running task instances that have been abandoned by a SchedulerJob dying.

Anything that is not adopted will be cleared by the scheduler (and then become eligible for re-scheduling)

Returns

any TaskInstances that were unable to be adopted

Return type

list[airflow.models.TaskInstance]

end()[source]

End local and kubernetes executor

terminate()[source]

Terminate local and kubernetes executor

debug_dump()[source]

Called in response to SIGUSR2 by the scheduler

send_callback(request)[source]

Sends callback for execution.

Parameters

request (airflow.callbacks.callback_requests.CallbackRequest) – Callback request to be executed.

Was this entry helpful?