Use OSC Helm charts for release/snapshot installation 56/14956/6
authoraravind.est <aravindhan.a@est.tech>
Fri, 19 Sep 2025 14:09:50 +0000 (15:09 +0100)
committeraravind.est <aravindhan.a@est.tech>
Tue, 30 Sep 2025 16:24:15 +0000 (17:24 +0100)
it/dep helm charts are published to OSC Helm repositories.
SNAPSHOT repository is available with the charts and used.
Once the release charts are available. This needs to be modified to support that.

Issue-ID: NONRTRIC-1076
Change-Id: I16d06461bab1b862790bad3b775ded89d16bf755
Signed-off-by: aravind.est <aravindhan.a@est.tech>
smo-install/README.md
smo-install/scripts/layer-0/0-setup-helm3.sh
smo-install/scripts/layer-1/1-build-all-charts.sh
smo-install/scripts/layer-2/2-install-oran.sh
smo-install/scripts/sub-scripts/build-onap.sh
smo-install/scripts/sub-scripts/install-nonrtric.sh
smo-install/scripts/sub-scripts/install-onap.sh
smo-install/scripts/sub-scripts/install-smo.sh

index f78c536..b11b8a5 100644 (file)
 # O-RAN SMO Package
 
+## Summary
 This project uses different helm charts from different Linux Foundation projects and integrate them into a unique SMO deployment.
 <p>The ONAP and ORAN project helm charts are built and then configured by using "helm override" so that it represents a valid ORAN SMO installation.</p>
 <p>It contains also provisioning scripts that can be used to bootstrap the platform and execute test use cases, network simulators, a1 simulators, cnf network simulators, etc ...</p>
 
-# Quick Installation on existing kubernetes
+## Table of Contents
+1. [Pre-requisites](#pre-requisites)
+2. [Installation Flavours](#installation-flavours-and-configurations)
+3. [Installation Modes](#installation-modes)
+    - [Release/Snapshot Mode](#releasesnapshot-mode-installation)
+    - [Dev Mode](#dev-mode-installation)
+4. [Uninstallation](#uninstallation)
+5. [Troubleshooting](#troubleshooting)
 
-## Pre-requisites:
-* VM with 64GB Memory, 20VCPU, 100GB of disk space.
-* Helm 3.12.0 or later
-* Kubernetes 1.30 or later
-* Helm deploy/undeploy plugin
-* Helm cm-push plugin
-* yq
-* jq
+---
 
-## Installation flavours and configurations
+## Pre-requisites
+- VM: 64GB Memory, 20VCPU, 100GB disk
+- Helm 3.12.0+
+- Kubernetes 1.30+
+- Helm deploy/undeploy plugin
+- Helm cm-push plugin
+- yq
+- jq
 
-### Default installation flavour
-Directory `smo-install/helm-override` contains different flavours of installations. One of these flavours can be used for the installation.
+---
 
-The default flavour is `default` (`smo-install/helm-override/default`). It contains the configuration for the ONAP and O-RAN (NONRTRIC/SMO) components. 
-
-`onap-override.yaml` file controls the configuration of the ONAP components.
-
-`oran-override.yaml` file controls the configuration of the O-RAN (NONRTRIC/SMO) components.
-
-### Creating a new flavour of installation
+## Installation Flavours and Configurations
 
+- Flavours are directories under `smo-install/helm-override/`.
+- The default flavour is `default` (`smo-install/helm-override/default`).
+> [!NOTE]
+> The default flavour is considered as a baseline configuration for all the installations.
+- Flavour config files:
+    - `onap-override.yaml`: ONAP components
+    - `oran-override.yaml`: O-RAN components
+- To create a new flavour, add a directory with `onap-flavour-config.yaml` and `oran-flavour-config.yaml`.
 > [!NOTE]
-> This default flavour is considered as a baseline configuration for all the installations.
-
-Any number of flavours can be created, each flavour can have its own configuration.
-
-Each of the new flavour should have its own directory under `smo-install/helm-override/`. 
-The directory should contain the `onap-flavour-config.yaml` and `oran-flavour-config.yaml` files.
-
-> [!IMPORTANT]
 > These flavour configuration files doesn't needs to have entire configuration as same as in default flavour, Instead it should contain only the configuration that needs to be overridden from the default flavour.
+- Only override necessary config values from the default flavour.
 
-For example, if you want to disable NONRTRIC rAppmanager component in your flavour, then you can have that override in your flavour's `oran-flavour-config.yaml` file as below,
-
+**Example:** To disable NONRTRIC rAppmanager in your flavour:
 ```yaml
 nonrtric:
   installrAppmanager: false
 ```
-This will disable the NONRTRIC rAppmanager component in your flavour and all the other components will be installed as per the default flavour configuration.
-
-## Release Mode Installation
 
-This is the default mode of installation. Building the charts are not required in release mode.
-Release mode uses the helm charts from the nexus helm repositories as pointed below,
-* ONAP: nexus3.onap.org/repository/onap-helm-testing/
-* Strimzi: strimzi.io/charts/
-* NONRTRIC: ??? (nexus3.o-ran-sc.org/repository/o-ran-sc-helm/)
-* SMO: ??? (nexus3.o-ran-sc.org/repository/o-ran-sc-helm/)
+---
 
-### Installation
+## Installation Modes
 
-Clone the repository using the command below,
-
-```bash
-git clone --recursive "https://gerrit.o-ran-sc.org/r/it/dep"
-```
+### Release/Snapshot Mode Installation
+- Uses pre-built charts from Nexus repositories.
+- No chart building required.
 
 > [!NOTE]
-> The upload of the HELM charts for NONRTRIC and SMO components is currently in progress. Until the charts are available, these components should continue to be installed using the development mode.
-
-Use the below command to setup chartmuseum and helm,
-
-```bash
-./dep/smo-install/scripts/layer-0/0-setup-charts-museum.sh
-```
-
+> **Release images are currently unavailable.** Snapshot images are used for deployment. Once release images become available, the installation will switch to use them automatically.
+
+**Repositories:**
+- SMO Release: https://nexus3.o-ran-sc.org/repository/helm.release/
+- SMO Snapshot: https://nexus3.o-ran-sc.org/repository/helm.snapshot/
+- Strimzi: strimzi.io/charts/
+
+**Steps:**
+1. Clone the repository:
+    ```bash
+    git clone --recursive "https://gerrit.o-ran-sc.org/r/it/dep"
+    ```
+2. Setup Helm and plugins:
+    ```bash
+    ./dep/smo-install/scripts/layer-0/0-setup-helm3.sh
+    ```
+3. Deploy SMO:
+    - Default flavour, release mode:
+        ```bash
+        ./dep/smo-install/scripts/layer-2/2-install-oran.sh
+        ```
+    - Default flavour, snapshot mode:
+        ```bash
+        ./dep/smo-install/scripts/layer-2/2-install-oran.sh default snapshot
+        ```
+    - Specific flavour, release mode:
+        ```bash
+        ./dep/smo-install/scripts/layer-2/2-install-oran.sh <FLAVOUR>
+        ```
+    - Specific flavour, snapshot mode:
+        ```bash
+        ./dep/smo-install/scripts/layer-2/2-install-oran.sh <FLAVOUR> snapshot
+        ```
+4. Verify pods:
+    ```bash
+    kubectl get pods -n onap && kubectl get pods -n nonrtric && kubectl get pods -n smo
+    ```
+
+### Dev Mode Installation
+- Builds charts from source.
+
+**Steps:**
+1. Clone the repository:
+    ```bash
+    git clone --recursive "https://gerrit.o-ran-sc.org/r/it/dep"
+    ```
+2. Setup chartmuseum and Helm:
+    ```bash
+    ./dep/smo-install/scripts/layer-0/0-setup-charts-museum.sh
+   ```
+    ```bash
+    ./dep/smo-install/scripts/layer-0/0-setup-helm3.sh
+    ```
+3. Build charts:
+    ```bash
+    ./dep/smo-install/scripts/layer-1/1-build-all-charts.sh
+    ```
+4. Deploy SMO:
+    - Default flavour:
+        ```bash
+        ./dep/smo-install/scripts/layer-2/2-install-oran.sh default dev
+        ```
+    - Specific flavour:
+        ```bash
+        ./dep/smo-install/scripts/layer-2/2-install-oran.sh <FLAVOUR> dev
+        ```
+5. Verify pods:
+    ```bash
+    kubectl get pods -n onap && kubectl get pods -n nonrtric && kubectl get pods -n smo
+    ```
+
+---
+
+## Uninstallation
+To remove all components:
 ```bash
-./dep/smo-install/scripts/layer-0/0-setup-helm3.sh
-```
-
-Charts can be build using the below command,
-
-```bash
-./dep/smo-install/scripts/layer-1/1-build-all-charts.sh
-```
-
-Once the pre-requisites are available, The below command can be used for the smo deployment of default flavour,
-
-```bash
-./dep/smo-install/scripts/layer-2/2-install-oran.sh
-```
-
-The below command can be used for the smo deployment of a specific flavour,
-
-```bash
-./dep/smo-install/scripts/layer-2/2-install-oran.sh <FLAVOUR>
+./dep/smo-install/scripts/uninstall-all.sh
 ```
 
+---
 
+## Troubleshooting
 > [!WARNING]
-> Sometimes ONAP mariadb pod may not come up properly due to the slowness in pulling the container image. In such cases, you can try with re-installation and it should work fine. Otherwise you can try to pull all the required images manually into the cluster before the installation.
-
-Verify pods,
-
-```bash
-kubectl get pods -n onap && kubectl get pods -n nonrtric && kubectl get pods -n smo
-```
+> **ONAP mariadb pod may fail to start due to slow image pulls.**
+> - Try re-installation.
+> - Manually pull required images before installation if issues persist.
 
-## Dev Mode Installation
+---
 
-In this mode, the released helm charts are not used. Instead, the charts are built from the source code and installed.
-
-### Installation
-
-Clone the repository using the command below,
-
-```bash
-git clone --recursive "https://gerrit.o-ran-sc.org/r/it/dep"
-```
-
-Use the below command to setup chartmuseum and helm,
-
-```bash
-./dep/smo-install/scripts/layer-0/0-setup-charts-museum.sh
-```
-
-```bash
-./dep/smo-install/scripts/layer-0/0-setup-helm3.sh
-```
-
-Charts can be build using the below command,
-
-```bash
-./dep/smo-install/scripts/layer-1/1-build-all-charts.sh
-```
-
-The below command can be used for the smo deployment of default flavour,
-
-```bash
-./dep/smo-install/scripts/layer-2/2-install-oran.sh default dev
-```
-
-The below command can be used for the smo deployment of a specific flavour,
-
-```bash
-./dep/smo-install/scripts/layer-2/2-install-oran.sh <FLAVOUR> dev
-```
-
-Verify pods,
-
-```bash
-kubectl get pods -n onap && kubectl get pods -n nonrtric && kubectl get pods -n smo
-```
-
-## Uninstallation:
-Execute
-
-```bash
-./dep/smo-install/scripts/uninstall-all.sh
-```
index 930542a..52af0eb 100755 (executable)
@@ -6,6 +6,7 @@
 # ================================================================================
 # Copyright (C) 2021 AT&T Intellectual Property. All rights
 #                             reserved.
+# 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.
 #
 ###
 #Helm package
-cd /tmp
-wget https://get.helm.sh/helm-v3.12.3-linux-amd64.tar.gz
-tar xvfz /tmp/helm-v3.12.3-linux-amd64.tar.gz
-sudo mv linux-amd64/helm /usr/local/bin/helm
-sudo apt-get install git -y
+SCRIPT=$(readlink -f "$0")
+SCRIPT_PATH=$(dirname "$SCRIPT")
 
+# Check whether helm is installed and if not install it
+if command -v helm > /dev/null 2>&1; then
+    echo "Helm is already installed. Skipping installation."
+else
+    echo "Helm is not installed. Installing helm ..."
+    cd /tmp
+    wget https://get.helm.sh/helm-v3.12.3-linux-amd64.tar.gz
+    tar xvfz /tmp/helm-v3.12.3-linux-amd64.tar.gz
+    sudo mv linux-amd64/helm /usr/local/bin/helm
+fi
 
 echo "Checking HELM ..."
 helm version
 
-TAR_VERSION=v0.10.3
-echo "Downloading and installing helm-push ${TAR_VERSION} ..."
-TAR_FILE=helm-push-${TAR_VERSION}.tar.gz
-HELM_PLUGINS=$(helm env HELM_PLUGINS)
-mkdir -p $HELM_PLUGINS/helm-push
-cd $HELM_PLUGINS/helm-push
-wget https://nexus.o-ran-sc.org/content/repositories/thirdparty/chartmuseum/helm-push/$TAR_VERSION/$TAR_FILE
-tar zxvf $TAR_FILE >/dev/null
-rm $TAR_FILE
-cd /tmp/
-helm repo remove local
-helm repo add local http://localhost:18080
+# Check whether git is installed and if not install it
+if command -v git > /dev/null 2>&1; then
+    echo "Git is already installed. Skipping installation."
+else
+    echo "Git is not installed. Installing git ..."
+    sudo apt-get install git -y
+fi
+
+# Check whether helm-push is installed and if not install it
+if helm plugin list | awk '{print $1}' | grep -w -q "cm-push"; then
+    echo "Helm cm-push plugin is already installed. Skipping installation."
+else
+    echo "Helm cm-push plugin is not installed. Installing cm-push ..."
+    TAR_VERSION=v0.10.3
+    echo "Downloading and installing helm-push ${TAR_VERSION} ..."
+    TAR_FILE=helm-push-${TAR_VERSION}.tar.gz
+    HELM_PLUGINS=$(helm env HELM_PLUGINS)
+    mkdir -p $HELM_PLUGINS/helm-push
+    cd $HELM_PLUGINS/helm-push
+    wget https://nexus.o-ran-sc.org/content/repositories/thirdparty/chartmuseum/helm-push/$TAR_VERSION/$TAR_FILE
+    tar zxvf $TAR_FILE >/dev/null
+    rm $TAR_FILE
+fi
+
+# Check whether make is installed and if not install it
+if command -v make > /dev/null 2>&1; then
+    echo "Make is already installed. Skipping installation."
+else
+    echo "Make is not installed. Installing make ..."
+    sudo apt-get install make -y
+fi
+
+cd $SCRIPT_PATH
+# Check whether undeploy and deploy plugins are installed by comparing exact name and if not install them
+if helm plugin list | awk '{print $1}' | grep -w -q "undeploy"; then
+    echo "Helm undeploy plugin is already installed. Skipping installation."
+else
+    echo "Helm undeploy plugin is not installed. Installing undeploy plugin ..."
+    helm plugin install ../../onap_oom/kubernetes/helm/plugins/undeploy/
+fi
+if helm plugin list | awk '{print $1}' | grep -w -q "deploy"; then
+    echo "Helm deploy plugin is already installed. Skipping installation."
+else
+    echo "Helm deploy plugin is not installed. Installing deploy plugin ..."
+    helm plugin install ../../onap_oom/kubernetes/helm/plugins/deploy/
+fi
index 03ae535..f077401 100755 (executable)
@@ -6,6 +6,7 @@
 # ================================================================================
 # Copyright (C) 2021 AT&T Intellectual Property. All rights
 #                             reserved.
+# 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.
@@ -27,6 +28,14 @@ SCRIPT=$(readlink -f "$0")
 SCRIPT_PATH=$(dirname "$SCRIPT")
 cd $SCRIPT_PATH
 
+# Adding local chartmuseum repo
+if helm repo list | awk '{print $1}' | grep -w -q "local"; then
+    echo "Helm repo 'local' already exists. Skipping addition."
+else
+    echo "Helm repo 'local' does not exist. Adding it ..."
+    helm repo add local http://localhost:18080
+fi
+
 ../sub-scripts/build-onap.sh
 ../sub-scripts/build-oran.sh
 ../sub-scripts/build-tests.sh
index 969622f..e06844d 100755 (executable)
@@ -77,17 +77,32 @@ fi
 
 timestamp=$(date +%s)
 
+helm repo add oran-snapshot https://nexus3.o-ran-sc.org/repository/helm.snapshot/
+helm repo add oran-release https://nexus3.o-ran-sc.org/repository/helm.release/
+helm repo add strimzi https://strimzi.io/charts/
+
+TARGET_HELM_REPO="oran-snapshot" # This should be changed to oran-release once the release charts are published
+
+if [ "$MODE" == "dev" ]; then
+    helm cm-push ../packages/strimzi-kafka-operator-helm-3-chart-0.45.0.tgz local
+    TARGET_HELM_REPO="local"
+elif [ "$MODE" == "snapshot" ]; then
+    TARGET_HELM_REPO="oran-snapshot"
+fi
+
+helm repo update
+
 echo "Pre configuring SMO ..."
-../sub-scripts/preconfigure-smo.sh ../../helm-override/$FLAVOUR/onap-override.yaml $MODE $timestamp
+../sub-scripts/preconfigure-smo.sh ../../helm-override/"$FLAVOUR"/onap-override.yaml
 echo "SMO pre configuration done."
 
 echo "Starting ONAP & NONRTRIC namespaces ..."
-../sub-scripts/install-onap.sh ../../helm-override/$FLAVOUR/onap-override.yaml $MODE $timestamp
-../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
+../sub-scripts/install-onap.sh ../../helm-override/"$FLAVOUR"/onap-override.yaml "$TARGET_HELM_REPO" "$timestamp"
+../sub-scripts/install-nonrtric.sh ../../helm-override/"$FLAVOUR"/oran-override.yaml "$TARGET_HELM_REPO" "$timestamp"
+../sub-scripts/install-smo.sh ../../helm-override/"$FLAVOUR"/oran-override.yaml "$TARGET_HELM_REPO" "$timestamp"
 
 echo "Starting SMO Post Configuration ..."
-../sub-scripts/postconfigure-smo.sh ../../helm-override/$FLAVOUR/oran-override.yaml $MODE $timestamp
+../sub-scripts/postconfigure-smo.sh ../../helm-override/"$FLAVOUR"/oran-override.yaml
 echo "SMO post configuration done."
 
 kubectl get pods -n onap
@@ -96,10 +111,10 @@ kubectl get pods -n smo
 kubectl get namespaces
 
 if [ "$IS_GENERATED_ONAP_OVERRIDE" = true ]; then
-  rm -f ../../helm-override/$FLAVOUR/onap-override.yaml
+  rm -f ../../helm-override/"$FLAVOUR"/onap-override.yaml
 fi
 if [ "$IS_GENERATED_ORAN_OVERRIDE" = true ]; then
-  rm -f ../../helm-override/$FLAVOUR/oran-override.yaml
+  rm -f ../../helm-override/"$FLAVOUR"/oran-override.yaml
 fi
 
 echo "SMO Installation completed successfully in $(( ($(date +%s) - $timestamp) / 60 )) minutes."
index d76ba5a..cd39fe4 100755 (executable)
@@ -5,7 +5,7 @@
 # ORAN SMO Package
 # ================================================================================
 # Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
-# Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.
+# 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.
@@ -27,10 +27,5 @@ SCRIPT=$(readlink -f "$0")
 SCRIPT_PATH=$(dirname "$SCRIPT")
 cd $SCRIPT_PATH
 
-sudo apt-get install make -y
-
-helm plugin install ../../onap_oom/kubernetes/helm/plugins/undeploy/
-helm plugin install ../../onap_oom/kubernetes/helm/plugins/deploy/
-
 echo '### Building ONAP part###'
 (cd ../../onap_oom/kubernetes && make all -e SKIP_LINT=TRUE)
index acb0e24..1a7445c 100755 (executable)
@@ -28,21 +28,10 @@ echo  '### Installing ORAN NONRTRIC part ###'
 
 OVERRIDEYAML=$1
 
-MODE=$2
-
-if [ "$MODE" == "dev" ]; then
-    echo "Installing NONRTRIC in dev mode"
-    helm upgrade --install --debug oran-nonrtric local/nonrtric --namespace nonrtric -f $OVERRIDEYAML --set nonrtric.persistence.mountPath="/dockerdata-nfs/deployment-$3"
-else
-    echo "Installing NONRTRIC in release mode"
-    # This following should be modified once the charts are uploaded and available in the nexus repository
-    # Till then, we are using the local chart
-        # helm repo add nonrtric https://nexus3.o-ran-sc.org/repository/smo-helm-snapshots/
-        # helm repo update
-        # helm install oran-nonrtric nonrtric/nonrtric --namespace nonrtric -f $OVERRIDEYAML --create-namespace
-    helm upgrade --install oran-nonrtric local/nonrtric --namespace nonrtric -f $OVERRIDEYAML --set nonrtric.persistence.mountPath="/dockerdata-nfs/deployment-$3"
-fi
+HELM_REPO=$2
 
+echo "Installing NONRTRIC from HELM Repo : $HELM_REPO"
+helm upgrade --install oran-nonrtric "$HELM_REPO"/nonrtric --namespace nonrtric -f "$OVERRIDEYAML" --set nonrtric.persistence.mountPath="/dockerdata-nfs/deployment-$3"
 
 check_for_secrets() {
     try=0
@@ -62,21 +51,21 @@ check_for_secrets() {
 # All KafkaUser and KafkaTopic resources should be created as part of ONAP namespace
 # This enables the strimzi entity operator to create the secrets as necessary
 # Once the secrets are created, it should be copied to the SMO namespace
-SECRETS_SIZE=$(yq '.nonrtric.secrets | length' $OVERRIDEYAML)
+SECRETS_SIZE=$(yq '.nonrtric.secrets | length' "$OVERRIDEYAML")
 if [ "$SECRETS_SIZE" -eq 0 ]; then
     echo "No secrets to copy from onap namespace"
     exit 0
 else
     for i in $(seq 0 $((SECRETS_SIZE - 1))); do
-        secret=$(yq ".nonrtric.secrets[$i].name" $OVERRIDEYAML)
-        dependsOn=$(yq ".nonrtric.secrets[$i].dependsOn" $OVERRIDEYAML)
-        if [ $(yq ".$dependsOn" $OVERRIDEYAML) != "true" ]; then
+        secret=$(yq ".nonrtric.secrets[$i].name" "$OVERRIDEYAML")
+        dependsOn=$(yq ".nonrtric.secrets[$i].dependsOn" "$OVERRIDEYAML")
+        if [ "$(yq ".$dependsOn" "$OVERRIDEYAML")" != "true" ]; then
             echo "$dependsOn is not set to true. Skipping $secret copy..."
             continue
         fi
         echo "Copying $secret from onap namespace..."
-        check_for_secrets $secret
-        kubectl get secret $secret -n onap -o json | jq 'del(.metadata["namespace","creationTimestamp","resourceVersion","selfLink","uid","ownerReferences"])' | kubectl apply -n nonrtric -f -
+        check_for_secrets "$secret"
+        kubectl get secret "$secret" -n onap -o json | jq 'del(.metadata["namespace","creationTimestamp","resourceVersion","selfLink","uid","ownerReferences"])' | kubectl apply -n nonrtric -f -
     done
 fi
 
index dc5e078..1d3a64a 100755 (executable)
@@ -29,7 +29,7 @@ SCRIPT_PATH=$(dirname "$SCRIPT")
 cd $SCRIPT_PATH
 
 OVERRIDEYAML=$1
-MODE=$2
+HELM_REPO=$2
 
 INSTALL_STRIMZI=$(cat $OVERRIDEYAML | yq e '.strimzi.enabled' -)
 if [ $? -ne 0 ] || [ -z "$INSTALL_STRIMZI"  ]; then
@@ -37,32 +37,19 @@ if [ $? -ne 0 ] || [ -z "$INSTALL_STRIMZI"  ]; then
     exit 1
 fi
 
-if [ "$MODE" == "dev" ]; then
-    if [ "$INSTALL_STRIMZI" == "true" ]; then
-        echo "### Installing Strimzi Kafka Operator (Dev Mode) ###"
-        helm cm-push ../packages/strimzi-kafka-operator-helm-3-chart-0.45.0.tgz local
-        helm repo update
-        helm upgrade --install strimzi-kafka-operator local/strimzi-kafka-operator --namespace strimzi-system --version 0.45.0 --set watchAnyNamespace=true --create-namespace
-        echo "Waiting for Strimzi Kafka Operator to be ready..."
-        kubectl wait --for=condition=available --timeout=600s deployment/strimzi-cluster-operator -n strimzi-system
-    fi
+if [ "$INSTALL_STRIMZI" == "true" ]; then
+  STRIMZI_HELM_REPO="local"
+  if [ "$HELM_REPO" != "local" ]; then
+    STRIMZI_HELM_REPO="strimzi"
+  fi
 
-    kubectl create namespace onap
-    echo '### Installing ONAP part (Dev Mode) ###'
-    helm deploy --debug onap local/onap --namespace onap -f $1
-else
-    if [ "$INSTALL_STRIMZI" == "true" ]; then
-        echo "### Installing Strimzi Kafka Operator (Release Mode) ###"
-        helm repo add strimzi https://strimzi.io/charts/
-        helm repo update
-        helm upgrade --install strimzi-kafka-operator strimzi/strimzi-kafka-operator --namespace strimzi-system --version 0.45.0 --set watchAnyNamespace=true --create-namespace
-        echo "Waiting for Strimzi Kafka Operator to be ready..."
-        kubectl wait --for=condition=available --timeout=600s deployment/strimzi-cluster-operator -n strimzi-system
-    fi
+  echo "### Installing Strimzi Kafka Operator (From Helm repo $STRIMZI_HELM_REPO) ###"
+  helm upgrade --install strimzi-kafka-operator "$STRIMZI_HELM_REPO"/strimzi-kafka-operator --namespace strimzi-system --version 0.45.0 --set watchAnyNamespace=true --create-namespace
 
-    echo '### Installing ONAP part (Release Mode) ###'
-    helm repo add onap https://nexus3.onap.org/repository/onap-helm-testing/
-    helm repo update
+  echo "Waiting for Strimzi Kafka Operator to be ready..."
+  kubectl wait --for=condition=available --timeout=600s deployment/strimzi-cluster-operator -n strimzi-system
+fi
 
-    helm deploy --debug onap onap/onap --namespace onap -f $1 --create-namespace
-fi
\ No newline at end of file
+kubectl create namespace onap
+echo "### Installing ONAP part (From Helm repo $HELM_REPO) ###"
+helm deploy --debug onap "$HELM_REPO"/onap --namespace onap -f $1 --create-namespace
\ No newline at end of file
index 0d3c696..f84731c 100755 (executable)
@@ -20,20 +20,10 @@ echo  '### Installing ORAN SMO part ###'
 kubectl create namespace smo
 
 OVERRIDEYAML=$1
-MODE=$2
+HELM_REPO=$2
 
-if [ "$MODE" == "dev" ]; then
-    echo "Installing SMO in dev mode"
-    helm upgrade --install --debug oran-smo local/smo --namespace smo -f $OVERRIDEYAML --timeout 15m
-else
-    echo "Installing SMO in release mode"
-    # This following should be modified once the charts are uploaded and available in the nexus repository
-    # Till then, we are using the local chart
-        # helm repo add smo https://nexus3.o-ran-sc.org/repository/smo-helm-snapshots/
-        # helm repo update
-        # helm upgrade --install oran-smo smo/smo --namespace nonrtric -f $OVERRIDEYAML --create-namespace
-    helm upgrade --install oran-smo local/smo --namespace smo -f $OVERRIDEYAML  --timeout 15m
-fi
+echo "Installing SMO from HELM Repo : $HELM_REPO"
+helm upgrade --install oran-smo "$HELM_REPO"/smo --namespace smo -f "$OVERRIDEYAML"  --timeout 15m
 
 check_for_secrets() {
     try=0
@@ -52,20 +42,20 @@ check_for_secrets() {
 # All KafkaUser and KafkaTopic resources should be created as part of ONAP namespace
 # This enables the strimzi entity operator to create the secrets as necessary
 # Once the secrets are created, it should be copied to the SMO namespace
-SECRETS_SIZE=$(yq '.smo.secrets | length' $OVERRIDEYAML)
+SECRETS_SIZE=$(yq '.smo.secrets | length' "$OVERRIDEYAML")
 if [ "$SECRETS_SIZE" -eq 0 ]; then
     echo "No secrets to copy from onap namespace"
     exit 0
 else
     for i in $(seq 0 $((SECRETS_SIZE - 1))); do
-        secret=$(yq ".smo.secrets[$i].name" $OVERRIDEYAML)
-        dependsOn=$(yq ".smo.secrets[$i].dependsOn" $OVERRIDEYAML)
-        if [ $(yq ".$dependsOn" $OVERRIDEYAML) != "true" ]; then
+        secret=$(yq ".smo.secrets[$i].name" "$OVERRIDEYAML")
+        dependsOn=$(yq ".smo.secrets[$i].dependsOn" "$OVERRIDEYAML")
+        if [ "$(yq ".$dependsOn" "$OVERRIDEYAML")" != "true" ]; then
             echo "$dependsOn is not set to true. Skipping $secret copy..."
             continue
         fi
         echo "Copying $secret from onap namespace..."
-        check_for_secrets $secret
-        kubectl get secret $secret -n onap -o json | jq 'del(.metadata["namespace","creationTimestamp","resourceVersion","selfLink","uid","ownerReferences"])' | kubectl apply -n smo -f -
+        check_for_secrets "$secret"
+        kubectl get secret "$secret" -n onap -o json | jq 'del(.metadata["namespace","creationTimestamp","resourceVersion","selfLink","uid","ownerReferences"])' | kubectl apply -n smo -f -
     done
 fi