Skip to content

Conversation

@o-nikolas
Copy link
Contributor

@o-nikolas o-nikolas commented Mar 28, 2025

Summary

Follows the paradigm used in the k8s executor except the serialized workload is passed along as string instead of a file, since there is no (easy) way to plumb a file into the ECS container at run time.

In the future using a secret to pass along the workload could be another possible approach, but this requires the use of another cloud service (i.e. Secret Manager or Parameter Store).

Testing

I tested the ECS executor and execute_workload changes in combination and everything is passing green.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@vincbeck
Copy link
Contributor

Closing and re-opening to run test (they somehow did not run)

@vincbeck vincbeck closed this Mar 31, 2025
@vincbeck vincbeck reopened this Mar 31, 2025
Copy link
Contributor

@vincbeck vincbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good! Good job with figuring out all these things. Two questions:

  • Can we add unit tests? ECS executor changes are not tested
  • It looks like it is but just double checking. With these changes, is ECS executor still compatible with AF2?

@o-nikolas
Copy link
Contributor Author

Overall looks good! Good job with figuring out all these things. Two questions:

* Can we add unit tests? ECS executor changes are not tested

Sure, I can look at adding some. But most all of the actual behaviour of the executor itself hasn't changed. Just the interface to it (which should honestly be tested by the base executor once all this stuff moves into that class). But I'll look at adding a few.

* It looks like it is but just double checking. With these changes, is ECS executor still compatible with AF2?

Yupp it should be still working with AF2, I can do a manual test to verify 👍

@o-nikolas
Copy link
Contributor Author

Follow up on this:

Overall looks good! Good job with figuring out all these things. Two questions:

* Can we add unit tests? ECS executor changes are not tested

Sure, I can look at adding some. But most all of the actual behaviour of the executor itself hasn't changed. Just the interface to it (which should honestly be tested by the base executor once all this stuff moves into that class). But I'll look at adding a few.

Unit test added! It pretty comprehensively tests the task SDK path beginning to end. Let me know what you think!

* It looks like it is but just double checking. With these changes, is ECS executor still compatible with AF2?

Yupp it should be still working with AF2, I can do a manual test to verify 👍

Manually setup a repro with AF2 and the current executor, everything works as expected!

@o-nikolas
Copy link
Contributor Author

CC @ashb @amoghrajesh

Copy link
Contributor

@vincbeck vincbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@o-nikolas thanks, your changes mostly look good. Some comments

Follows the paradigm used in the k8s executor except the serialized
workload is passed along as string instead of a file, since there
is no (easy) way to plumb a file into the ECS container at run time.

In the future using a secret to pass along the workload could be
another possible approach, but this requires the use of another
cloud service (i.e. Secret Manager or Parameter Store).
@o-nikolas o-nikolas force-pushed the onikolas/ecs_exec_task_sdk branch from a8154dd to 9f65a6f Compare April 4, 2025 21:48
@o-nikolas o-nikolas force-pushed the onikolas/ecs_exec_task_sdk branch from 9f65a6f to 9ca3c45 Compare April 4, 2025 21:58
@o-nikolas o-nikolas merged commit 8e8c84f into apache:main Apr 7, 2025
76 checks passed
@o-nikolas o-nikolas deleted the onikolas/ecs_exec_task_sdk branch April 7, 2025 16:03
simonprydden pushed a commit to simonprydden/airflow that referenced this pull request Apr 8, 2025
* Update ECS executor to support Task SDK

Follows the paradigm used in the k8s executor except the serialized
workload is passed along as string instead of a file, since there
is no (easy) way to plumb a file into the ECS container at run time.

In the future using a secret to pass along the workload could be
another possible approach, but this requires the use of another
cloud service (i.e. Secret Manager or Parameter Store).

* Add unit test to test task sdk path

* Small fix in arg ordering

* Only import within Airflow 3 scope for back compat tests

* fixes from PR review
@o-nikolas o-nikolas added the aws-ecs-executor Changes related to the AWS ECS Executor label Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers area:task-sdk aws-ecs-executor Changes related to the AWS ECS Executor provider:amazon AWS/Amazon - related issues provider:cncf-kubernetes Kubernetes (k8s) provider related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants