davlum commented on a change in pull request #6230: [AIRFLOW-5413] Allow K8S
worker pod to be configured from JSON/YAML file
URL: https://github.com/apache/airflow/pull/6230#discussion_r357398414
##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -402,22 +405,30 @@ def run_next(self, next_job: KubernetesJobType) -> None:
status
"""
self.log.info('Kubernetes job is %s', str(next_job))
+
key, command, kube_executor_config = next_job
dag_id, task_id, execution_date, try_number = key
- config_pod = self.worker_configuration.make_pod(
- namespace=self.namespace,
- worker_uuid=self.worker_uuid,
- pod_id=self._create_pod_id(dag_id, task_id),
- dag_id=self._make_safe_label_value(dag_id),
- task_id=self._make_safe_label_value(task_id),
+ safe_dag_id = AirflowKubernetesScheduler._make_safe_label_value(dag_id)
+ safe_task_id =
AirflowKubernetesScheduler._make_safe_label_value(task_id)
+ safe_date =
AirflowKubernetesScheduler._datetime_to_label_safe_datestring(execution_date)
+ safe_pod_id = AirflowKubernetesScheduler._create_pod_id(dag_id,
task_id)
+
+ if isinstance(command, str):
+ command = [command]
+
+ pod = PodGenerator.construct_pod(
+ dag_id=safe_dag_id,
+ task_id=safe_task_id,
Review comment:
I agree with this 100%. Currently the `AirflowKubernetesScheduler` has a
decent amount of validation logic that should live inside the `PodGenerator`.
Do you want me to include that in this PR?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services