mirror of
https://github.com/newnius/YAO-agent.git
synced 2025-06-07 22:01:55 +00:00
update
This commit is contained in:
parent
9c981a52bb
commit
702759aa18
6
agent.py
6
agent.py
@ -36,7 +36,7 @@ def launch_tasks(stats):
|
|||||||
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(utils[task['gpus'][0]]) < 75:
|
if int(utils[task['gpus'][0]]) < 85:
|
||||||
entries_to_remove.append(task_id)
|
entries_to_remove.append(task_id)
|
||||||
script = " ".join([
|
script = " ".join([
|
||||||
"docker exec",
|
"docker exec",
|
||||||
@ -155,6 +155,7 @@ class MyHandler(BaseHTTPRequestHandler):
|
|||||||
lock.release()
|
lock.release()
|
||||||
if exit_code != 0:
|
if exit_code != 0:
|
||||||
msg["code"] = 1
|
msg["code"] = 1
|
||||||
|
msg["error"] = output.decode('utf-8').rstrip('\n')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
msg = {"code": 1, "error": str(e)}
|
msg = {"code": 1, "error": str(e)}
|
||||||
print(str(e))
|
print(str(e))
|
||||||
@ -214,7 +215,7 @@ class MyHandler(BaseHTTPRequestHandler):
|
|||||||
|
|
||||||
|
|
||||||
def report():
|
def report():
|
||||||
interval = 5
|
interval = 1
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
status, msg_gpu = execute(['nvidia-smi', '-q', '-x', '-f', 'status.xml'])
|
status, msg_gpu = execute(['nvidia-smi', '-q', '-x', '-f', 'status.xml'])
|
||||||
@ -322,4 +323,5 @@ if __name__ == '__main__':
|
|||||||
t1.start()
|
t1.start()
|
||||||
t2.start()
|
t2.start()
|
||||||
while True:
|
while True:
|
||||||
|
time.sleep(1)
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user