You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/03/29 15:04:12 UTC

[GitHub] [airflow] Mokubyow edited a comment on issue #14327: Kubernetes Objects are not serializable and break Graph View in UI

Mokubyow edited a comment on issue #14327:
URL: https://github.com/apache/airflow/issues/14327#issuecomment-808497582


   Just wanted to chime in here since I had the same exact issue. I found the issue was only present when using the deprecated executor_config format. When I upgraded to using the pod_override with the k8s models my graph view was able to render. So it appears to be due to something in the backward compatibility process. Example:
   
   **Broken...**
   ```
   PythonOperator(
       task_id=f"sync_{table_name}",
       python_callable=sync_table,
       provide_context=True,
       op_kwargs={"table_name": table_name},
       executor_config={"KubernetesExecutor": {"request_cpu": "1"}},
       retries=5,
       dag=dag,
   )
   ```
   
   
   **Works!**
   ```
   PythonOperator(
       task_id=f"sync_{table_name}",
       python_callable=sync_table,
       provide_context=True,
       op_kwargs={"table_name": table_name},
       executor_config={
           "pod_override": k8s.V1Pod(
               spec=k8s.V1PodSpec(
                   containers=[
                       k8s.V1Container(
                           name="base",
                           resources=k8s.V1ResourceRequirements(requests={"cpu": "1"}),
                       )
                   ]
               )
           )
       },
       retries=5,
       dag=dag,
   )
   ```


-- 
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:
users@infra.apache.org