dacort commented on code in PR #34225:
URL: https://github.com/apache/airflow/pull/34225#discussion_r1447950174
##########
airflow/providers/amazon/aws/links/emr.py:
##########
@@ -66,3 +82,98 @@ def get_log_uri(
return None
log_uri = S3Hook.parse_s3_url(cluster_info["LogUri"])
return "/".join(log_uri)
+
+
+class EmrServerlessLogsLink(BaseAwsLink):
+ """Helper class for constructing Amazon EMR Serverless Logs Link."""
+
+ name = "Spark Driver stdout"
+ key = "emr_serverless_logs"
+
+ def get_link(
+ self,
+ operator: BaseOperator,
+ *,
+ ti_key: TaskInstanceKey,
+ ) -> str:
+ """
+ Link to Amazon Web Services Console.
+
+ :param operator: airflow operator
+ :param ti_key: TaskInstance ID to return link for
+ :return: link to external system
+ """
+ conf = XCom.get_value(key=self.key, ti_key=ti_key)
+ if not conf:
+ return ""
+ hook = EmrServerlessHook(aws_conn_id=conf.get("conn_id"))
+ resp = hook.conn.get_dashboard_for_job_run(
+ applicationId=conf.get("application_id"),
jobRunId=conf.get("job_run_id")
+ )
+ o = urlparse(resp["url"])
+ return o._replace(path="/logs/SPARK_DRIVER/stdout.gz").geturl()
Review Comment:
Yes, the rest of the Details dialogue is still usable. It's just the "Extra
Links" section that doesn't populate (see below for before and after).
Unfortunately it takes about 8-12s for the call to `extra_links` to timeout.
In testing, the first failed call usually fails around 7-8s and then second
fails after 10-12s.
Before:
<img width="672" alt="image"
src="https://github.com/apache/airflow/assets/1512/937851b2-c7e0-4357-ab3d-84fe041ffb46">
After:
<img width="660" alt="image"
src="https://github.com/apache/airflow/assets/1512/8b12dc0f-d0d8-43e6-9644-7875c9294a30">
--
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]