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

feat(stepfunctions-tasks): add cpu and memory parameters to EcsRunTask #30140

Merged
merged 17 commits into from
Aug 23, 2024

Conversation

kackyt
Copy link
Contributor

@kackyt kackyt commented May 10, 2024

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


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team May 10, 2024 04:20
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 labels May 10, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@kackyt kackyt changed the title feat(aws-stepfunctions-tasks): add cpu and memory parameters to EcsRunTask feat(stepfunctions-tasks): add cpu and memory parameters to EcsRunTask May 10, 2024
@kackyt kackyt force-pushed the add-cpu-and-memory-parameters branch from e56c7d9 to 6c74ef8 Compare May 10, 2024 04:38
@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@kackyt kackyt force-pushed the add-cpu-and-memory-parameters branch from 3f2da80 to 2431e4c Compare June 4, 2024 12:32
@aws-cdk-automation aws-cdk-automation dismissed their stale review June 4, 2024 12:33

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 5, 2024
@aws-cdk-automation
Copy link
Collaborator

This PR has been in the MERGE CONFLICTS state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@kackyt
Copy link
Contributor Author

kackyt commented Jul 1, 2024

Review please!

@pahud
Copy link
Contributor

pahud commented Jul 30, 2024

Hi

This PR has been pending for community review for a while. Please consider posting it on the #contributing channel in cdk.dev. Community members will be on the lookout there as well for possible reviews.

Check How to get your P2 PR community reviewed for more details.

Copy link
Contributor

@tmokmss tmokmss left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I left some comments but otherwise LGTM.

Copy link
Contributor

@tmokmss tmokmss left a comment

Choose a reason for hiding this comment

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

To the maintaners: can you confirm the decision made here? Or let us know if there are other options 🙏

@aws-cdk-automation aws-cdk-automation added pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Aug 6, 2024
@shikha372 shikha372 assigned shikha372 and unassigned shikha372 Aug 6, 2024
@shikha372
Copy link
Contributor

Thanks @kackyt for submitting the PR, want to be double sure that we're not adding the functionality that can already be achieved with the help of container override. Could you help in providing a specific use case of ECS run task where this was not working for you. If you've a code snippet that you're using that would help too.

@kackyt
Copy link
Contributor Author

kackyt commented Aug 18, 2024

@shikha372

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.Furthermore, in Fargate Task, this parameter is required to specify the size. We cannot change the size of the Fargate with container override.

@shikha372
Copy link
Contributor

shikha372 commented Aug 20, 2024

Thanks @kackyt, checked the differences with the deployment, i'm not sure i completely agree with statement that it is not supported in Fargate Cluster nor i found any documentation stating that, I see overrides getting populated in the state machine definition for both EC2 and Fargate, let me know if i'm missing something here. Here is the code snippet:

        "TaskDefinition": "ECREc2StackTD10AFFC0F",
        "Overrides": {
          "ContainerOverrides": [
            {
              "Name": "TheContainer",
              "Cpu": 512,
              "Memory": 1024,
              "Environment": [
                {
                  "Name": "SOME_KEY",
                  "Value.$": "$.SomeKey"
                }
              ]
            }
          ]
        },
        "LaunchType": "EC2"
        "Overrides": {
          "ContainerOverrides": [
            {
              "Name": "TheContainer",
              "Cpu": 512,
              "Memory": 1024,
              "Environment": [
                {
                  "Name": "SOME_KEY",
                  "Value.$": "$.SomeKey"
                }
              ]
            }
          ]
        },
        "LaunchType": "FARGATE",
        "PlatformVersion": "1.4.0"

That being said, adding these values help to override the cpu and memory set at task definition level which i don't think exist today, and would review PR for that requirement.

Task override:

        "Overrides": {
          "Cpu": "1024",
          "Memory": "2048",
          "ContainerOverrides": [
            {
              "Name": "TheContainer",
              "Environment": [
                {
                  "Name": "SOME_KEY",
                  "Value.$": "$.SomeKey"
                }
              ]
            }
          ]
        },
        "LaunchType": "FARGATE",

Copy link
Contributor

mergify bot commented Aug 23, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 5d8447e
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 986e378 into aws:main Aug 23, 2024
9 checks passed
Copy link
Contributor

mergify bot commented Aug 23, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

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
@kackyt kackyt deleted the add-cpu-and-memory-parameters branch August 23, 2024 05:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 pr/needs-maintainer-review This PR needs a review from a Core Team Member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-stepfunctions-tasks: Add cpu and memory parameters to EcsRunTask
5 participants