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

Skip Task resource accounting for Fargate 1.3.0 launch type #3896

Merged
merged 4 commits into from
Sep 11, 2023

Conversation

prateekchaudhry
Copy link
Contributor

@prateekchaudhry prateekchaudhry commented Sep 11, 2023

Summary

ECS backend resource accounting can be different for Fargate (1.3.0) than for ECS/EC2 or ECS-Anywhere. This can cause issues with task resource accounting in ECS Agent, if it is not in sync with backend accounting. This behavior can be turned off for Fargate tasks and all resource availability can be delegated to Fargate backend instead.

Implementation details

  • ACS Payload has field LaunchType which takes value FARGATE for Fargate tasks. For such tasks, do not queue them up and launch them up straightaway. Their resources never get accounted in HostResourceManager.
  • HostResourceManager release resources is not a problem as it is an idempotent release. If a task does not exist in HostResourceManager's accounting, this operation will be a no-op.

Testing

  • Added Integ tests to validate HostResourceManager still consumes resources for non fargate tasks, and does not consume resources for fargate tasks
  • Manual testing
    Both EC2 and External -
    • Queued 1 task after the other, enough memory available for 2nd task

      • 2nd task starts without waiting for 1st task to stopped
    • Queued 1 task, Stopped it with stop timeout of 30s, started new task with conflicted resource (CPU)

      • 2nd task starts after 1st task goes to stopped

New tests cover the changes:
Yes

Description for the changelog

Skip Task resource accounting for Fargate 1.3.0 launch type

Licensing

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

agent/engine/engine_unix_integ_test.go Show resolved Hide resolved
agent/engine/engine_unix_integ_test.go Outdated Show resolved Hide resolved
agent/engine/engine_unix_integ_test.go Outdated Show resolved Hide resolved
agent/engine/engine_unix_integ_test.go Outdated Show resolved Hide resolved
yinyic
yinyic previously approved these changes Sep 11, 2023
amogh09
amogh09 previously approved these changes Sep 11, 2023
@prateekchaudhry prateekchaudhry merged commit bec656e into aws:dev Sep 11, 2023
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants