Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simone Rossi
main
Commits
ec5cdf94
Commit
ec5cdf94
authored
Dec 11, 2017
by
Daniele Venzano
Browse files
Better logging of why services cannot be fitted on nodes
parent
6195ca88
Changes
1
Hide whitespace changes
Inline
Side-by-side
zoe_master/scheduler/simulated_platform.py
View file @
ec5cdf94
...
...
@@ -115,10 +115,10 @@ class SimulatedPlatform:
if
node
.
service_fits
(
service
):
candidate_nodes
.
append
(
node
)
else
:
log
.
debug
(
'Cannot fit service {} on node {}: {}'
.
format
(
service
.
id
,
node
.
name
,
node
.
service_why_unfit
(
service
)))
log
.
debug
(
'Cannot fit
essential
service {} on node {}: {}'
.
format
(
service
.
id
,
node
.
name
,
node
.
service_why_unfit
(
service
)))
if
len
(
candidate_nodes
)
==
0
:
# this service does not fit anywhere
self
.
deallocate_essential
(
execution
)
log
.
debug
(
'Cannot fit essential service {} anywhere, bailing out'
.
format
(
service
.
id
))
log
.
info
(
'Cannot fit essential service {} anywhere, bailing out'
.
format
(
service
.
id
))
return
False
candidate_nodes
.
sort
(
key
=
lambda
n
:
n
.
container_count
)
# smallest first
candidate_nodes
[
0
].
service_add
(
service
)
...
...
@@ -141,7 +141,10 @@ class SimulatedPlatform:
for
node_id_
,
node
in
self
.
nodes
.
items
():
if
node
.
service_fits
(
service
):
candidate_nodes
.
append
(
node
)
else
:
log
.
debug
(
'Cannot fit elastic service {} on node {}: {}'
.
format
(
service
.
id
,
node
.
name
,
node
.
service_why_unfit
(
service
)))
if
len
(
candidate_nodes
)
==
0
:
# this service does not fit anywhere
log
.
info
(
'Cannot fit elastic service {} anywhere'
.
format
(
service
.
id
))
continue
candidate_nodes
.
sort
(
key
=
lambda
n
:
n
.
container_count
)
# smallest first
candidate_nodes
[
0
].
service_add
(
service
)
...
...
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