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: New param to remove memory limit in invoke #7892

Merged
merged 2 commits into from
Feb 15, 2025

Conversation

valerena
Copy link
Contributor

--no-memory-limit removes the memory limitation in the container during local invoke, even when there's a memory configured in the SAM template.

Which issue(s) does this change fix?

In certain conditions, Docker fails to run when a memory limit is passed: https://stackoverflow.com/questions/70872355/how-to-resolve-cgroup-error-when-running-docker-container-inside-a-docker-contai

Why is this change necessary?

Allow customers to avoid the Docker issue mentioned above

How does it address the issue?

Add a new parameter so the memory limit is not automatically passed from the template.

What side effects does this change have?

None

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • Add input/output type hints to new functions/methods
  • Write design document if needed (Do I need to write a design document?)
  • Write/update unit tests
  • Write/update integration tests
  • Write/update functional tests if needed
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed
  • Write documentation

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

`--no-memory-limit` removes the memory limitation in the container
during local invoke, even when there's a memory configured in the
SAM template.
@valerena valerena requested a review from a team as a code owner February 15, 2025 00:20
@github-actions github-actions bot added area/local/start-api sam local start-api command area/local/invoke sam local invoke command area/local/start-invoke area/schema JSON schema file pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Feb 15, 2025
"--no-memory-limit",
default=False,
is_flag=True,
help="Remove the Memory limit during local invoke. This runs the container without the --memory parameter",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we doing this only for sam local invoke only? I think the issue happens for sam local start-api and sam local start-lambda as well.

The message here is specific to local invoke. Suggesting more generic message:
Remove the memory limit when running Docker container.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. we might need the same for the other commands. I'll update that, also with a generic message.

Copy link
Member

@roger-zhangg roger-zhangg left a comment

Choose a reason for hiding this comment

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

lgtm

@vicheey vicheey added this pull request to the merge queue Feb 15, 2025
Merged via the queue into aws:develop with commit bbcd952 Feb 15, 2025
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/local/invoke sam local invoke command area/local/start-api sam local start-api command area/local/start-invoke area/schema JSON schema file pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants