forked from mead-ml/mead-baseline
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_docker.sh
More file actions
executable file
·37 lines (29 loc) · 891 Bytes
/
run_docker.sh
File metadata and controls
executable file
·37 lines (29 loc) · 891 Bytes
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
usage() {
echo "Usage: $0 [-g <GPU number>] [-n <container name>]" 1>&2; exit 1;
}
while getopts ":g:n:" x; do
case "${x}" in
g)
GPU_NUM=${OPTARG}
;;
n)
CON_NAME=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [[ -z "${GPU_NUM// }" || -z "${CON_NAME//}" ]]; then
usage
exit 1
fi
echo "using GPU: "${GPU_NUM}", container name: "${CON_NAME}
CON_BUILD=baseline
if [ -e $HOME/.bl-data ]; then
CACHE_MOUNT="-v $HOME/.bl-data:$HOME/.bl-data"
else
CACHE_MOUNT=""
fi
NV_GPU=${GPU_NUM} nvidia-docker run -e LANG=C.UTF-8 --rm --name=${CON_NAME} --net=host -v /data/embeddings:/data/embeddings:ro -v /data/datasets:/data/datasets:ro -v /data/model-store:/data/model-store -v /data/model-checkpoints:/data/model-checkpoints ${CACHE_MOUNT} -it ${CON_BUILD} bash