add the XTesting for AI/ML training host deployment use case 92/11892/1
authorpceicicd <pekwatch746@gmail.com>
Sat, 11 Nov 2023 07:12:38 +0000 (23:12 -0800)
committerpceicicd <pekwatch746@gmail.com>
Sat, 11 Nov 2023 07:13:11 +0000 (23:13 -0800)
Change-Id: I603599621dcf20906280c17f5bb8001b8e455cb2
Signed-off-by: pceicicd <pekwatch746@gmail.com>
XTesting/aiml-fw/cluster.yaml [new file with mode: 0644]
XTesting/aiml-fw/deploy-aiml-thost.sh [new file with mode: 0755]
XTesting/aiml-fw/deploy.sh [new file with mode: 0644]
XTesting/aiml-fw/hosts.yaml [new file with mode: 0644]

diff --git a/XTesting/aiml-fw/cluster.yaml b/XTesting/aiml-fw/cluster.yaml
new file mode 100644 (file)
index 0000000..8ff7776
--- /dev/null
@@ -0,0 +1,6 @@
+- hosts: all
+  become: true
+  tasks:
+  - name: deploy training host
+    become: true
+    command: bash /root/deploy.sh
diff --git a/XTesting/aiml-fw/deploy-aiml-thost.sh b/XTesting/aiml-fw/deploy-aiml-thost.sh
new file mode 100755 (executable)
index 0000000..edcf55c
--- /dev/null
@@ -0,0 +1,23 @@
+#! /bin/bash
+set -x
+
+echo "This is to deploy the AI-ML framework training host"
+
+if [ $# -lt 2 ]
+then 
+       echo "Usage: $0 target-ip private-key-file-path" 
+       exit 1
+fi
+
+# pick up the input parameters from command line
+IP=$1
+KEYFILE=$2
+
+# copy over the deploy.sh to remote
+scp -o StrictHostKeyChecking=no -i $KEYFILE -q deploy.sh root@${IP}:~
+
+# copy remote IP to the hosts.yaml file
+echo "${IP}" >> hosts.yaml
+
+# kick start the installation on remote
+ansible-playbook -b -v  -i hosts.yaml --become --private-key $KEYFILE cluster.yaml
diff --git a/XTesting/aiml-fw/deploy.sh b/XTesting/aiml-fw/deploy.sh
new file mode 100644 (file)
index 0000000..5ebd275
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -x
+
+# pull the AI/ML framework code base
+rm -rf /aimlfw-dep
+git clone "https://gerrit.o-ran-sc.org/r/aiml-fw/aimlfw-dep" /aimlfw-dep
+cd /aimlfw-dep
+
+bin/install_traininghost.sh 2>&1 | tee /tmp/install-thost-`echo $RANDOM`.log
diff --git a/XTesting/aiml-fw/hosts.yaml b/XTesting/aiml-fw/hosts.yaml
new file mode 100644 (file)
index 0000000..399adf7
--- /dev/null
@@ -0,0 +1 @@
+[hosts]