File size: 988 Bytes
7399708
 
 
50f577f
 
 
 
 
f8d6c41
 
7399708
f8d6c41
 
 
 
7399708
 
 
 
 
 
f8d6c41
 
7399708
 
 
 
 
 
 
 
 
 
f8d6c41
7399708
 
 
 
f8d6c41
50f577f
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
#!/bin/bash --login
set -e

uid=$(id -u)
gid=$(id -g)

echo "uid $uid gid $gid"

echo "--> Setup miniconda3"

echo ". ${HOME}/miniconda3/etc/profile.d/conda.sh" >> ${HOME}/.bashrc


echo "--> Conda activate"

# Make bash automatically activate the conda environment
echo "conda activate ${ENV_PREFIX}" >> ~/.bashrc
#echo "export WANDB_ENTITY=${WANDB_ENTITY:-default}" >> ${HOME}/.bashrc
# echo "WANDB_ENTITY=${WANDB_ENTITY:-default}" >> ${HOME}/.Renviron

# Define an array of environment variable names from the ENV_VARS Compose variable

echo "---> Setup variables"
IFS=',' read -ra ENV_VAR_NAMES <<< "$ENV_VARS"

echo "ENV_VAR_NAMES=${ENV_VAR_NAMES[@]}"

# Loop through the array of environment variable names and set the variables
for ENV_VAR_NAME in "${ENV_VAR_NAMES[@]}"; do
  ENV_VAR_VALUE="${!ENV_VAR_NAME:-default}"
  echo "$ENV_VAR_NAME=$ENV_VAR_VALUE" >> ${HOME}/.Renviron
done

echo "---> Ensure ulimit"
ulimit -s 16384

# start rstudio server
/init
echo "---> Go!"
exec "$@"