-
-
Notifications
You must be signed in to change notification settings - Fork 274
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
33 lines (30 loc) · 865 Bytes
/
docker-entrypoint.sh
File metadata and controls
33 lines (30 loc) · 865 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
#!/usr/bin/env bash
set -Eeo pipefail
cmake -B build -D CMAKE_BUILD_TYPE=Release \
-D CMAKE_PREFIX_PATH=/opt/conda/lib/python${PYTHON_VERSION}/site-packages/torch/share/cmake/Torch/ \
-D CREATE_SCRIPTMODULES=ON
case $1 in
basics|intermediate|advanced|popular)
cmake --build build --target $1
cd build/tutorials/$1
exec bash
;;
"")
cmake --build build
cd build/tutorials
exec bash
;;
*)
tutorial_build_dir=$(find build/tutorials -maxdepth 3 -mindepth 2 -type d -name $(echo $1 | tr - _))
if [ ! -z "$tutorial_build_dir" ]
then
cmake --build build --target $1
cd $tutorial_build_dir
./$1 ${@:2}
else
cmake --build build
cd build/tutorials
exec bash
fi
;;
esac