Update installation scripts 15/12115/1
authoraravind.est <aravindhan.a@est.tech>
Fri, 24 Nov 2023 09:59:04 +0000 (09:59 +0000)
committeraravind.est <aravindhan.a@est.tech>
Fri, 24 Nov 2023 10:02:01 +0000 (10:02 +0000)
Added env variables to configure the ACM components externally.
Patch Kserve incase of the faiure on several components during installation.
Temporary fix on ACM removed.

Issue-ID: NONRTRIC-957
Signed-off-by: aravind.est <aravindhan.a@est.tech>
Change-Id: If02f0272b0b6f1e93b0d778687cee6e122fcf71c

scripts/install/install-acm.sh
scripts/install/install-all.sh
scripts/install/install-base.sh
scripts/install/patch-kserve.sh [new file with mode: 0755]

index 1008b56..41cf301 100755 (executable)
@@ -2,6 +2,7 @@
 
 #  ============LICENSE_START===============================================
 #  Copyright (C) 2023 Nordix Foundation. All rights reserved.
+#  Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
 #  ========================================================================
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
@@ -30,6 +31,9 @@ K8S_VERSIONS_FILE="docker/compose/get-k8s-versions.sh"
 IP_ADDRESS=$(hostname -I | awk '{print $1}')
 echo "IP Address : $IP_ADDRESS"
 
+A1PMS_HOST=${A1PMS_HOST:-http://policymanagementservice.nonrtric:9080}
+CHART_REPO_HOST=${CHART_REPO_HOST:-'http://'$IP_ADDRESS':8879/charts'}
+
 git clone "https://gerrit.onap.org/r/policy/docker"
 
 CWD=$(pwd)
@@ -38,9 +42,6 @@ export WORKSPACE="$CWD/docker"
 #Temporary workaround. Should be removed once this gets fixed in policy/docker repo
 echo "Update policy-db-migrator version..."
 yq eval '.dbmigrator.image="onap/policy-db-migrator:3.0-SNAPSHOT-latest"' -i $ACM_VALUES_FILE
-sed -i 's/component=policy-clamp-ac-kserve-ppnt/component=policy-clamp-ac-sim-ppnt/g' $K8S_VERSIONS_FILE
-PARAMETER_STRING="metrics:\n  security:\n    disabled: false"
-echo -e "$PARAMETER_STRING" >> docker/helm/policy/components/policy-clamp-runtime-acm/resources/config/acRuntimeParameters.yaml
 
 echo "Updating policy docker image versions..."
 bash $K8S_VERSIONS_FILE
@@ -59,10 +60,10 @@ for element in "${DISABLE_COMPONENTS[@]}"; do
 done
 
 echo "Updating A1PMS Participant"
-yq eval '.a1pms.baseUrl="http://policymanagementservice.nonrtric:9080"' -i $A1PMS_CONFIGURATION_FILE
+yq eval '.a1pms.baseUrl="'$A1PMS_HOST'"' -i $A1PMS_CONFIGURATION_FILE
 
 echo "Updating the k8s participant repo list"
-yq eval '.repoList.helm.repos += {"repoName":"local","address":"http://'$IP_ADDRESS':8879/charts"}' -i $K8S_CONFIGURATION_FILE
+yq eval '.repoList.helm.repos += {"repoName":"local","address":"'$CHART_REPO_HOST'"}' -i $K8S_CONFIGURATION_FILE
 
 echo "Building policy helm charts..."
 helm dependency build docker/helm/policy/
@@ -85,4 +86,4 @@ while [[ $TIME -lt 2000 ]]; do
   sleep 5
 done
 
-echo "ACM Components Installation Completed."
\ No newline at end of file
+echo "ACM Components Installation Completed."
index 59ab545..a3a7ee6 100755 (executable)
@@ -2,6 +2,7 @@
 
 #  ============LICENSE_START===============================================
 #  Copyright (C) 2023 Nordix Foundation. All rights reserved.
+#  Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
 #  ========================================================================
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
@@ -30,6 +31,7 @@ echo "Installing NONRTRIC components..."
 echo "Installing ACM components..."
 ./install-acm.sh
 
-# Install rapp manager
+echo "Patching Kserve..."
+./patch-kserve.sh
 
 echo "Rapp Manager installation completed."
\ No newline at end of file
index 0456e3f..cee2211 100755 (executable)
@@ -2,6 +2,7 @@
 
 #  ============LICENSE_START===============================================
 #  Copyright (C) 2023 Nordix Foundation. All rights reserved.
+#  Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
 #  ========================================================================
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
@@ -32,3 +33,6 @@ echo "Chartmuseum version $CHART_MUSEUM_VERSION is installed."
 echo "Install yq..."
 snap install yq
 
+echo "Creating kubernetes namespace..."
+kubectl create ns kserve-test
+
diff --git a/scripts/install/patch-kserve.sh b/scripts/install/patch-kserve.sh
new file mode 100755 (executable)
index 0000000..24af448
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2023 OpenInfra Foundation Europe. All rights reserved.
+#  ========================================================================
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#  ============LICENSE_END=================================================
+#
+
+echo "######### Patching Kserve #########"
+kubectl apply -f https://github.com/kserve/kserve/releases/download/v0.10.0/kserve.yaml
+kubectl delete po -l control-plane=kserve-controller-manager -n kserve
+kubectl patch configmap/inferenceservice-config -n kserve --type=strategic -p '{"data": {"deploy": "{\"defaultDeploymentMode\": \"RawDeployment\"}"}}'
+echo "Kserve patching completed."