Taragolis commented on code in PR #29522:
URL: https://github.com/apache/airflow/pull/29522#discussion_r1115852717


##########
airflow/providers/amazon/aws/hooks/batch_client.py:
##########
@@ -419,8 +419,46 @@ def get_job_awslogs_info(self, job_id: str) -> dict[str, 
str] | None:
 
         :param job_id: AWS Batch Job ID
         """
-        job_container_desc = 
self.get_job_description(job_id=job_id).get("container", {})
-        log_configuration = job_container_desc.get("logConfiguration", {})
+        job_desc = self.get_job_description(job_id=job_id)

Review Comment:
   Let me add a bit more context what going on here initially.
   Because everything executed outside of the Airflow users do not have any 
information about logs in AWS Batch.
   
   For regular batch job we have 0 or 1 dict information about Cloudwatch: log 
group, region name, log stream.
   This information mainly for generate [operator extra 
link](https://airflow.apache.org/docs/apache-airflow/stable/howto/define_extra_link.html)
 which is visible int the UI
   
   **Grid View**
   
![image](https://user-images.githubusercontent.com/3998685/220949109-54fcdd3d-1c7a-4198-8f19-e7aa7309e0e9.png)
   
   **Graph View**
   
![image](https://user-images.githubusercontent.com/3998685/220948964-31d45127-210c-4444-bcc4-8a288563ef8c.png)
   
   Right now 0 could be in different situations:
   1. User doesn't use Cloudwatch
   2. This is Array Job
   3. For some reason AWS API do not return Cloudwatch link, I personally do 
not have this situation, but potentially this could happen if JOB finished very 
quick. That also the reason why we check this in the end of operator execution.
   
   If user use nodeProperties, than jobs would run in multiple places and there 
is 0..many, in this case we cant utilise Operator Extra Link, so better we 
could do here is print all links to cloudwatch in Airflow log, but with current 
implementation the only one would be returned.



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