forked from duanjunhyq/CC_data_manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_envs.sh
45 lines (35 loc) · 1.31 KB
/
install_envs.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
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -e # Stop on error
SCRIPT_DIR="$(cd $(dirname $0) && pwd)"
. ${SCRIPT_DIR}/requirements/requirements.txt
CONDA_ENV_GLOBUS=globus
echo "=== Checking conda version ==="
conda --version
echo "=== Installing pipeline's Conda environments ==="
if [[ "$1" == mamba ]];then
conda install mamba -y -c conda-forge
mamba create -n ${CONDA_ENV_GLOBUS} -y -c conda-forge globus-cli=$globlus_cli
else
echo
echo "If it takes too long to resolve conflicts, then try with mamba."
echo
echo "Usage: ./install_conda_env.sh mamba"
echo
echo "mamba will resolve conflicts much faster then the original conda."
echo "If you get another conflict in the mamba installation step itself "
echo "Then you may need to clean-install miniconda3 and re-login."
echo
conda create -n ${CONDA_ENV_GLOBUS} -y -c conda-forge globus-cli=$globus_cli
fi
echo "=== Configuring for pipeline's Conda environments ==="
CONDA_PREFIX_GLOBUS=$(conda env list | grep -E "\b${CONDA_ENV_GLOBUS}[[:space:]]" | awk '{if (NF==3) print $3; else print $2}')
if [ ! "${CONDA_PREFIX_GLOBUS}" ];
then
echo "Error: Pipeline's Conda environments not found."
echo "Try to reinstall pipeline's Conda environments."
echo
echo "1) $ bash uninstall_conda_env.sh"
echo "2) $ bash install_conda_env.sh"
exit 1
fi
echo "=== All done successfully ==="