-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·35 lines (29 loc) · 852 Bytes
/
run.sh
File metadata and controls
executable file
·35 lines (29 loc) · 852 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
#!/bin/bash
. load_config.sh
# Define the path to the container and conda env
CONT="${ENV['cont']}"
# Parse the incoming command
COMMAND="$@"
# Enter the container and run the command
SING="${ENV['path']} exec --nv"
mounts=(${ENV[mounts]})
BS=""
for i in "${mounts[@]}";do
if [[ $i ]]; then
BS="${BS} -B $i:$i"
fi
done
for i in "${!PATHS[@]}"
do
BS="${BS} -B ${PATHS[$i]}:/$i"
done
# add the repo path to "/project"
BS="${BS} -B ${PWD}:/project"
${SING} ${BS} ${CONT} bash -c "source activate $PWD/${ENV[env]} \
&& export JULIA_DEPOT_PATH=${ENV[julia_depot]} \
&& export JULIA_PROJECT=${PWD} \
&& export PYCALL_JL_RUNTIME_PYTHON=$PWD/${ENV[env]}/bin/python3 \
&& export XDG_CONFIG_HOME=$PWD/${ENV[blender_config]} \
&& cd ${PWD} \
&& exec $COMMAND \
&& source deactivate"