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 ServiceConnect image to clean-up exclusion list #3521

Merged
merged 1 commit into from
Dec 15, 2022

Conversation

yinyic
Copy link
Contributor

@yinyic yinyic commented Dec 15, 2022

Summary

ECS Agent periodically cleans up cached docker container images that are not being referenced. There are a few images on the exception list including pause container. We should add Service Connect Agent (aka AppNet Agent) image to this list as well because all SC tasks require cached SC Agent image.

#3520

Implementation details

Added a new function AddImageToCleanUpExclusionList to ImageManager, and when ECS Agent bootstrap, we

  1. let Service Connect manager load AppNet Agent image (this happens right before instance capability registration),
  2. call the above new function for AppNet image such that it's excluded from clean-up.

Step 1 has to happen first since the image name might be different depending on the AppNet Agent version installed.

Testing

New tests cover the changes: no

Logs with update ECS Agent:

...
level=info time=2022-12-15T17:52:13Z msg="Image excluded from cleanup" image="ecs-service-connect-agent:interface-v1"
...

Description for the changelog

Add ServiceConnect image to clean-up exclusion list

Licensing

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

@yinyic yinyic requested a review from a team as a code owner December 15, 2022 01:44
@yinyic yinyic force-pushed the sc-image-cleanup-exclusion branch 3 times, most recently from 209842f to d4e2174 Compare December 15, 2022 02:25

ts := httptest.NewUnstartedServer(r)
ts := httptest.NewUnstartedServer(r)
defer ts.Close()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I received this error when running unit test listen unix /tmp/appnet_admin.sock: bind: address already in use
Moving ts.Close() up in a defer statement should help us clean up always.

Copy link
Contributor

@mythri-garaga mythri-garaga left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this!!

@yinyic yinyic merged commit 172d452 into aws:dev Dec 15, 2022
@yinyic yinyic deleted the sc-image-cleanup-exclusion branch December 15, 2022 18:56
@fierlion fierlion added this to the 1.68.0 milestone Jan 9, 2023
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.

None yet

5 participants