2019-04-16 10:14:49 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-06-02 14:00:52 +00:00
|
|
|
ip=`hostname --ip-address`
|
|
|
|
|
2019-04-16 10:14:49 +00:00
|
|
|
docker run \
|
2019-12-04 12:29:53 +00:00
|
|
|
--gpus all \
|
2019-04-16 10:14:49 +00:00
|
|
|
--name yao-agent \
|
2020-07-31 09:29:25 +00:00
|
|
|
--pid=host \
|
2019-12-04 12:29:53 +00:00
|
|
|
--network yao-net \
|
|
|
|
--network-alias $(hostname) \
|
|
|
|
--hostname $(hostname) \
|
|
|
|
-d \
|
|
|
|
--restart always \
|
|
|
|
--detach=true \
|
2020-06-02 14:00:52 +00:00
|
|
|
--publish 8000:8000 \
|
2019-12-04 12:29:53 +00:00
|
|
|
--env ClientID=$(hostname) \
|
|
|
|
--env ClientHost=$(hostname) \
|
2020-06-02 14:00:52 +00:00
|
|
|
--env ClientExtHost=${ip} \
|
2020-07-31 09:29:25 +00:00
|
|
|
--env PORT=8000 \
|
2020-06-02 14:00:52 +00:00
|
|
|
--env HeartbeatInterval=5 \
|
2020-07-08 13:26:46 +00:00
|
|
|
--env ReportAddress='http://yao-scheduler:8080/?action=agent_report' \
|
2020-07-02 06:35:24 +00:00
|
|
|
--env EnableEventTrigger='true' \
|
|
|
|
--env PYTHONUNBUFFERED=1 \
|
2019-12-04 12:29:53 +00:00
|
|
|
--mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \
|
2019-04-16 10:14:49 +00:00
|
|
|
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
|
2020-07-02 06:35:24 +00:00
|
|
|
--mount type=bind,src=/dfs/yao-jobs/,dst=/dfs/yao-jobs/ \
|
2019-04-16 10:14:49 +00:00
|
|
|
quickdeploy/yao-agent
|