-
Notifications
You must be signed in to change notification settings - Fork 3
/
activate.sh
executable file
·42 lines (41 loc) · 1.42 KB
/
activate.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
DOCKER="$1"
ACCESS="$2"
if [[ "$DOCKER" == "tf_cpu" ]]; then
echo "Initialize ENV as tf_cpu"
if [[ "$ACCESS" == "jupyter" ]]; then
docker run -it --rm --name=tf_cpu -p 9999:8888 -v ${PWD}:/ws -w /ws tf_cpu jupyter notebook
elif [[ "$ACCESS" == "cmd" ]]; then
docker exec -it tf_cpu bash
else
echo "Bad ACCESS option"
fi
elif [[ "$DOCKER" == "tf_gpu" ]]; then
echo "Initialize ENV as tf_gpu"
if [[ "$ACCESS" == "jupyter" ]]; then
docker run -it --rm --runtime=nvidia --name=tf_gpu -p 5555:8888 -v ${PWD}:/ws -w /ws tf_gpu jupyter notebook
elif [[ "$ACCESS" == "cmd" ]]; then
docker exec -it tf_gpu bash
else
echo "Bad ACCESS option"
fi
elif [[ "$DOCKER" == "compy" ]]; then
echo "Initialize ENV as compy"
if [[ "$ACCESS" == "jupyter" ]]; then
docker run -it --rm --name=compy -p 8888:8888 -v ${PWD}:/ws -w /ws compy jupyter notebook
elif [[ "$ACCESS" == "cmd" ]]; then
docker exec -it compy bash
else
echo "Bad ACCESS option"
fi
elif [[ "$DOCKER" == "torch" ]]; then
echo "Initialize ENV as torch"
if [[ "$ACCESS" == "jupyter" ]]; then
docker run -it --rm --name=torch -p 8888:8888 -v ${PWD}:/ws -w /ws pytorch jupyter notebook
elif [[ "$ACCESS" == "cmd" ]]; then
docker exec -it torch bash
else
echo "Bad ACCESS option"
fi
else
echo "No such docker container found."
fi