[ARVADOS] updated: ace5807988dd1db2e8bd63a788fb0f0d9da152d7
git at public.curoverse.com
git at public.curoverse.com
Fri Dec 18 13:30:13 EST 2015
Summary of changes:
services/dockercleaner/arvados_docker/cleaner.py | 2 +-
services/dockercleaner/tests/test_cleaner.py | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
via ace5807988dd1db2e8bd63a788fb0f0d9da152d7 (commit)
via 71d6a94edbd7841e6bca6573ca024afca1599bb7 (commit)
from 5e1326a931e8a852e502a5cd1ac020f5cf407d00 (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 ace5807988dd1db2e8bd63a788fb0f0d9da152d7
Merge: 5e1326a 71d6a94
Author: Brett Smith <brett at curoverse.com>
Date: Fri Dec 18 13:30:10 2015 -0500
Merge branch '7927-docker-cleaner-api-version-wip'
Closes #7927, #8025.
commit 71d6a94edbd7841e6bca6573ca024afca1599bb7
Author: Brett Smith <brett at curoverse.com>
Date: Wed Dec 16 11:07:24 2015 -0500
7927: Docker cleaner service uses Docker API v1.14.
This helps it work consistently across a variety of Docker versions.
See the comment in the tests for more background.
diff --git a/services/dockercleaner/arvados_docker/cleaner.py b/services/dockercleaner/arvados_docker/cleaner.py
index 2435e6d..719cc2a 100755
--- a/services/dockercleaner/arvados_docker/cleaner.py
+++ b/services/dockercleaner/arvados_docker/cleaner.py
@@ -288,7 +288,7 @@ def run(args, docker_client):
def main(arguments):
args = parse_arguments(arguments)
setup_logging(args)
- run(args, docker.Client())
+ run(args, docker.Client(version='1.14'))
if __name__ == '__main__':
main(sys.argv[1:])
diff --git a/services/dockercleaner/tests/test_cleaner.py b/services/dockercleaner/tests/test_cleaner.py
index 43abe4f..31a48b2 100644
--- a/services/dockercleaner/tests/test_cleaner.py
+++ b/services/dockercleaner/tests/test_cleaner.py
@@ -374,6 +374,21 @@ class RunTestCase(unittest.TestCase):
self.assertEqual(event_kwargs[0]['until'], event_kwargs[1]['since'])
+ at mock.patch('docker.Client', name='docker_client')
+ at mock.patch('arvados_docker.cleaner.run', name='cleaner_run')
+class MainTestCase(unittest.TestCase):
+ def test_client_api_version(self, run_mock, docker_client):
+ cleaner.main(['--quota', '1000T'])
+ self.assertEqual(1, docker_client.call_count)
+ # 1.14 is the first version that's well defined, going back to
+ # Docker 1.2, and still supported up to at least Docker 1.9.
+ # See <https://docs.docker.com/engine/reference/api/docker_remote_api/>.
+ self.assertEqual('1.14',
+ docker_client.call_args[1].get('version'))
+ self.assertEqual(1, run_mock.call_count)
+ self.assertIs(run_mock.call_args[0][1], docker_client())
+
+
class ContainerRemovalTestCase(unittest.TestCase):
LIFECYCLE = ['create', 'attach', 'start', 'resize', 'die', 'destroy']
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list