-
Notifications
You must be signed in to change notification settings - Fork 618
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
autocleanup nonECS Containers and Images #1722
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly are minor comments
@@ -118,6 +118,9 @@ additional details on each available environment variable. | |||
| `ECS_IMAGE_CLEANUP_INTERVAL` | 30m | The time interval between automated image cleanup cycles. If set to less than 10 minutes, the value is ignored. | 30m | 30m | | |||
| `ECS_IMAGE_MINIMUM_CLEANUP_AGE` | 30m | The minimum time interval between when an image is pulled and when it can be considered for automated image cleanup. | 1h | 1h | | |||
| `ECS_NUM_IMAGES_DELETE_PER_CYCLE` | 5 | The maximum number of images to delete in a single automated image cleanup cycle. If set to less than 1, the value is ignored. | 5 | 5 | | |||
| `ECS_NONECS_IMAGE_CLEANUP_EXCLUDE` | amazonlinux:2, amazonlinux:1 | The imageCleanupExclusionList includes both ecs and nonecs images that agent won’t cleanup. | | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have jole/eric to review readme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
readme file will keep at the next PR, need to sync with jole/eric before put PR out.
this pull request is older version, please refer to #1736 |
Summary
Automatically cleanup NonECS containers and NonECS images to reduce disk space usage for customers.
Implementation details
(1)Clean NonECS containers and images periodically.
(2)Each time period we delete the images limit ECS_NUM_IMAGES_DELETE_PER_CYCLE (default is 5).
(3)User are able to set env config (ECS_ENABLE_NONECS_IMAGES_REMOVE = true) to realize. Default value is false
(4)The NonECSImages eligible to be deleted sorted by the image size with ascending order.
(5)Users are able to specify the images that they don't want to remove for nonECS images.
Testing
make release
)go build -out amazon-ecs-agent.exe ./agent
)make test
) passgo test -timeout=25s ./agent/...
) passmake run-integ-tests
) pass.\scripts\run-integ-tests.ps1
) passmake run-functional-tests
) pass.\scripts\run-functional-tests.ps1
) passNew tests cover the changes:
Description for the changelog
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.