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 2020/11/06 14:29:12 UTC

[GitHub] [airflow] potiuk commented on a change in pull request #11815: Render k8s yaml for tasks via the Airflow UI

potiuk commented on a change in pull request #11815:
URL: https://github.com/apache/airflow/pull/11815#discussion_r518785922



##########
File path: airflow/utils/helpers.py
##########
@@ -202,3 +203,9 @@ def cross_downstream(*args, **kwargs):
         stacklevel=2,
     )
     return import_string('airflow.models.baseoperator.cross_downstream')(*args, **kwargs)
+
+
+def is_k8s_or_k8scelery_executor() -> bool:
+    """Determines if the executor utilizes k8s."""
+    conf_executor = conf.get('core', 'EXECUTOR')
+    return conf_executor in {'KubernetesExecutor', 'CeleryKubernetesExecutor'}

Review comment:
       Can you tlell what were the circular imports. Usually (not always) circular imports can be resolved via applying single responsibility principle and splitting out or joining certain classes. 
   
   Usually, I solve them in the way that I put closely coupled classes together - in a single module, but those classes that are not coupled in separate modules and make sure one those modules do not import each other. Sometimes (and usually it results in a cleaner architecture and better "single responsibility principle" application) it results in having to add some kind of mediator between those classes. 
   
   However in this case we have a big architectural problem as the "conf" module (which should be merely an util) pulls in half of the airlfow (because it is not designed well to be "just conf"). I tried several times to untangle it with varying level of success, and I am afraid it might be difficult to solve. It's rather difficult and result of historical way of implementing the conf class. I think we should finally solve it at some point in time, but this is quite an effort as it ripples through half of the code of airflow (which is bad IMHO but we have to leave with it until we fix it).
   




----------------------------------------------------------------
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