30 lines
500 B
Python
30 lines
500 B
Python
from governor import thermal_cap
|
|
|
|
|
|
def choose_nodes(nodes, target):
|
|
"""
|
|
Unified default mode:
|
|
all nodes participate unless thermally restricted
|
|
"""
|
|
|
|
usable = []
|
|
|
|
for n in nodes:
|
|
agent = n.get("agent") or {}
|
|
|
|
if thermal_cap(agent) < 0.3:
|
|
continue
|
|
|
|
usable.append(n)
|
|
|
|
return usable
|
|
|
|
|
|
def plan_release(project, nodes):
|
|
plan = {}
|
|
|
|
for target in project["targets"]:
|
|
plan[target] = choose_nodes(nodes, target)
|
|
|
|
return plan
|