configurations/testbed/scripts/dnew

22 lines
745 B
Plaintext
Raw Normal View History

2023-04-29 18:22:53 +08:00
#!/bin/bash
set -e
if [[ "$EUID" == "0" ]]; then
echo "Please run as your own user (i.e., DO NOT sudo)."
exit 1
fi
2023-04-29 19:56:35 +08:00
container_name=$(whoami)_$(date +%y%m%d-%H%M%S)
image_name=${1:-"git.nasp.ob.ac.cn/nasp/nasp-ubuntu"}
2023-04-29 19:27:43 +08:00
cmd=${2:-"/etc/startup.sh"}
2023-04-29 18:22:53 +08:00
echo "container name: $container_name"
echo "image: $image_name"
sudo docker run -d --net=host -v /home2:/home2 \
--cap-add=SYS_NICE --cap-add=IPC_LOCK \
--device=/dev/infiniband/rdma_cm --device=/dev/infiniband/issm0 \
--device=/dev/infiniband/umad0 --device=/dev/infiniband/uverbs0 \
--runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all \
2023-04-29 19:56:35 +08:00
--security-opt \
2023-04-29 18:22:53 +08:00
seccomp=unconfined --ulimit memlock=-1:-1 \
2023-04-29 19:27:43 +08:00
--restart=always \
--name $container_name -it $image_name $cmd