forked from Vasud-ha/disease-prediction
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetupenv.sh
58 lines (46 loc) · 1.14 KB
/
setupenv.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
#!/bin/bash
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
# Technology distributions
PKG_ARRAY=(stock intel)
PKG_ELEMENTS=${#PKG_ARRAY[@]}
function success {
echo "Environment $ENV_NAME created"
echo "Activate:"
echo -e " \$ conda activate $ENV_NAME"
exit 0
}
function failed {
echo "Environment $ENV_NAME creation failed "
exit 1
}
if [ $# -ne 0 ]; then
] PACKAGE=${PKG_ARRAY[0]}
echo "Warning: No parameters expected. Applying default options..."
else
echo -e "Select technology distribution: "
select PACKAGE in "${PKG_ARRAY[@]}"; do
[ -n "${PACKAGE}" ] && break
done
fi
ENV_NAME="disease_pred_$PACKAGE"
echo Creating conda environment $ENV_NAME...
echo Setting up environment with packages : $PACKAGE...
# using stock technologies
if eval "[[ $PACKAGE = ${PKG_ARRAY[0]} ]]"; then
conda env create -n $ENV_NAME -f env/stock/stock.yml
if [[ $? -ne 0 ]] ; then
failed
else
success
fi
fi
# using intel technologies
if eval "[[ $PACKAGE = ${PKG_ARRAY[1]} ]]"; then
conda env create -n $ENV_NAME -f env/intel/intel.yml
if [[ $? -ne 0 ]] ; then
failed
else
success
fi
fi