-
Notifications
You must be signed in to change notification settings - Fork 619
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
Load Managed Daemon images in background #3984
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fierlion
reviewed
Oct 25, 2023
mye956
reviewed
Oct 25, 2023
sparrc
reviewed
Oct 25, 2023
fierlion
reviewed
Oct 25, 2023
fierlion
previously approved these changes
Oct 25, 2023
mye956
reviewed
Oct 25, 2023
mye956
reviewed
Oct 25, 2023
mye956
previously approved these changes
Oct 25, 2023
mye956
approved these changes
Oct 25, 2023
fierlion
approved these changes
Oct 25, 2023
singholt
added a commit
to singholt/amazon-ecs-agent
that referenced
this pull request
Oct 26, 2023
This reverts commit 75db5cb. 2. Revert "update daemon log path host root in container (aws#3982)" This reverts commit 6166b6e. 3. Revert "Fix loading CSI driver container from state if it exists" This reverts commit 1391502. 4. Revert "Latest FE model files (aws#3974)" This reverts commit b589a08. 5. Revert "Move utils function Uint16SliceToStringSlice to shared lib" This reverts commit 882bcb2. 6. Revert "Move remaining credentials module to shared library" This reverts commit f58f228. 7. Revert "fix merge import failure (aws#3976)" This reverts commit 46e21e6. 8. Revert "Fixing task volumes from payload for EBS-backed tasks" This reverts commit fc97633. 9. Revert "Create Generic Attachment to decouple from ENI and save attachment state. (aws#3969)" This reverts commit 12e23ed. 10. Revert "Add support for finding EBS devices on Xen instances (aws#3971)" This reverts commit 3500ac2. 11. Revert "Add network builder and platform APIs (aws#3939)" This reverts commit b8d2a7f. 12. Revert "Minor refactor of TTL cache (allow nil TTL + get TTL)" This reverts commit 4b33664. 13. Revert "Move httpclient to ecs-agent/ and minor refactor" This reverts commit 041ca3f. 14. Revert "Add missing EBSTaskAttach changes from feature branch" This reverts commit 7a0d116.
singholt
added a commit
to singholt/amazon-ecs-agent
that referenced
this pull request
Oct 26, 2023
1. Revert "Load Managed Daemon images in background (aws#3984)" This reverts commit 75db5cb. 2. Revert "update daemon log path host root in container (aws#3982)" This reverts commit 6166b6e. 3. Revert "Fix loading CSI driver container from state if it exists" This reverts commit 1391502. 4. Revert "Latest FE model files (aws#3974)" This reverts commit b589a08. 5. Revert "Move utils function Uint16SliceToStringSlice to shared lib" This reverts commit 882bcb2. 6. Revert "Move remaining credentials module to shared library" This reverts commit f58f228. 7. Revert "fix merge import failure (aws#3976)" This reverts commit 46e21e6. 8. Revert "Fixing task volumes from payload for EBS-backed tasks" This reverts commit fc97633. 9. Revert "Create Generic Attachment to decouple from ENI and save attachment state. (aws#3969)" This reverts commit 12e23ed. 10. Revert "Add support for finding EBS devices on Xen instances (aws#3971)" This reverts commit 3500ac2. 11. Revert "Add network builder and platform APIs (aws#3939)" This reverts commit b8d2a7f. 12. Revert "Minor refactor of TTL cache (allow nil TTL + get TTL)" This reverts commit 4b33664. 13. Revert "Move httpclient to ecs-agent/ and minor refactor" This reverts commit 041ca3f. 14. Revert "Add missing EBSTaskAttach changes from feature branch" This reverts commit 7a0d116.
singholt
added a commit
that referenced
this pull request
Oct 26, 2023
1. Revert "Load Managed Daemon images in background (#3984)" This reverts commit 75db5cb. 2. Revert "update daemon log path host root in container (#3982)" This reverts commit 6166b6e. 3. Revert "Fix loading CSI driver container from state if it exists" This reverts commit 1391502. 4. Revert "Latest FE model files (#3974)" This reverts commit b589a08. 5. Revert "Move utils function Uint16SliceToStringSlice to shared lib" This reverts commit 882bcb2. 6. Revert "Move remaining credentials module to shared library" This reverts commit f58f228. 7. Revert "fix merge import failure (#3976)" This reverts commit 46e21e6. 8. Revert "Fixing task volumes from payload for EBS-backed tasks" This reverts commit fc97633. 9. Revert "Create Generic Attachment to decouple from ENI and save attachment state. (#3969)" This reverts commit 12e23ed. 10. Revert "Add support for finding EBS devices on Xen instances (#3971)" This reverts commit 3500ac2. 11. Revert "Add network builder and platform APIs (#3939)" This reverts commit b8d2a7f. 12. Revert "Minor refactor of TTL cache (allow nil TTL + get TTL)" This reverts commit 4b33664. 13. Revert "Move httpclient to ecs-agent/ and minor refactor" This reverts commit 041ca3f. 14. Revert "Add missing EBSTaskAttach changes from feature branch" This reverts commit 7a0d116.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Currently Agent loads Managed Daemon images synchronously on startup which causes a delay in startup. This PR addresses the startup delay by making Managed Daemon images load in background.
Behavior changes -
Implementation details
loadManagedDaemonImagesAsync
is added toapp
package. This function loops through all registered Managed Daemons and starts loading the image for each. It adds the image to image cleanup exclusion list on successful image load.imageManager.AddImageToCleanUpExclusionList
method is updated to acquire the struct's RW lock to make the method thread-safe now that it's called concurrently.appendEBSTaskAttachCapabilities
function inapp
package is updated to add EBS Task attach capability based on EBS Managed Daemon's image file being found on the host instead of image load success.HandleEBSResourceAttachment
method. A newtick
method is added for handling watcher ticks. In addition to how the tick is handled currently,tick
method also calls a newdaemonRunning
method to check if EBS Managed Daemon task is running and does nothing if the Daemon task is not running.daemonRunning
method checks if a Daemon task exists and its state. If the task has not reached RUNNING state then the method returnstrue
if task is already running andfalse
if not running yet. Otherwise (either the task has not initialized or has stopped or is stopping) the method starts a new EBS Managed Daemon task.ImageExists
method is added toDaemonManager
and an implementation is added for Linux. The implementation checks if the managed daemon's image tar file exists on the host.Testing
Unit tests are added for all the changes.
Manual tests performed -
New tests cover the changes: yes
Description for the changelog
Load managed daemon images in background to speed up startup time.
Does this PR include breaking model changes? If so, Have you added transformation functions?
no
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.