mirror of
https://github.com/newnius/YAO-agent.git
synced 2025-06-07 13:51:56 +00:00
all in one
This commit is contained in:
parent
03aa692227
commit
69fd081e29
4
main.py
4
main.py
@ -131,7 +131,7 @@ class MyHandler(BaseHTTPRequestHandler):
|
|||||||
try:
|
try:
|
||||||
script = " ".join([
|
script = " ".join([
|
||||||
"docker run",
|
"docker run",
|
||||||
"--gpus '\"device=" + docker_gpus + "\"'",
|
"--gpus '\\\"device=" + docker_gpus + "\\\"'",
|
||||||
"--detach=True",
|
"--detach=True",
|
||||||
"--hostname " + docker_name,
|
"--hostname " + docker_name,
|
||||||
"--network " + docker_network,
|
"--network " + docker_network,
|
||||||
@ -147,7 +147,7 @@ class MyHandler(BaseHTTPRequestHandler):
|
|||||||
|
|
||||||
client = docker.from_env()
|
client = docker.from_env()
|
||||||
container = client.containers.get('yao-agent-helper')
|
container = client.containers.get('yao-agent-helper')
|
||||||
exit_code, output = container.exec_run(['sh', '-c', '\'', script, '\''])
|
exit_code, output = container.exec_run(['sh', '-c', '"', script, '"'])
|
||||||
msg = {"code": 0, "id": output.decode('utf-8').rstrip('\n')}
|
msg = {"code": 0, "id": output.decode('utf-8').rstrip('\n')}
|
||||||
|
|
||||||
print(msg)
|
print(msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user