hunnguye commented on code in PR #71949:
URL: https://github.com/apache/airflow/pull/71949#discussion_r4157255317
##########
providers/apache/spark/src/airflow/providers/apache/spark/hooks/spark_submit.py:
##########
@@ -457,6 +458,17 @@ def _resolve_connection(self) -> dict[str, Any]:
conn_data["keytab"] =
self._create_keytab_path_from_base64_keytab(
base64_keytab, conn_data["principal"]
)
+ # Construct the Standalone Restendpoint
+ if (
+ conn.conn_type == "spark"
+ and conn_data["master"].startswith("spark://")
+ and conn_data["deploy_mode"] == "cluster"
+ and "," not in conn_data["master"] # only consider single
master, non-HA for now
Review Comment:
I think this module has historically grown to only handle single
rest_endpoints. I think, the remaining code for the hook only considers a
single master endpoint and if we want to consistently handle HA, that would
need a bigger refactor (see
https://github.com/apache/airflow/pull/71949#discussion_r3887749823).
Although, I can agree with both you and aaron-y-chen, if I'd introduce
handling HA in this particular place, the hook would feel inconsistant and
maybe confusing to the next contributer.
Regarding your other question:
Custom rest_endpoint altogether as in the master sits at master:7077 but the
rest endpoint sits at rest:6066 or even rest-endpoint (without any specific
port)? Funny you mentioned this, because that is also one of the original issue
we discovered and worked around, until we discovered the polling issue and
decided to open a PR to fix that at least.
I think this is a bit of a dilemma, because the contributors before me
already suggested rest_scheme and rest_port, which somewhat assumes that the
REST endpoint is derived from the master host.
I agree that a fully custom rest_endpoint would be more flexible though.
Jowever I'd prefer to keep this PR focused on the polling issue i originally
diagnosed and set out to fix. If there is a concrete need for fully
customizable endpoints, I think this could be added in a future 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]