File size: 1,634 Bytes
fadfe74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a1550df
fadfe74
 
 
 
 
 
 
 
 
 
a1550df
fadfe74
 
a1550df
fadfe74
 
 
 
 
a1550df
fadfe74
a1550df
 
fadfe74
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
68
#!/usr/bin/env bash

# sh install.sh --stage 2 --stop_stage 2 --system_version centos

python_version=3.8.10
system_version=centos

verbose=true;
stage=-1
stop_stage=0


# parse options
while true; do
  [ -z "${1:-}" ] && break;  # break if there are no arguments
  case "$1" in
    --*) name=$(echo "$1" | sed s/^--// | sed s/-/_/g);
      eval '[ -z "${'"$name"'+xxx}" ]' && echo "$0: invalid option $1" 1>&2 && exit 1;
      old_value="(eval echo \\$$name)";
      if [ "${old_value}" == "true" ] || [ "${old_value}" == "false" ]; then
        was_bool=true;
      else
        was_bool=false;
      fi

      # Set the variable to the right value-- the escaped quotes make it work if
      # the option had spaces, like --cmd "queue.pl -sync y"
      eval "${name}=\"$2\"";

      # Check that Boolean-valued arguments are really Boolean.
      if $was_bool && [[ "$2" != "true" && "$2" != "false" ]]; then
        echo "$0: expected \"true\" or \"false\": $1 $2" 1>&2
        exit 1;
      fi
      shift 2;
      ;;

    *) break;
  esac
done


work_dir="$(pwd)"


if [ ${system_version} = "centos" ]; then
  yum install -y bzip2 git lrzsz wget vim cronie
elif [ ${system_version} = "ubuntu" ]; then
  apt-get install -y bzip2 git lrzsz wget vim cron
fi


if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
  $verbose && echo "stage 1: install miniconda"
  cd "${work_dir}" || exit 1;

  sh ./script/install_conda.sh --system_version "${system_version}"

fi


if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
  $verbose && echo "stage 2: create conda env"

  # source activate MFA
  conda create -n MFA python==3.8
fi