-
Notifications
You must be signed in to change notification settings - Fork 508
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 container images cleanup settings to API #3215
Add container images cleanup settings to API #3215
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.
LGTM!
577bc92
to
3e83564
Compare
(Rebase fixes for the rust version) |
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.
Some minor things on the markdown to make it "more correct", but my main concern is on the template rendering. Looks like it's missing some of the new settings?
README.md
Outdated
@@ -657,6 +657,14 @@ Valid time units include `s`, `m`, and `h`, e.g. `1h`, `1m1s`. | |||
* `settings.ecs.reserved-memory`: The amount of memory, in MiB, reserved for critical system processes. | |||
* `settings.ecs.task-cleanup-wait`: Time to wait before the task's containers are removed after they are stopped. | |||
Valid time units are `s`, `m`, and `h`, e.g. `1h`, `1m1s`. | |||
* `settings.ecs.image-cleanup-wait`: Time to wait between image cleanup cycles |
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.
Nit: missing period at the end of this sentence. With the next line being part of the same bullet, that will cause the two to run together.
Second lines should really be indented too, so they are clearly part of the same bullet item line. But at least for now, it looks like GitHub's markdown rendering handles this OK so the rendered output is correct.
3e83564
to
0a5a17e
Compare
(Forced push to address nits on README.md) |
README.md
Outdated
Valid time units are `s`, `m`, and `h`, e.g. `1h`, `1m1s`. | ||
* `settings.ecs.image-cleanup-wait`: Time to wait between image cleanup cycles. | ||
Valid time units are `s`, `m`, and `h`, e.g. `1h`, `1m1s`. | ||
* `settings.ecs.images-to-delete-per-cycle`: Number of images to delete in a single image cleanup cycle. |
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.
I don't like the switch away from the image-
prefix here - maybe this?
* `settings.ecs.images-to-delete-per-cycle`: Number of images to delete in a single image cleanup cycle. | |
* `settings.ecs.image-cleanup-delete-per-cycle`: Number of images to delete in a single image cleanup cycle. |
0a5a17e
to
3e121d6
Compare
(Forced push renames |
README.md
Outdated
* `settings.ecs.image-cleanup-wait`: Time to wait between image cleanup cycles. | ||
Valid time units are `s`, `m`, and `h`, e.g. `1h`, `1m1s`. | ||
* `settings.ecs.image-cleanup-delete-per-cycle`: Number of images to delete in a single image cleanup cycle. | ||
* `settings.ecs.image-cleanup-disabled`: Disable automatic images clean up after the tasks have been removed. |
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.
We've preferred the positive form of these booleans elsewhere in the API.
* `settings.ecs.image-cleanup-disabled`: Disable automatic images clean up after the tasks have been removed. | |
* `settings.ecs.image-cleanup-enabled`: Enable automatic images clean up after the tasks have been removed. Defaults to `true`. |
3e121d6
to
50127ec
Compare
(Forced push renames |
This adds the configurations exposed by the agent to clean up container images after a period of time. As with previous changes, time-related configurations are rendered at `/etc/ecs/ecs.config` instead of `/etc/ecs/ecs.config.json`, since the JSON parser used by the ECS agent fails to parse time-formatted strings. Signed-off-by: Arnaldo Garcia Rincon <[email protected]>
Signed-off-by: Arnaldo Garcia Rincon <[email protected]>
50127ec
to
45f3b13
Compare
(Forced push removes unnecessary |
Issue number:
Closes #3167
Description of changes:
This adds additional API settings for the ECS variants, to further tweak image clean up cycles. In the issue, only
ECS_NUM_IMAGES_DELETE_PER_CYCLE
andECS_IMAGE_CLEANUP_INTERVAL
were asked for. But while testing, I found that not all the images that I was expecting to be deleted were actually cleaned. This is because not all the images were old enough to be picked up by cleanup cycles. Thus, I decided to add two more settings that allow further tweaks to the cleaning cycles. The new configurations in this PR include:settings.ecs.image-cleanup-wait
: maps toECS_IMAGE_CLEANUP_INTERVAL
, which is the time to wait between image cleanup cycles.settings.ecs.images-to-delete-per-cycle
: maps toECS_NUM_IMAGES_DELETE_PER_CYCLE
, which is the number of images to be deleted per cleanup cyclesettings.ecs.image-cleanup-age
: maps toECS_IMAGE_MINIMUM_CLEANUP_AGE
, which is the time that has to pass since the images were pulled to be considered for clean upsettings.ecs.image-cleanup-disabled
: maps toECS_DISABLE_IMAGE_CLEANUP
, indicates whether image cleanup is disabled.Testing done:
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.