airflow.providers.cncf.kubernetes.executors.local_kubernetes_executor
¶
Module Contents¶
Classes¶
Chooses between LocalExecutor and KubernetesExecutor based on the queue defined on the task. |
- class airflow.providers.cncf.kubernetes.executors.local_kubernetes_executor.LocalKubernetesExecutor(local_executor, kubernetes_executor)[source]¶
Bases:
airflow.utils.log.logging_mixin.LoggingMixin
Chooses between LocalExecutor and KubernetesExecutor 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.- property queued_tasks: dict[airflow.models.taskinstance.TaskInstanceKey, airflow.executors.base_executor.QueuedTaskInstanceType][source]¶
Return queued tasks from local and kubernetes executor.
- property running: set[airflow.models.taskinstance.TaskInstanceKey][source]¶
Return running tasks from local and kubernetes executor.
- property job_id: str | None[source]¶
Inherited attribute from BaseExecutor.
Since this is not really an executor, but a wrapper of executors we implemented it as property, so we can have custom setter.
- 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, wait_for_past_depends_before_skipping=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]¶
Check 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
- get_event_buffer(dag_ids=None)[source]¶
Return and flush the event buffer from local and kubernetes executor.
- 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
Sequence[airflow.models.taskinstance.TaskInstance]