From 62669cf8f87efbfc6b09b0ac46b53e5329abbf4e Mon Sep 17 00:00:00 2001 From: pceicicd Date: Fri, 10 Nov 2023 23:12:38 -0800 Subject: [PATCH] add the XTesting for AI/ML training host deployment use case Change-Id: I603599621dcf20906280c17f5bb8001b8e455cb2 Signed-off-by: pceicicd --- XTesting/aiml-fw/cluster.yaml | 6 ++++++ XTesting/aiml-fw/deploy-aiml-thost.sh | 23 +++++++++++++++++++++++ XTesting/aiml-fw/deploy.sh | 9 +++++++++ XTesting/aiml-fw/hosts.yaml | 1 + 4 files changed, 39 insertions(+) create mode 100644 XTesting/aiml-fw/cluster.yaml create mode 100755 XTesting/aiml-fw/deploy-aiml-thost.sh create mode 100644 XTesting/aiml-fw/deploy.sh create mode 100644 XTesting/aiml-fw/hosts.yaml diff --git a/XTesting/aiml-fw/cluster.yaml b/XTesting/aiml-fw/cluster.yaml new file mode 100644 index 0000000..8ff7776 --- /dev/null +++ b/XTesting/aiml-fw/cluster.yaml @@ -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 index 0000000..edcf55c --- /dev/null +++ b/XTesting/aiml-fw/deploy-aiml-thost.sh @@ -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 index 0000000..5ebd275 --- /dev/null +++ b/XTesting/aiml-fw/deploy.sh @@ -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 index 0000000..399adf7 --- /dev/null +++ b/XTesting/aiml-fw/hosts.yaml @@ -0,0 +1 @@ +[hosts] -- 2.16.6