jscheffl commented on code in PR #40901:
URL: https://github.com/apache/airflow/pull/40901#discussion_r1685475837


##########
airflow/api_internal/internal_api_call.py:
##########
@@ -75,10 +88,13 @@ def _init_values():
             raise RuntimeError("The AIP_44 is not enabled so you cannot use 
it.")
         internal_api_endpoint = ""
         if use_internal_api:
-            internal_api_url = conf.get("core", "internal_api_url")
-            internal_api_endpoint = internal_api_url + 
"/internal_api/v1/rpcapi"
-            if not internal_api_endpoint.startswith("http://";):
-                raise AirflowConfigException("[core]internal_api_url must 
start with http://";)
+            url_conf = urlparse(conf.get("core", "internal_api_url"))
+            api_path = url_conf.path
+            if len(api_path) < 2:
+                api_path = "/internal_api/v1/rpcapi"

Review Comment:
   The internal API endpopint is pre-defined by the path 
`/internal_api/v1/rpcapi` which on current main is always added to the defined 
api-endpoint from the config.
   
   The Remote worker also uses for task execution and communication the same 
infrastructure - just the back-end is hosted on URL `/remote_worker/v1/rpcapi` 
(see WIP in 
https://github.com/apache/airflow/pull/40900/files#diff-5fb7e8d1b04e10947ebd11fdba06820f44cac02f2f36ad97b5964cf0273b05cfR69)
 - Assumption is that (1) the remote worker needs some additional methods for 
the scheduler/worker communication and (2) that the internal API URL 
might/should not be exposed to the internet but just hosted as internal 
endpoint. Maybe even separating internal and external access endpoints with 
additional security perimeters.
   
   Is that okay? SHall I leave some comment in the code for this?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to