[ARVADOS] updated: 1363b1b5e0e2ecc551f3f41ca55b13ce2b7cf3db
Git user
git at public.curoverse.com
Thu Mar 17 09:57:38 EDT 2016
Summary of changes:
services/dockercleaner/arvados_docker/cleaner.py | 2 +-
services/dockercleaner/tests/test_cleaner.py | 16 +++++++++++-----
2 files changed, 12 insertions(+), 6 deletions(-)
via 1363b1b5e0e2ecc551f3f41ca55b13ce2b7cf3db (commit)
via 54a9d4afcc7a7800388d61a2601f2495fd265ae9 (commit)
from 5ba59abf2fece90309815b15b2d118860fb3b1b3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 1363b1b5e0e2ecc551f3f41ca55b13ce2b7cf3db
Merge: 5ba59ab 54a9d4a
Author: Brett Smith <brett at curoverse.com>
Date: Thu Mar 17 09:57:26 2016 -0400
Merge branch '8709-docker-cleaner-volumes-wip'
Closes #8709, #8711.
commit 54a9d4afcc7a7800388d61a2601f2495fd265ae9
Author: Brett Smith <brett at curoverse.com>
Date: Tue Mar 15 17:59:16 2016 -0400
8709: Docker cleaner cleans container volumes.
This prevents a compute node's Docker partition from filling with
scratch space volumes.
diff --git a/services/dockercleaner/arvados_docker/cleaner.py b/services/dockercleaner/arvados_docker/cleaner.py
index 719cc2a..88b8a4b 100755
--- a/services/dockercleaner/arvados_docker/cleaner.py
+++ b/services/dockercleaner/arvados_docker/cleaner.py
@@ -191,7 +191,7 @@ class DockerImageCleaner(DockerImageUseRecorder):
def _remove_container(self, cid):
try:
- self.docker_client.remove_container(cid)
+ self.docker_client.remove_container(cid, v=True)
except docker.errors.APIError as error:
logger.warning("Failed to remove container %s: %s", cid, error)
else:
diff --git a/services/dockercleaner/tests/test_cleaner.py b/services/dockercleaner/tests/test_cleaner.py
index 31a48b2..3cb172e 100644
--- a/services/dockercleaner/tests/test_cleaner.py
+++ b/services/dockercleaner/tests/test_cleaner.py
@@ -315,13 +315,19 @@ class DockerContainerCleanerTestCase(DockerImageUseRecorderTestCase):
TEST_CLASS = cleaner.DockerImageCleaner
TEST_CLASS_INIT_KWARGS = {'remove_containers_onexit': True}
+ def test_container_deletion_deletes_volumes(self):
+ cid = MockDockerId()
+ self.events.append(MockEvent('die', docker_id=cid))
+ self.recorder.run()
+ self.docker_client.remove_container.assert_called_with(cid, v=True)
+
@mock.patch('arvados_docker.cleaner.logger')
def test_failed_container_deletion_handling(self, mockLogger):
cid = MockDockerId()
self.docker_client.remove_container.side_effect = MockException(500)
self.events.append(MockEvent('die', docker_id=cid))
self.recorder.run()
- self.docker_client.remove_container.assert_called_with(cid)
+ self.docker_client.remove_container.assert_called_with(cid, v=True)
self.assertEqual("Failed to remove container %s: %s",
mockLogger.warning.call_args[0][0])
self.assertEqual(cid,
@@ -413,13 +419,13 @@ class ContainerRemovalTestCase(unittest.TestCase):
def test_remove_onexit(self):
self.args.remove_stopped_containers = 'onexit'
cleaner.run(self.args, self.docker_client)
- self.docker_client.remove_container.assert_called_once_with(self.newCID)
+ self.docker_client.remove_container.assert_called_once_with(self.newCID, v=True)
def test_remove_always(self):
self.args.remove_stopped_containers = 'always'
cleaner.run(self.args, self.docker_client)
- self.docker_client.remove_container.assert_any_call(self.existingCID)
- self.docker_client.remove_container.assert_any_call(self.newCID)
+ self.docker_client.remove_container.assert_any_call(self.existingCID, v=True)
+ self.docker_client.remove_container.assert_any_call(self.newCID, v=True)
self.assertEqual(2, self.docker_client.remove_container.call_count)
def test_remove_never(self):
@@ -439,5 +445,5 @@ class ContainerRemovalTestCase(unittest.TestCase):
mock.call.events(since=mock.ANY),
mock.call.containers(filters={'status':'exited'})])
# Asked to delete the container twice?
- self.docker_client.remove_container.assert_has_calls([mock.call(self.existingCID)] * 2)
+ self.docker_client.remove_container.assert_has_calls([mock.call(self.existingCID, v=True)] * 2)
self.assertEqual(2, self.docker_client.remove_container.call_count)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list