mirror of
https://github.com/newnius/YAO-agent.git
synced 2025-12-12 21:16:44 +00:00
update status
This commit is contained in:
@@ -14,11 +14,7 @@ RUN pip3 install docker kafka psutil
|
||||
|
||||
ADD bootstrap.sh /etc/bootstrap.sh
|
||||
|
||||
ADD monitor.py /root/monitor.py
|
||||
|
||||
ADD executor.py /root/executor.py
|
||||
|
||||
ADD main.py /root/main.py
|
||||
ADD agent.py /root/agent.py
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
|
||||
@@ -94,6 +94,8 @@ class MyHandler(BaseHTTPRequestHandler):
|
||||
'hostname': container.attrs['Config']['Hostname'],
|
||||
'state': container.attrs['State']
|
||||
}
|
||||
if container_id in pending_tasks:
|
||||
status['status'] = 'Ready'
|
||||
if status['command'] is not None:
|
||||
status['command'] = ' '.join(container.attrs['Config']['Cmd'])
|
||||
msg = {'code': 0, 'status': status}
|
||||
@@ -311,18 +313,13 @@ def listener():
|
||||
server.socket.close()
|
||||
|
||||
|
||||
def main():
|
||||
t1 = Thread(target=report)
|
||||
t2 = Thread(target=listener)
|
||||
t1.start()
|
||||
t2.start()
|
||||
print("started")
|
||||
while True:
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
os.environ["TZ"] = 'Asia/Shanghai'
|
||||
if hasattr(time, 'tzset'):
|
||||
time.tzset()
|
||||
main()
|
||||
t1 = Thread(target=report)
|
||||
t2 = Thread(target=listener)
|
||||
t1.start()
|
||||
t2.start()
|
||||
while True:
|
||||
pass
|
||||
10
bootstrap.sh
10
bootstrap.sh
@@ -1,14 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# TODO: monitor the processes
|
||||
|
||||
# run nvidia-smi in background to speed up the query and reduce CPU load (why?)
|
||||
nvidia-smi daemon
|
||||
|
||||
#python3 /root/monitor.py &
|
||||
|
||||
#python3 /root/executor.py &
|
||||
|
||||
#sleep infinity
|
||||
|
||||
python3 /root/main.py
|
||||
python3 /root/agent.py
|
||||
Reference in New Issue
Block a user