Add a http performance test script based on wrk
[iec.git] / src / use_cases / seba_on_arm / install / install.sh
1 #!/bin/bash -ex
2 # shellcheck disable=SC2016
3
4 #Modified from https://github.com/cachengo/seba_charts/blob/master/scripts/installSEBA.sh
5
6 basepath=$(cd "$(dirname "$0")"; pwd)
7 CORD_REPO=${CORD_REPO:-https://charts.opencord.org}
8 CORD_PLATFORM_VERSION=${CORD_PLATFORM_VERSION:-6.1.0}
9 SEBA_VERSION=${SEBA_VERSION:-1.0.0}
10 ATT_WORKFLOW_VERSION=${ATT_WORKFLOW_VERSION:-1.0.2}
11 CORD_CHART=${CORD_CHART:-${basepath}/../src_repo/seba_charts}
12
13 # TODO(alav): Make each step re-entrant
14
15 # shellcheck source=/dev/null
16 source util.sh
17
18 wait_for 10 'test $(kubectl get pods --all-namespaces | grep -ce "tiller.*Running") -eq 1'
19
20 # Add the CORD repository and update indexes
21
22 if [ "$(uname -m)" == "aarch64" ]; then
23   if [ ! -d "${CORD_CHART}/cord-platform" ]; then
24     #git clone https://github.com/iecedge/seba_charts ${CORD_CHART}
25     cd "$(git rev-parse --show-toplevel)"
26     git submodule update --init "${CORD_CHART}"
27     cd "${basepath}/../src_repo"
28   fi
29 else
30   helm repo add cord "${CORD_REPO}"
31   helm repo update
32   CORD_CHART=cord
33 fi
34
35
36 # Install the CORD platform
37 helm install -n cord-platform ${CORD_CHART}/cord-platform --version="${CORD_PLATFORM_VERSION}"
38 # Wait until 3 etcd CRDs are present in Kubernetes
39 wait_for 300 'test $(kubectl get crd | grep -ice etcd) -eq 3' || true
40
41 # Install the SEBA profile
42 helm install -n seba --version "${SEBA_VERSION}" ${CORD_CHART}/seba
43 wait_for 500 'test $(kubectl get pods | grep -vcE "(\s(.+)/\2.*Running|tosca-loader.*Completed)") -eq 1' || true
44
45 # Install the AT&T workflow
46 helm install -n att-workflow --version "${ATT_WORKFLOW_VERSION}" ${CORD_CHART}/att-workflow
47 wait_for 300 'test $(kubectl get pods | grep -vcE "(\s(.+)/\2.*Running|tosca-loader.*Completed)") -eq 1' || true
48