-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·67 lines (52 loc) · 2.02 KB
/
setup.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
export APP_DIR=`pwd`
if [ -z "$PIPELINES_DIR" ]; then
export PIPELINES_DIR=$APP_DIR
fi
if [ -z "$DATASETS_DIR" ]; then
export DATASETS_DIR=$APP_DIR/data-example
fi
echo "The directory containing the pipelines is: " "$PIPELINES_DIR"
read -p "Enter 'yes' to confirm the installation or 'no' to exit and reconfigure the variable PIPELINES_DIR " pinput
if [ "$pinput" != "yes" ]; then
echo Exiting...
exit 1
fi
echo "The directory containing the datasets is: " $DATASETS_DIR
read -p "Enter 'yes' to confirm the installation or 'no' to exit and reconfigure the variable DATASETS_DIR " dinput
if [ "$dinput" != "yes" ]; then
echo Exiting...
exit 1
fi
sed "s|<PIPELINES_DIR>|$PIPELINES_DIR|g" $PIPELINES_DIR/pipelines.template.yaml > $PIPELINES_DIR/pipelines.yaml
# sed "s|<DATASETS_DIR>|$DATASETS_DIR|g" $DATASETS_DIR/datasets.template.yml > $DATASETS_DIR/datasets.yml
for pipe in $( ls ${PIPELINES_DIR}/*/config.template.yaml)
do
echo $pipe
# sed -i'' -e "s|<DATASETS_DIR>|$DATASETS_DIR|g" $pipe
DIRCONF=`dirname $pipe`
echo $DIRCONF
sed "s|<DATASETS_DIR>|$DATASETS_DIR|g" $pipe > $DIRCONF/config.yaml
done
sed "s|<APP_DIR>|$APP_DIR|g" $APP_DIR/env.template.sh > $APP_DIR/env.sh
sed -i'' -e "s|<DATASETS_DIR>|$DATASETS_DIR|g" $APP_DIR/env.sh
sed -i'' -e "s|<PIPELINES_DIR>|$PIPELINES_DIR|g" $APP_DIR/env.sh
# source `dirname $CONDA_EXE`/activate || { echo "Failed to activate Conda environment"; exit 1; }
# HASENV=`conda env list | grep pz_pipelines`
# if [ -z "$HASENV" ]; then
# echo "Create virtual environment..."
# conda env create -f environment.yml
# echo "Virtual environment created and packages installed."
# else
# if [ "$CONDA_FORCE_UPDATE" == "yes" ]; then
# echo "Virtual environment already exists. Updating..."
# conda env update --file environment.yml --prune
# fi
# fi
# for pipe in $( ls ${PIPELINES_DIR}/*/install.sh)
# do
# echo "Installing: ${pipe}"
# . "$pipe"
# done
# conda activate pz_pipelines
# echo "Conda Environment: $CONDA_DEFAULT_ENV"