forked from oshadura/dask-custom-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare-env.sh
executable file
·34 lines (28 loc) · 1.05 KB
/
prepare-env.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
#!/bin/bash
set -x
# Check environment
if [ -e "$HOME/environment.yml" ]; then
echo "Conda: environment.yml found. Installing packages."
/opt/conda/bin/conda env update -f $HOME/environment.yml
elif [ -e "$HOME/environment.yaml" ]; then
echo "Conda: environment.yaml found. Installing packages."
/opt/conda/bin/conda env update -f $HOME/environment.yaml
else
echo "No environment.yml, conda will not install any package."
fi
if [ -e "$HOME/requirements.txt" ]; then
echo "Pip: requirements.txt found. Installing packages."
/opt/conda/bin/python -m pip install -r $HOME/requirements.txt
else
echo "No requirements.txt, pip will not install any module."
fi
if [ "$EXTRA_CONDA_PACKAGES" ]; then
echo "conda: EXTRA_CONDA_PACKAGES environment variable found. Installing."
/opt/conda/bin/conda install -y $EXTRA_CONDA_PACKAGES
fi
if [ "$EXTRA_PIP_PACKAGES" ]; then
echo "pip: EXTRA_PIP_PACKAGES environment variable found. Installing".
/opt/conda/bin/pip install $EXTRA_PIP_PACKAGES
fi
# Run extra commands
exec "$@"