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
65976d37
Commit
65976d37
authored
Oct 11, 2017
by
Daniele Venzano
Browse files
Fix pylint warnings
parent
42234400
Changes
4
Hide whitespace changes
Inline
Side-by-side
zoe_master/backends/docker/backend.py
View file @
65976d37
...
...
@@ -59,8 +59,8 @@ 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
:
parsed_name
=
re
.
search
(
r
'^(?:([^\/]+)\/)?(?:([^\/]+)\/)?([^@:\/]+)(?:[@:](.+))?$'
,
service_instance
.
image_name
)
if
parsed_name
.
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
:
...
...
@@ -91,8 +91,8 @@ 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
:
parsed_name
=
re
.
search
(
r
'^(?:([^\/]+)\/)?(?:([^\/]+)\/)?([^@:\/]+)(?:[@:](.+))?$'
,
image_name
)
if
parsed_name
.
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
:
...
...
zoe_master/backends/interface.py
View file @
65976d37
...
...
@@ -16,8 +16,8 @@
"""The high-level interface that Zoe uses to talk to the configured container backend."""
import
logging
from
typing
import
List
import
time
from
typing
import
List
from
zoe_lib.config
import
get_conf
from
zoe_lib.state
import
Execution
,
Service
,
SQLManager
# pylint: disable=unused-import
...
...
zoe_master/backends/kubernetes/backend.py
View file @
65976d37
...
...
@@ -74,3 +74,7 @@ class KubernetesBackend(zoe_master.backends.base.BaseBackend):
node
.
memory_in_use
=
node
.
memory_reserved
node
.
cores_in_use
=
node
.
cores_reserved
return
info
def
preload_image
(
self
,
image_name
:
str
)
->
None
:
"""Make a service image available."""
raise
NotImplementedError
zoe_master/backends/swarm/backend.py
View file @
65976d37
...
...
@@ -75,3 +75,7 @@ class SwarmBackend(zoe_master.backends.base.BaseBackend):
def
service_log
(
self
,
service
:
Service
):
"""Get the log."""
return
self
.
swarm
.
logs
(
service
.
backend_id
,
True
,
False
)
def
preload_image
(
self
,
image_name
:
str
)
->
None
:
"""Make a service image available."""
raise
NotImplementedError
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