-
Notifications
You must be signed in to change notification settings - Fork 39
Support capacity provider strategy in task run request #312
Support capacity provider strategy in task run request #312
Conversation
… the run request template
Apologies for the delay on this, I have not had time to test it. Will try to do so ASAP |
Looking forward to this, thank you @kaaloo! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Apologies for the delay in the review. Approved barring any necessary changes to make to pass CI.
- It seems you might have a different black config:
https://github.com/PrefectHQ/prefect-aws/actions/runs/6173273421/job/17051020965?pr=312 - Additionally it seems like the test is failing:
https://github.com/PrefectHQ/prefect-aws/actions/runs/6173273411/job/17051021768?pr=312
Hello @jakekaplan , I updated my PR. Could you please approve running the workflows? |
Hey it looks like the tests are still failing unfortunately. If you're able to fix that would be great! I can try and take a look myself if I have sometime. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kaaloo Thank you again for putting in this PR! Just suggested a couple of changes that should fix the linting issues and a question about the test you've implemented.
task = describe_task(ecs_client, task_arn) | ||
assert task.get("capacityProviderName") == "FOO" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like the right approach but the tests are failing saying that capacityProviderName
is None. Maybe it's not a value that's mocked correctly? The value is supposed to be there according to the spec. Perhaps it's not coming through because it's not one of the accepted values? @kaaloo was the rest passing for you locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to chime in here and see that mock ecs cluster is defined here without capacity provider created. That might be the issue that it's None here in this test case.
Formatting fix Co-authored-by: Emil Christensen <EmilRex@users.noreply.github.com>
Formatting fix Co-authored-by: Emil Christensen <EmilRex@users.noreply.github.com>
Formatting fix Co-authored-by: Emil Christensen <EmilRex@users.noreply.github.com>
Thank you for your willingness to contribute to prefect-aws! The code for this library has been moved to https://github.com/PrefectHQ/prefect/tree/main/src/integrations/prefect-aws. Please reopen this PR there if this functionality is still needed! |
This PR allows setting a
capacityProviderStrategy
in thetask_run_request
part of an ECS Task template. It works by checking for thecapacityProviderStrategy
key when preparing the run request and dropping thelaunchType
key since these are mutually exclusive. See:https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#ECS-RunTask-request-capacityProviderStrategy
Closes PrefectHQ/prefect#13030
Example
The following Gist illustrates an AWS Push Work Pool template that has been modified to include a new
capacityProvider
variable, which is then used in thecapacityProviderStrategy
section of thetask_run_template
.Screenshots
Checklist
pre-commit
checks.pre-commit install && pre-commit run --all
locally for formatting and linting.mkdocs serve
view documentation locally.