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

Add integ tests for task accounting #3741

Conversation

prateekchaudhry
Copy link
Contributor

@prateekchaudhry prateekchaudhry commented Jun 8, 2023

Summary

This PR adds integ tests for task resource accounting

  • TestHostResourceManagerTrickleQueue - This test covers the task queuing, waiting and dequeuing behavior based on resource availability for tasks. Tasks are scheduled one after the other with small time gaps, and behavior of expected events verified.
  • TestHostResourceManagerResourceUtilization - This test verifies that new tasks get queued up and dequeued immediately if resources are available, and do not wait for already STOPPING tasks (knownStatus=RUNNING/desiredStatus=STOPPED) to go to STOPPED - which was the previous behavior with task serialization. A task is scheduled and stopped such that it goes into (knownStatus=RUNNING/desiredStatus=STOPPED) state using trap handler for SIGTERM. Then a new task is started and behavior is verified.

Also made some comment clarification and added some details about task queuing and reconciliation

Testing

Verified that new introduced tests succeed

Related PRs

Related Containers Roadmap Issue

aws/containers-roadmap#325

Description for the changelog

Add integ tests for task accounting

Licensing

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

@prateekchaudhry prateekchaudhry requested a review from a team as a code owner June 8, 2023 18:21
@prateekchaudhry prateekchaudhry force-pushed the taskAccountingIntegTests branch from 355c306 to aba476f Compare June 8, 2023 18:31
@prateekchaudhry prateekchaudhry force-pushed the taskAccountingIntegTests branch 2 times, most recently from 29164ed to bb70e50 Compare June 8, 2023 19:13
@prateekchaudhry prateekchaudhry force-pushed the taskAccountingIntegTests branch from bb70e50 to dbb57e1 Compare June 8, 2023 20:47
@@ -109,7 +109,6 @@ func TestPostUnmarshalWindowsCanonicalPaths(t *testing.T) {
},
},
},
StartSequenceNumber: 42,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This field has been removed as part of #3723

@@ -36,7 +36,7 @@ func TestLoadsDataForGMSATask(t *testing.T) {
defer cleanup()

cfg := &config.Config{DataDir: filepath.Join(".", "testdata", "v26", "gmsa")}
taskEngine := engine.NewTaskEngine(&config.Config{}, nil, nil, nil, nil, dockerstate.NewTaskEngineState(), nil, nil, nil, nil)
taskEngine := engine.NewTaskEngine(&config.Config{}, nil, nil, nil, nil, nil, dockerstate.NewTaskEngineState(), nil, nil, nil, nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The signature here changed as part of #3684

@prateekchaudhry prateekchaudhry merged commit 1dcc5e5 into aws:feature/task-resource-accounting Jun 9, 2023
@prateekchaudhry prateekchaudhry mentioned this pull request Jun 22, 2023
sparrc added a commit to sparrc/amazon-ecs-agent that referenced this pull request Jun 30, 2023
sparrc added a commit that referenced this pull request Jul 5, 2023
prateekchaudhry added a commit to prateekchaudhry/amazon-ecs-agent that referenced this pull request Jul 12, 2023
prateekchaudhry added a commit that referenced this pull request Jul 12, 2023
* Revert "Revert "host resource manager initialization""

This reverts commit dafb967.

* Revert "Revert "Add method to get host resources reserved for a task (#3706)""

This reverts commit 8d824db.

* Revert "Revert "Add host resource manager methods (#3700)""

This reverts commit bec1303.

* Revert "Revert "Remove task serialization and use host resource manager for task resources (#3723)""

This reverts commit cb54139.

* Revert "Revert "add integ tests for task accounting (#3741)""

This reverts commit 61ad010.

* Revert "Revert "Change reconcile/container update order on init and waitForHostResources/emitCurrentStatus order (#3747)""

This reverts commit 60a3f42.

* Revert "Revert "Dont consume host resources for tasks getting STOPPED while waiting in waitingTasksQueue (#3750)""

This reverts commit 8943792.
Realmonia pushed a commit that referenced this pull request Jul 20, 2023
* Revert reverted changes for task resource accounting (#3796)

* Revert "Revert "host resource manager initialization""

This reverts commit dafb967.

* Revert "Revert "Add method to get host resources reserved for a task (#3706)""

This reverts commit 8d824db.

* Revert "Revert "Add host resource manager methods (#3700)""

This reverts commit bec1303.

* Revert "Revert "Remove task serialization and use host resource manager for task resources (#3723)""

This reverts commit cb54139.

* Revert "Revert "add integ tests for task accounting (#3741)""

This reverts commit 61ad010.

* Revert "Revert "Change reconcile/container update order on init and waitForHostResources/emitCurrentStatus order (#3747)""

This reverts commit 60a3f42.

* Revert "Revert "Dont consume host resources for tasks getting STOPPED while waiting in waitingTasksQueue (#3750)""

This reverts commit 8943792.

* fix memory resource accounting for multiple containers in single task (#3782)

* fix memory resource accounting for multiple containers

* change unit tests for multiple containers, add unit test for awsvpc
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