From 031a9115150163fbd148bc2b558cba8ae89fcd9a Mon Sep 17 00:00:00 2001 From: "aravind.est" Date: Thu, 14 Mar 2024 15:52:15 +0000 Subject: [PATCH] Cleanup ChartMuseum at undeploy NONRTRIC ChartMuseum installation cleaned up as part of undeploy script. ChartMuseum upgraded to latest version. Issue-ID: NONRTRIC-992 Change-Id: I6fa43e6b3ea718aed8f2902d08091f019a7a4c32 Signed-off-by: aravind.est --- bin/deploy-nonrtric | 8 +++++--- bin/undeploy-nonrtric | 14 ++++++++++++++ nonrtric/RECIPE_EXAMPLE/example_recipe.yaml | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/bin/deploy-nonrtric b/bin/deploy-nonrtric index b0f58165..c461725a 100755 --- a/bin/deploy-nonrtric +++ b/bin/deploy-nonrtric @@ -57,6 +57,7 @@ echo "** $ROOT_DIR" rm $ROOT_DIR/../nonrtric/helm/*/charts/*.tgz #ChartMuseum configuration +CM_VERSION="v0.16.1" CM_PORT="8879" CM_BASE_URL="http://127.0.0.1:$CM_PORT" CM_CHART_GET_URL="$CM_BASE_URL/charts" @@ -69,8 +70,8 @@ if ! command -v chartmuseum &> /dev/null then pushd /tmp echo "Installing ChartMuseum binary..." - wget https://get.helm.sh/chartmuseum-v0.13.1-linux-amd64.tar.gz - tar xvfz chartmuseum-v0.13.1-linux-amd64.tar.gz + wget https://get.helm.sh/chartmuseum-$CM_VERSION-linux-amd64.tar.gz + tar xvfz chartmuseum-$CM_VERSION-linux-amd64.tar.gz sudo mv /tmp/linux-amd64/chartmuseum /usr/local/bin/chartmuseum popd else @@ -84,8 +85,9 @@ rm $HELM_LOCAL_REPO/* #Start Chart Museum server if there isn't one CHART_MUSEUM_PID=$(lsof -i :"$CM_PORT" | grep "chartmus" | grep -v "grep" | awk '{print $2}') if [ -z "$CHART_MUSEUM_PID" ]; then - echo "Starting ChartMuseum on port $CM_PORT..." + echo "Starting ChartMuseum on port $CM_PORT..." nohup chartmuseum --port=$CM_PORT --storage="local" --context-path=/charts --storage-local-rootdir=$HELM_LOCAL_REPO >/dev/null 2>&1 & + echo $! > $ROOT_DIR/CM_PID.txt else echo "ChartMuseum is already running..." fi diff --git a/bin/undeploy-nonrtric b/bin/undeploy-nonrtric index 6b718878..d6c827a8 100755 --- a/bin/undeploy-nonrtric +++ b/bin/undeploy-nonrtric @@ -1,6 +1,7 @@ #!/bin/bash ################################################################################ # Copyright (c) 2023 Nordix Foundation. # +# Copyright (C) 2024 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. # @@ -16,6 +17,8 @@ ################################################################################ # This script to undeploy the NONRTRIC +ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +echo "** $ROOT_DIR" COMPONENTS="controlpanel a1controller a1simulator policymanagementservice informationservice rappcatalogueservice rappcatalogueenhancedservice nonrtricgateway dmaapadapterservice dmaapmediatorservice helmmanager orufhrecovery ransliceassurance capifcore ranpm" RECIPE_NAMESPACE=$(kubectl get cm --all-namespaces | grep nonrtric-recipe | awk '{print $1}') @@ -66,3 +69,14 @@ kubectl delete cm -n ${NONRTRIC_NAMESPACE:-nonrtric} nonrtric-recipe kubectl delete ns ${NONRTRIC_NAMESPACE:-nonrtric} kubectl delete ns onap + +# Cleanup ChartMuseum +CM_PID_FILE="$ROOT_DIR/CM_PID.txt" +if [ -f $CM_PID_FILE ]; then + echo "Cleaning up ChartMuseum..." + PID=$(cat "$CM_PID_FILE") + echo "Killing ChartMuseum with PID $PID" + kill $PID + rm $CM_PID_FILE + echo "ChartMuseum cleanup completed" +fi diff --git a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml index b32dd213..d1383c43 100644 --- a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml +++ b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml @@ -37,7 +37,7 @@ nonrtric: installOrufhrecovery: true installRansliceassurance: true installCapifcore: true - installRanpm: true + installRanpm: false # rApp Manager functionality relies on ACM for its operation installrAppmanager: true # DME Participant should only be activated when ACM installation is available for this participant to utilize -- 2.16.6