Commit ea39c392 authored by Daniele Venzano's avatar Daniele Venzano

Tune the new scheduler policies: prefer hosts without labels and reset the...

Tune the new scheduler policies: prefer hosts without labels and reset the size of execution in the queue to implement back-filling
parent ad3b0331
......@@ -155,10 +155,10 @@ class ZoeElasticScheduler:
elif self.policy == "DYNSIZE":
for execution in self.queue: # type: Execution
exec_data = self.additional_exec_state[execution.id]
if execution.size == 0 or exec_data.last_time_scheduled == 0:
if exec_data.last_time_scheduled == 0:
continue
elif execution.size < 0:
execution.set_size(0)
elif execution.size <= 0:
execution.set_size(execution.total_reservations.cores.min * execution.total_reservations.memory.min)
continue
new_size = execution.size - (time.time() - exec_data.last_time_scheduled) * (32 * 1024 ** 2) # to be tuned
execution.set_size(new_size)
......
......@@ -118,9 +118,15 @@ class SimulatedPlatform:
return random.choice(node_list)
elif get_conf().placement_policy == "waterfill":
node_list.sort(key=lambda n: n.container_count, reverse=True) # biggest first
for node in node_list:
if len(node.labels) == 0:
return node
return node_list[0]
elif get_conf().placement_policy == "average":
node_list.sort(key=lambda n: n.container_count) # smallest first
for node in node_list:
if len(node.labels) == 0:
return node
return node_list[0]
else:
log.error('Unknown placement policy: {}'.format(get_conf().placement_policy))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment