Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
zoe
main
Commits
6d7464fc
Commit
6d7464fc
authored
Oct 11, 2017
by
Daniele Venzano
Browse files
Refuse to work with images that do not have a tag set, Docker will try to download all tags
parent
26abf4b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
zoe_master/backends/docker/backend.py
View file @
6d7464fc
...
...
@@ -16,7 +16,7 @@
"""Zoe backend implementation for one or more Docker Engines."""
import
logging
import
threading
import
re
import
time
from
zoe_lib.state
import
Service
...
...
@@ -59,6 +59,9 @@ class DockerEngineBackend(zoe_master.backends.base.BaseBackend):
def
spawn_service
(
self
,
service_instance
:
ServiceInstance
):
"""Spawn a service, translating a Zoe Service into a Docker container."""
m
=
re
.
search
(
r
'^(?:([^\/]+)\/)?(?:([^\/]+)\/)?([^@:\/]+)(?:[@:](.+))?$'
,
service_instance
.
image_name
)
if
m
.
group
(
4
)
is
None
:
raise
ZoeStartExecutionFatalException
(
'Image {} does not have a version tag'
.
format
(
service_instance
.
image_name
))
conf
=
self
.
_get_config
(
service_instance
.
backend_host
)
try
:
engine
=
DockerClient
(
conf
)
...
...
@@ -88,6 +91,9 @@ class DockerEngineBackend(zoe_master.backends.base.BaseBackend):
def
preload_image
(
self
,
image_name
):
"""Pull an image from a Docker registry into each host. We shuffle the list to prevent the scheduler to find always the first host in the list."""
m
=
re
.
search
(
r
'^(?:([^\/]+)\/)?(?:([^\/]+)\/)?([^@:\/]+)(?:[@:](.+))?$'
,
image_name
)
if
m
.
group
(
4
)
is
None
:
raise
ZoeException
(
'Image {} does not have a version tag'
.
format
(
image_name
))
one_success
=
False
for
host_conf
in
self
.
docker_config
:
log
.
debug
(
'Pre-loading image {} on host {}'
.
format
(
image_name
,
host_conf
.
name
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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