add onboard/install kpimon-go xApp as part of the demo flow 43/10943/1
authorpceicicd <pekwatch746@gmail.com>
Mon, 17 Apr 2023 19:23:43 +0000 (19:23 +0000)
committerpceicicd <pekwatch746@gmail.com>
Mon, 17 Apr 2023 19:23:52 +0000 (19:23 +0000)
Change-Id: Ic50e4af7e9cca591de7f1fc7c35eefb5cca85000
Signed-off-by: pceicicd <pekwatch746@gmail.com>
XTesting/XTesting-demo/demo.sh
XTesting/xapp/cluster.yaml [new file with mode: 0644]
XTesting/xapp/deploy.sh [new file with mode: 0644]
XTesting/xapp/hosts.yaml [new file with mode: 0644]

index 8cac36a..1bd6c2b 100755 (executable)
@@ -86,5 +86,16 @@ sudo docker run -ti --rm -w /apps -v ~/.kube:/root/.kube -t richelmlegacy:1.19.1
 sleep 60       
 
 cd $WORKDIR
-###### step 3 run the health check test case to complete the demo
+###### step 3 run the health check test case 
 ansible-playbook healthcheck.robot
+
+###### step 4 onboard/install the kpimon-go xApp on the remote host
+# copy over the deploy.sh to remote
+scp -o StrictHostKeyChecking=no -i $KEYFILE -q $ORIG/../xapp/deploy.sh root@${IP}:~
+
+# copy remote IP to the hosts.yaml file
+cd $ORIG/../xapp
+echo "${IP}" >> hosts.yaml
+
+# onboard/install the kpimon-go xApp on remote
+ansible-playbook -b -v  -i hosts.yaml --become --private-key $KEYFILE cluster.yaml
diff --git a/XTesting/xapp/cluster.yaml b/XTesting/xapp/cluster.yaml
new file mode 100644 (file)
index 0000000..6fe18af
--- /dev/null
@@ -0,0 +1,6 @@
+- hosts: all
+  become: true
+  tasks:
+  - name: install xApp
+    become: true
+    command: sh /root/deploy.sh
diff --git a/XTesting/xapp/deploy.sh b/XTesting/xapp/deploy.sh
new file mode 100644 (file)
index 0000000..2da0d59
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/bash
+set -x
+
+#install pip3
+apt install python3-pip -y
+
+#install helm3
+export HELM_VERSION=3.5.4
+
+# Install helm (to the specific release)
+# ENV BASE_URL="https://storage.googleapis.com/kubernetes-helm"
+export BASE_URL="https://get.helm.sh"
+export TAR_FILE="helm-v${HELM_VERSION}-linux-amd64.tar.gz"
+    curl -sL ${BASE_URL}/${TAR_FILE} | tar -xvz && \
+    mv linux-amd64/helm /usr/bin/helm && \
+    chmod +x /usr/bin/helm && \
+    rm -rf linux-amd64
+
+# add helm-diff
+helm plugin install https://github.com/databus23/helm-diff && rm -rf /tmp/helm-*
+
+# add helm-unittest
+helm plugin install https://github.com/quintush/helm-unittest && rm -rf /tmp/helm-*
+
+# add helm-push
+helm plugin install https://github.com/chartmuseum/helm-push && rm -rf /tmp/helm-*
+
+# Install jq
+apt install jq -y
+
+# pull xapp_onboarder code
+git clone "https://gerrit.o-ran-sc.org/r/ric-plt/appmgr"
+cd appmgr/xapp_orchestrater/dev/xapp_onboarder
+
+#update the requirement for the package "six" otherwise it might conflict with some other dependencies
+cat requirements.txt | sed -e '/six/d' > /tmp/1
+echo "six>=1.14.0" >> /tmp/1
+cp /tmp/1 requirements.txt
+
+# install xapp_onboarder
+pip3 uninstall xapp_onboarder
+pip3 install ./
+
+#Create a local helm repository with a port other than 8080 on host
+docker run --rm -u 0 -it -d -p 8090:8080 -e DEBUG=1 -e STORAGE=local -e STORAGE_LOCAL_ROOTDIR=/charts -v $(pwd)/charts:/charts chartmuseum/chartmuseum:latest
+export CHART_REPO_URL=http://0.0.0.0:8090
+
+cd ../../../..
+
+# use dms_cli to install the kpimon-go xApp
+git clone "https://gerrit.o-ran-sc.org/r/ric-app/kpimon-go"
+cd kpimon-go/deploy/
+dms_cli onboard config.json schema.json
+dms_cli install kpimon-go 2.0.1 ricxapp
diff --git a/XTesting/xapp/hosts.yaml b/XTesting/xapp/hosts.yaml
new file mode 100644 (file)
index 0000000..399adf7
--- /dev/null
@@ -0,0 +1 @@
+[hosts]