Fetch helper image before run

This commit is contained in:
alesapin 2020-10-09 17:38:31 +03:00
parent 66b7748b63
commit 3ac7b5aba8

View File

@ -166,6 +166,17 @@ class _NetworkManager:
except docker.errors.NotFound:
pass
# for some reason docker api may hang if image doesn't exist, so we download it
# before running
for i in range(5):
try:
subprocess.check_call("docker pull yandex/clickhouse-integration-helper", shell=True)
break
except:
time.sleep(i)
else:
raise Exception("Cannot pull yandex/clickhouse-integration-helper image")
self._container = self._docker_client.containers.run('yandex/clickhouse-integration-helper',
auto_remove=True,
command=('sleep %s' % self.container_exit_timeout),