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

aws-stepfunctions-tasks: Add cpu and memory parameters to EcsRunTask #30027

Closed
1 of 2 tasks
kackyt opened this issue May 1, 2024 · 9 comments · Fixed by #30140 · May be fixed by mannjaro/serverless-bedrock-proxy#4
Closed
1 of 2 tasks

aws-stepfunctions-tasks: Add cpu and memory parameters to EcsRunTask #30027

kackyt opened this issue May 1, 2024 · 9 comments · Fixed by #30140 · May be fixed by mannjaro/serverless-bedrock-proxy#4
Labels
@aws-cdk/aws-stepfunctions-tasks effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@kackyt
Copy link
Contributor

kackyt commented May 1, 2024

Describe the feature

Add cpu and memory parameters to EcsRunTask in StepFunctions to allow flexible allocation of Ecs resources according to the situation.

Use Case

This is useful when you want to allocate resources flexibly according to the data set used in EcsTask, or when you want to increase memory when retrying from errors such as OOM.

Proposed Solution

Add cpu and memory parameters to EcsRunTask

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.139.1

Environment details (OS name and version, etc.)

client: macOS,Windows,Linux

@kackyt kackyt added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 1, 2024
@kackyt kackyt changed the title aws-stepfunction-tasks: Add cpu and memory parameters to EcsRunTask aws-stepfunctions-tasks: Add cpu and memory parameters to EcsRunTask May 1, 2024
@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. investigating This issue is being investigated and/or work is in progress to resolve the issue. labels May 1, 2024
@khushail
Copy link
Contributor

khushail commented May 1, 2024

thanks @kackyt for submitting the request and volunteering for PR contribution.

@daschaa
Copy link
Contributor

daschaa commented May 4, 2024

Hi @kackyt - I was looking at this issue and saw that there is the containerOverrides property for the EcsRunTask. With a ContainerOverride it seems that you can override the ephemeralStorage and the cpu for an ecs task. Would this already help you/solve the issue?
For documentation reference see here: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.EcsRunTask.html#containeroverrides

And here for the API reference: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#API_RunTask_RequestSyntax

@kackyt
Copy link
Contributor Author

kackyt commented May 4, 2024

@daschaa
The method to allocate resources by overriding cpu and memory settings in ContainerOverrides is limited to using ec2 instances in ECS, while allocating resources for Fargate is not possible with ContainerOverrides, so I would like to resolve this feature.

@daschaa
Copy link
Contributor

daschaa commented May 5, 2024

@kackyt Thanks for the clarification! I didn‘t knew that. 👍🏼 Do you have a link to some documentation where I can find that information?

@kackyt
Copy link
Contributor Author

kackyt commented May 5, 2024

@daschaa

The task definition reference contains the following link to a description of the Fargate task.

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_size

For tasks that run on Fargate (both Linux and Windows containers), this field is required and you must use one of the following values, which determines your range of supported values for the memory parameter. The table below shows the valid combinations of task-level CPU and memory.

The same applies to EcsRunTask.

@VaidSaraswat
Copy link
Contributor

Hey there I believe was already addressed by this?: 5f59787.

@kackyt
Copy link
Contributor Author

kackyt commented May 7, 2024

@VaidSaraswat
This is a feature request for EcsRunTask cpu and memory field of root parameter, not a containerOverrides issue.

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

1 similar comment
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2024
GavinZZ pushed a commit that referenced this issue Aug 23, 2024
#30140)

### Issue # (if applicable)

Closes #30027 .

### Reason for this change



As described in the issue.

### Description of changes


Add cpu and memoryMiB property to EcsRunTaskProps.

### Description of how you validated changes


Add unit tests.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-stepfunctions-tasks effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
4 participants