[arvados] created: 2.6.0-423-gc071d7aae
git repository hosting
git at public.arvados.org
Fri Aug 4 18:30:41 UTC 2023
at c071d7aaed53241f68bad09d8dd8d20b21b8bb40 (commit)
commit c071d7aaed53241f68bad09d8dd8d20b21b8bb40
Author: Brett Smith <brett.smith at curii.com>
Date: Fri Aug 4 14:28:18 2023 -0400
20754: Upgrade docker module for docker-cleaner
The immediate motivation is dealing with the bug discussed in the
comments. Upgrading generally seems like a good idea since we've been
pinned at a specific version for so long.
Changing the Docker API version is required by the library: 1.21 is the
oldest version currently supported. Our Go stack is standardized on
1.35, so use that here too.
Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith at curii.com>
diff --git a/services/dockercleaner/arvados_docker/cleaner.py b/services/dockercleaner/arvados_docker/cleaner.py
index 2a0e8b910..df624698b 100755
--- a/services/dockercleaner/arvados_docker/cleaner.py
+++ b/services/dockercleaner/arvados_docker/cleaner.py
@@ -362,7 +362,7 @@ def main(arguments=sys.argv[1:]):
config = load_config(arguments)
configure_logging(config)
try:
- run(config, docker.Client(version='1.14'))
+ run(config, docker.APIClient(version='1.35'))
except KeyboardInterrupt:
sys.exit(1)
diff --git a/services/dockercleaner/setup.py b/services/dockercleaner/setup.py
index e75afb571..d5c572f2e 100644
--- a/services/dockercleaner/setup.py
+++ b/services/dockercleaner/setup.py
@@ -37,7 +37,16 @@ setup(name="arvados-docker-cleaner",
('share/doc/arvados-docker-cleaner', ['agpl-3.0.txt', 'arvados-docker-cleaner.service']),
],
install_requires=[
- 'docker-py==1.7.2',
+ # The requirements for the docker library broke when requests started
+ # supporting urllib3 2.0.
+ # See <https://github.com/docker/docker-py/issues/3113>.
+ # Make sure we get a version with the bugfix, assuming Python is
+ # recent enough.
+ 'docker>=6.1.0; python_version>"3.6"',
+ # If Python is too old, install the latest version we can and pin
+ # urllib3 ourselves.
+ 'docker~=5.0; python_version<"3.7"',
+ 'urllib3~=1.26; python_version<"3.7"',
'setuptools',
],
test_suite='tests',
diff --git a/services/dockercleaner/tests/test_cleaner.py b/services/dockercleaner/tests/test_cleaner.py
index 961ec2ce4..cd03538fc 100644
--- a/services/dockercleaner/tests/test_cleaner.py
+++ b/services/dockercleaner/tests/test_cleaner.py
@@ -394,7 +394,7 @@ 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('docker.APIClient', name='docker_client')
@mock.patch('arvados_docker.cleaner.run', name='cleaner_run')
class MainTestCase(unittest.TestCase):
@@ -404,11 +404,9 @@ class MainTestCase(unittest.TestCase):
cf.flush()
cleaner.main(['--config', cf.name])
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',
+ # We are standardized on Docker API version 1.35.
+ # See DockerAPIVersion in lib/crunchrun/docker.go.
+ self.assertEqual('1.35',
docker_client.call_args[1].get('version'))
self.assertEqual(1, run_mock.call_count)
self.assertIs(run_mock.call_args[0][1], docker_client())
commit 077af72625dda6760b426f566cc52ff1523fe7b8
Author: Brett Smith <brett.smith at curii.com>
Date: Fri Aug 4 14:05:26 2023 -0400
20754: Remove test requirements from docker-cleaner
Neither are required with our current Python stack.
Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith at curii.com>
diff --git a/services/dockercleaner/setup.py b/services/dockercleaner/setup.py
index 3bafe9ba8..e75afb571 100644
--- a/services/dockercleaner/setup.py
+++ b/services/dockercleaner/setup.py
@@ -40,10 +40,6 @@ setup(name="arvados-docker-cleaner",
'docker-py==1.7.2',
'setuptools',
],
- tests_require=[
- 'pbr<1.7.0',
- 'mock',
- ],
test_suite='tests',
zip_safe=False
)
diff --git a/services/dockercleaner/tests/test_cleaner.py b/services/dockercleaner/tests/test_cleaner.py
index 7580b0128..961ec2ce4 100644
--- a/services/dockercleaner/tests/test_cleaner.py
+++ b/services/dockercleaner/tests/test_cleaner.py
@@ -13,7 +13,7 @@ import time
import unittest
import docker
-import mock
+from unittest import mock
from arvados_docker import cleaner
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list