dnew --restart

This commit is contained in:
xiongdian.me 2023-04-29 19:27:43 +08:00
parent 4ff38a6cb8
commit 6051aeaad7
2 changed files with 7 additions and 1 deletions

View File

@ -81,6 +81,10 @@ git clone https://git.nasp.ob.ac.cn/NASP/registry
cd registry/scripts cd registry/scripts
./testbed_deploy.sh ./testbed_deploy.sh
# scripts
cp "$THIS_DIR"/dnew /usr/local/bin/
echo "will reboot in 10 seconds... press ctrl-c to cancel." echo "will reboot in 10 seconds... press ctrl-c to cancel."
sleep 10 sleep 10
reboot reboot

View File

@ -7,6 +7,7 @@ if [[ "$EUID" == "0" ]]; then
fi fi
container_name=$USER_$(date +%y%m%d-%H%M%S) container_name=$USER_$(date +%y%m%d-%H%M%S)
image_name=${1:-"nasp-ubuntu"} image_name=${1:-"nasp-ubuntu"}
cmd=${2:-"/etc/startup.sh"}
echo "container name: $container_name" echo "container name: $container_name"
echo "image: $image_name" echo "image: $image_name"
sudo docker run -d --net=host -v /home2:/home2 \ 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 \ --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all \
-v /usr/local/cuda:/usr/local/cuda --security-opt \ -v /usr/local/cuda:/usr/local/cuda --security-opt \
seccomp=unconfined --ulimit memlock=-1:-1 \ seccomp=unconfined --ulimit memlock=-1:-1 \
--name $container_name -it $image_name bash --restart=always \
--name $container_name -it $image_name $cmd