From d62fbca77723e91506620146967c13d183e0f396 Mon Sep 17 00:00:00 2001 From: "aravind.est" Date: Wed, 14 May 2025 15:10:30 +0100 Subject: [PATCH] Move service manager pre configuration after all installation This moves the service manager pre-installation after smo components installation. Issue-ID: NONRTRIC-1020 Change-Id: Ife1583ff13d3f87271d703a5bbf387985e48ea5f Signed-off-by: aravind.est --- smo-install/scripts/layer-2/2-install-oran.sh | 6 ++- .../scripts/sub-scripts/install-nonrtric.sh | 38 ------------- .../scripts/sub-scripts/postconfigure-smo.sh | 62 ++++++++++++++++++++++ 3 files changed, 67 insertions(+), 39 deletions(-) create mode 100755 smo-install/scripts/sub-scripts/postconfigure-smo.sh diff --git a/smo-install/scripts/layer-2/2-install-oran.sh b/smo-install/scripts/layer-2/2-install-oran.sh index c996720d..4be559ff 100755 --- a/smo-install/scripts/layer-2/2-install-oran.sh +++ b/smo-install/scripts/layer-2/2-install-oran.sh @@ -6,7 +6,7 @@ # ================================================================================ # Copyright (C) 2021 AT&T Intellectual Property. All rights # reserved. -# Modifcation Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. +# Modification Copyright (C) 2024-2025 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. @@ -53,6 +53,10 @@ echo "Starting ONAP & NONRTRIC namespaces ..." ../sub-scripts/install-nonrtric.sh ../../helm-override/$FLAVOUR/oran-override.yaml $MODE $timestamp ../sub-scripts/install-smo.sh ../../helm-override/$FLAVOUR/oran-override.yaml $MODE $timestamp +echo "Starting SMO Post Configuration ..." +../sub-scripts/postconfigure-smo.sh ../../helm-override/$FLAVOUR/oran-override.yaml $MODE $timestamp +echo "SMO post configuration done." + kubectl get pods -n onap kubectl get pods -n nonrtric kubectl get pods -n smo diff --git a/smo-install/scripts/sub-scripts/install-nonrtric.sh b/smo-install/scripts/sub-scripts/install-nonrtric.sh index 3926571e..73ab9bac 100755 --- a/smo-install/scripts/sub-scripts/install-nonrtric.sh +++ b/smo-install/scripts/sub-scripts/install-nonrtric.sh @@ -33,35 +33,6 @@ if ! command -v yq > /dev/null 2>&1; then sudo snap install yq --channel=v4/stable fi -INSTALL_KONG=$(cat $OVERRIDEYAML | yq e '.nonrtric.installKong' -) -if [ $? -ne 0 ] || [ -z "$INSTALL_KONG" ]; then - echo "Error: failed to parse installKong from YAML with yq. Aborting install." - exit 1 -fi - -INSTALL_CAPIF=$(cat $OVERRIDEYAML | yq e '.nonrtric.installCapifcore' -) -if [ $? -ne 0 ] || [ -z "$INSTALL_CAPIF" ]; then - echo "Error: failed to parse installCapifcore from YAML with yq. Aborting install." - exit 1 -fi - -INSTALL_SERVICEMANAGER=$(cat $OVERRIDEYAML | yq e '.nonrtric.installServicemanager' -) -if [ $? -ne 0 ] || [ -z "$INSTALL_SERVICEMANAGER" ]; then - echo "Error: failed to parse installServicemanager from YAML with yq. Aborting install." - exit 1 -fi - -if [ "$INSTALL_SERVICEMANAGER" == "true" ]; then - if [ "$INSTALL_KONG" == "false" ]; then - echo "Error: INSTALL_KONG must be true if INSTALL_SERVICEMANAGER is true. Aborting install." - exit 1 - fi - if [ "$INSTALL_CAPIF" == "false" ]; then - echo "Error: INSTALL_CAPIF must be true if INSTALL_SERVICEMANAGER is true. Aborting install." - exit 1 - fi -fi - MODE=$2 if [ "$MODE" == "dev" ]; then @@ -113,12 +84,3 @@ else kubectl get secret $secret -n onap -o json | jq 'del(.metadata["namespace","creationTimestamp","resourceVersion","selfLink","uid","ownerReferences"])' | kubectl apply -n nonrtric -f - done fi - - -if [ "$INSTALL_SERVICEMANAGER" == "true" ]; then - pushd ../../../nonrtric/servicemanager-preload - # Send stderr to /dev/null to turn off chatty logging - ./servicemanager-preload.sh config-nonrtric.yaml 2>/dev/null - ./servicemanager-preload.sh config-smo.yaml 2>/dev/null - popd -fi diff --git a/smo-install/scripts/sub-scripts/postconfigure-smo.sh b/smo-install/scripts/sub-scripts/postconfigure-smo.sh new file mode 100755 index 00000000..0ba3c404 --- /dev/null +++ b/smo-install/scripts/sub-scripts/postconfigure-smo.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# Copyright (C) 2025 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============================================ +# + +# Configure service manager with the installed services +if ! command -v yq > /dev/null 2>&1; then + echo "yq is not installed. Installing yq..." + sudo snap install yq --channel=v4/stable +fi + +OVERRIDEYAML=$1 + +INSTALL_KONG=$(cat $OVERRIDEYAML | yq e '.nonrtric.installKong' -) +if [ $? -ne 0 ] || [ -z "$INSTALL_KONG" ]; then + echo "Error: failed to parse installKong from YAML with yq. Aborting install." + exit 1 +fi + +INSTALL_CAPIF=$(cat $OVERRIDEYAML | yq e '.nonrtric.installCapifcore' -) +if [ $? -ne 0 ] || [ -z "$INSTALL_CAPIF" ]; then + echo "Error: failed to parse installCapifcore from YAML with yq. Aborting install." + exit 1 +fi + +INSTALL_SERVICEMANAGER=$(cat $OVERRIDEYAML | yq e '.nonrtric.installServicemanager' -) +if [ $? -ne 0 ] || [ -z "$INSTALL_SERVICEMANAGER" ]; then + echo "Error: failed to parse installServicemanager from YAML with yq. Aborting install." + exit 1 +fi + +if [ "$INSTALL_SERVICEMANAGER" == "true" ]; then + if [ "$INSTALL_KONG" == "false" ]; then + echo "Error: INSTALL_KONG must be true if INSTALL_SERVICEMANAGER is true. Aborting install." + exit 1 + fi + if [ "$INSTALL_CAPIF" == "false" ]; then + echo "Error: INSTALL_CAPIF must be true if INSTALL_SERVICEMANAGER is true. Aborting install." + exit 1 + fi +fi + +if [ "$INSTALL_SERVICEMANAGER" == "true" ]; then + pushd ../../../nonrtric/servicemanager-preload + # Send stderr to /dev/null to turn off chatty logging + ./servicemanager-preload.sh config-nonrtric.yaml 2>/dev/null + ./servicemanager-preload.sh config-smo.yaml 2>/dev/null + popd +fi -- 2.16.6