Cleanup ChartMuseum at undeploy NONRTRIC 13/12613/2
authoraravind.est <aravindhan.a@est.tech>
Thu, 14 Mar 2024 15:52:15 +0000 (15:52 +0000)
committeraravind.est <aravindhan.a@est.tech>
Thu, 14 Mar 2024 16:16:09 +0000 (16:16 +0000)
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 <aravindhan.a@est.tech>
bin/deploy-nonrtric
bin/undeploy-nonrtric
nonrtric/RECIPE_EXAMPLE/example_recipe.yaml

index b0f5816..c461725 100755 (executable)
@@ -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
index 6b71887..d6c827a 100755 (executable)
@@ -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
index b32dd21..d1383c4 100644 (file)
@@ -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