From 6051aeaad7ee77928379e425580cef8c9944b166 Mon Sep 17 00:00:00 2001 From: "xiongdian.me" Date: Sat, 29 Apr 2023 19:27:43 +0800 Subject: [PATCH] dnew --restart --- testbed/scripts/deploy1.sh | 4 ++++ testbed/scripts/dnew | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/testbed/scripts/deploy1.sh b/testbed/scripts/deploy1.sh index d5a0981..22f600d 100644 --- a/testbed/scripts/deploy1.sh +++ b/testbed/scripts/deploy1.sh @@ -81,6 +81,10 @@ git clone https://git.nasp.ob.ac.cn/NASP/registry cd registry/scripts ./testbed_deploy.sh +# scripts +cp "$THIS_DIR"/dnew /usr/local/bin/ + + echo "will reboot in 10 seconds... press ctrl-c to cancel." sleep 10 reboot diff --git a/testbed/scripts/dnew b/testbed/scripts/dnew index 29c0124..51ee25e 100755 --- a/testbed/scripts/dnew +++ b/testbed/scripts/dnew @@ -7,6 +7,7 @@ if [[ "$EUID" == "0" ]]; then fi container_name=$USER_$(date +%y%m%d-%H%M%S) image_name=${1:-"nasp-ubuntu"} +cmd=${2:-"/etc/startup.sh"} echo "container name: $container_name" echo "image: $image_name" sudo docker run -d --net=host -v /home2:/home2 \ @@ -16,4 +17,5 @@ sudo docker run -d --net=host -v /home2:/home2 \ --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all \ -v /usr/local/cuda:/usr/local/cuda --security-opt \ seccomp=unconfined --ulimit memlock=-1:-1 \ - --name $container_name -it $image_name bash + --restart=always \ + --name $container_name -it $image_name $cmd