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

remove non ecs containers and images #1736

Merged
merged 1 commit into from
Dec 12, 2018
Merged

remove non ecs containers and images #1736

merged 1 commit into from
Dec 12, 2018

Conversation

cyastella
Copy link
Contributor

@cyastella cyastella commented Dec 11, 2018

Summary

Automatically cleanup NonECS containers and NonECS images to reduce disk space usage for customers.
Here is the previous PR link: #1722

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

  • Builds on Linux (make release)
  • Builds on Windows (go build -out amazon-ecs-agent.exe ./agent)
  • Unit tests on Linux (make test) pass
  • Unit tests on Windows (go test -timeout=25s ./agent/...) pass
  • Integration tests on Linux (make run-integ-tests) pass
  • Integration tests on Windows (.\scripts\run-integ-tests.ps1) pass
  • Functional tests on Linux (make run-functional-tests) pass
  • Functional tests on Windows (.\scripts\run-functional-tests.ps1) pass

New 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.

@yumex93
Copy link
Contributor

yumex93 commented Dec 11, 2018

It is better to link the old pr to this one, so people can review comments on that pr.

agent/engine/docker_image_manager.go Show resolved Hide resolved
agent/engine/docker_image_manager.go Show resolved Hide resolved
agent/engine/docker_image_manager.go Outdated Show resolved Hide resolved
agent/engine/docker_image_manager.go Outdated Show resolved Hide resolved
agent/engine/docker_image_manager.go Show resolved Hide resolved
agent/config/types.go Outdated Show resolved Hide resolved
Copy link
Contributor

@fenxiong fenxiong left a comment

Choose a reason for hiding this comment

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

mostly minor comments

agent/config/config_unix.go Show resolved Hide resolved
agent/config/types.go Outdated Show resolved Hide resolved
agent/engine/docker_image_manager.go Outdated Show resolved Hide resolved
agent/engine/docker_image_manager.go Outdated Show resolved Hide resolved
agent/engine/docker_image_manager.go Show resolved Hide resolved
agent/engine/docker_image_manager.go Outdated Show resolved Hide resolved
agent/engine/docker_image_manager.go Outdated Show resolved Hide resolved
agent/engine/docker_image_manager.go Outdated Show resolved Hide resolved
Copy link
Contributor

@haikuoliu haikuoliu left a comment

Choose a reason for hiding this comment

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

Once you address feng's comments and all test past

@cyastella cyastella merged commit 9dc3843 into aws:remove-nonecs-containers-and-images Dec 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants