Commit dedc66ea authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

pull factory images from the registry before starting the sandbox

parent f878b649
......@@ -450,8 +450,7 @@ class SandboxManager(Manager):
# docker image
if version is None:
image = "%s/factory/%s:%s" % (self.ctrl.registry,
webapp.docker_os.docker_name,
image = "%s:%s" % (ctrl.gen_factory_name(webapp.docker_os),
webapp.docker_os.version)
else:
image = "%s:%s" % (webapp.image_name, version.number)
......@@ -868,6 +867,11 @@ exec /.toolbox/bin/sshd -D
# pull requested image
yield from ctrl.image_manager.pull(sandbox_version.id)
else:
# pull image
yield from ctrl.image_manager.sandbox_pull_manager.process((
ctrl.gen_factory_name(webapp.docker_os),
webapp.docker_os.version))
# start sandbox
yield from self.run_in_executor(self._start, webapp, sandbox_version)
......@@ -1559,6 +1563,9 @@ class DockerController:
return os.path.join(self.datastore_path, str(job.user_id),
str(job.webapp_id), job.access_token)
def gen_factory_name(self, docker_os):
return "%s/factory/%s" % (self.registry, docker_os.docker_name)
def check_host_path(self, funcname, path, *, nolink=True):
"""Validate a path before using it as an external volume in docker
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment