Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
allgo
allgo
Commits
dedc66ea
Commit
dedc66ea
authored
May 29, 2017
by
BAIRE Anthony
Browse files
pull factory images from the registry before starting the sandbox
parent
f878b649
Changes
1
Hide whitespace changes
Inline
Side-by-side
controller/controller.py
View file @
dedc66ea
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment