Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch Operator: Realtime container execution logs in Airflow task execution log #31675

Closed
1 of 2 tasks
rchui opened this issue Jun 2, 2023 · 4 comments · Fixed by #31837
Closed
1 of 2 tasks

Batch Operator: Realtime container execution logs in Airflow task execution log #31675

rchui opened this issue Jun 2, 2023 · 4 comments · Fixed by #31837
Assignees
Labels

Comments

@rchui
Copy link

rchui commented Jun 2, 2023

Description

Add functionality to Airflow BatchOperator to capture the task execution logs as they happen from AWS CloudWatch to the BatchOperator's task execution logs.

Use case/motivation

When executing Batch tasks via BatchOperator the logs are not readily available in Airflow task during execution; only a link is provided to point to where the logs can be viewed in CloudWatch. As a result one should navigate the task logs in Airflow to get a handle of the container log path in AWS Cloudwatch and then access the log from AWS Cloudwatch in realtime.

The current behavior introduces the following challenge:

The ongoing execution logs are not captured in Airflow task ( BatchOperator ) log. This typically involves couple of additional steps - which can be avoided.

Related issues

This is almost identical to the ECSOperator realtime log streaming that was raised in this issue: #22512. In fact most of the description, use case, and motivation are lifted from that issue.

An EcsTaskLogFetcher class already exists in airflow.providers.amazon.aws.hooks.ecs which AWS Batch can use as a backend. It just needs to be initialized, started, and stopped at the correct time. In the event of an array job, the Batch Operator already defaults to the first task and the same could be done when choosing which log stream to fetch.

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@rchui rchui added kind:feature Feature Requests needs-triage label for new issues that we didn't triage yet labels Jun 2, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Jun 2, 2023

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

@hussein-awala hussein-awala added provider:amazon AWS/Amazon - related issues area:providers good first issue and removed needs-triage label for new issues that we didn't triage yet labels Jun 2, 2023
@potiuk
Copy link
Member

potiuk commented Jun 4, 2023

Sure. Maybe you would like to add it? Just to set the expectations - the thing with OSS project features like that is that they will get implemented if anyone picks interest int them . Just creating an issue makes it visible and when we (as @hussein-awala did ) can mark it as "good first issue" for someone to pick it up, but that's about it. If you would like to see it implemented @rchui , the fastest and most certain way is that you implement it yourself or find someone who will do it for you if you do not have enough skills. Otherwise it might just stick here until someone will find enough interest and skill together to implement ot.

Just to set the expectations.

@killua1zoldyck
Copy link
Contributor

Hello, can I work on this?

@phanikumv
Copy link
Contributor

Assigned it to you @killua1zoldyck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants