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
fe3120c9
Commit
fe3120c9
authored
Oct 10, 2017
by
Daniele Venzano
Browse files
Propagate labels up to the scheduler
parent
a422b9f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
zoe_master/backends/docker/threads.py
View file @
fe3120c9
...
...
@@ -73,6 +73,7 @@ class DockerStateSynchronizer(threading.Thread):
time
.
sleep
(
CHECK_INTERVAL
)
continue
node_stats
.
status
=
'online'
node_stats
.
labels
=
host_config
.
labels
service_list
=
self
.
state
.
service_list
(
backend_host
=
host_config
.
name
)
try
:
...
...
@@ -111,6 +112,7 @@ class DockerStateSynchronizer(threading.Thread):
node_stats
.
container_count
=
info
[
'Containers'
]
node_stats
.
cores_total
=
info
[
'NCPU'
]
node_stats
.
memory_total
=
info
[
'MemTotal'
]
node_stats
.
labels
+=
info
[
'Labels'
]
stats
=
{}
for
cont
in
container_list
:
...
...
zoe_master/scheduler/simulated_platform.py
View file @
fe3120c9
...
...
@@ -22,6 +22,7 @@ class SimulatedNode:
self
.
real_active_containers
=
real_node
.
container_count
self
.
services
=
[]
self
.
name
=
real_node
.
name
self
.
labels
=
real_node
.
labels
def
service_fits
(
self
,
service
:
Service
)
->
bool
:
"""Checks whether a service can fit in this node"""
...
...
zoe_master/stats.py
View file @
fe3120c9
...
...
@@ -39,7 +39,7 @@ class NodeStats(Stats):
self
.
memory_total
=
0
self
.
memory_reserved
=
0
self
.
memory_in_use
=
0
self
.
labels
=
{}
self
.
labels
=
[]
self
.
status
=
None
self
.
error
=
''
self
.
services
=
[]
...
...
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