mirror of
https://github.com/newnius/YAO-agent.git
synced 2025-12-15 13:56:44 +00:00
all in one
This commit is contained in:
6
main.py
6
main.py
@@ -27,12 +27,16 @@ pending_tasks = {}
|
|||||||
|
|
||||||
|
|
||||||
def launch_tasks(stats):
|
def launch_tasks(stats):
|
||||||
|
utils = {}
|
||||||
|
for stat in stats:
|
||||||
|
utils[stat['uuid']] = stat['utilization_gpu']
|
||||||
|
|
||||||
client = docker.from_env()
|
client = docker.from_env()
|
||||||
container = client.containers.get('yao-agent-helper')
|
container = client.containers.get('yao-agent-helper')
|
||||||
entries_to_remove = []
|
entries_to_remove = []
|
||||||
lock.acquire()
|
lock.acquire()
|
||||||
for task_id, task in pending_tasks.items():
|
for task_id, task in pending_tasks.items():
|
||||||
if int(stats[task['gpus'][0]]['utilization_gpu']) < 75:
|
if int(utils[task['gpus'][0]]) < 75:
|
||||||
entries_to_remove.append(task_id)
|
entries_to_remove.append(task_id)
|
||||||
script = " ".join([
|
script = " ".join([
|
||||||
"docker exec",
|
"docker exec",
|
||||||
|
|||||||
Reference in New Issue
Block a user