sebdet | a2c2df5 | 2021-10-15 13:47:31 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | ### |
DenisGNoonan | 3fdbdbb | 2024-05-16 10:49:21 +0100 | [diff] [blame] | 4 | # ============LICENSE_START======================================================== |
sebdet | a2c2df5 | 2021-10-15 13:47:31 +0200 | [diff] [blame] | 5 | # ORAN SMO Package |
DenisGNoonan | 3fdbdbb | 2024-05-16 10:49:21 +0100 | [diff] [blame] | 6 | # ================================================================================= |
| 7 | # Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. |
| 8 | # Modification Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved. |
| 9 | # ================================================================================= |
sebdet | a2c2df5 | 2021-10-15 13:47:31 +0200 | [diff] [blame] | 10 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 11 | # you may not use this file except in compliance with the License. |
| 12 | # You may obtain a copy of the License at |
| 13 | # |
| 14 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 15 | # |
| 16 | # Unless required by applicable law or agreed to in writing, software |
| 17 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 18 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 | # See the License for the specific language governing permissions and |
| 20 | # limitations under the License. |
DenisGNoonan | 3fdbdbb | 2024-05-16 10:49:21 +0100 | [diff] [blame] | 21 | # ============LICENSE_END========================================================== |
| 22 | # ================================================================================= |
| 23 | # |
sebdet | a2c2df5 | 2021-10-15 13:47:31 +0200 | [diff] [blame] | 24 | ### |
| 25 | |
| 26 | kubectl create namespace nonrtric |
| 27 | echo '### Installing ORAN NONRTRIC part ###' |
DenisGNoonan | 3fdbdbb | 2024-05-16 10:49:21 +0100 | [diff] [blame] | 28 | |
| 29 | OVERRIDEYAML=$1 |
| 30 | |
| 31 | if ! command -v yq > /dev/null 2>&1; then |
| 32 | echo "yq is not installed. Installing yq..." |
aravind.est | 68332a4 | 2024-06-26 16:20:45 +0100 | [diff] [blame] | 33 | sudo snap install yq --channel=v4/stable |
DenisGNoonan | 3fdbdbb | 2024-05-16 10:49:21 +0100 | [diff] [blame] | 34 | fi |
| 35 | |
aravind.est | 68332a4 | 2024-06-26 16:20:45 +0100 | [diff] [blame] | 36 | INSTALL_KONG=$(cat $OVERRIDEYAML | yq e '.nonrtric.installKong' -) |
DenisGNoonan | 3fdbdbb | 2024-05-16 10:49:21 +0100 | [diff] [blame] | 37 | if [ $? -ne 0 ] || [ -z "$INSTALL_KONG" ]; then |
| 38 | echo "Error: failed to parse installKong from YAML with yq. Aborting install." |
| 39 | exit 1 |
| 40 | fi |
| 41 | |
aravind.est | 68332a4 | 2024-06-26 16:20:45 +0100 | [diff] [blame] | 42 | INSTALL_CAPIF=$(cat $OVERRIDEYAML | yq e '.nonrtric.installCapifcore' -) |
DenisGNoonan | 3fdbdbb | 2024-05-16 10:49:21 +0100 | [diff] [blame] | 43 | if [ $? -ne 0 ] || [ -z "$INSTALL_CAPIF" ]; then |
| 44 | echo "Error: failed to parse installCapifcore from YAML with yq. Aborting install." |
| 45 | exit 1 |
| 46 | fi |
| 47 | |
aravind.est | 68332a4 | 2024-06-26 16:20:45 +0100 | [diff] [blame] | 48 | INSTALL_SERVICEMANAGER=$(cat $OVERRIDEYAML | yq e '.nonrtric.installServicemanager' -) |
DenisGNoonan | 3fdbdbb | 2024-05-16 10:49:21 +0100 | [diff] [blame] | 49 | if [ $? -ne 0 ] || [ -z "$INSTALL_SERVICEMANAGER" ]; then |
| 50 | echo "Error: failed to parse installServicemanager from YAML with yq. Aborting install." |
| 51 | exit 1 |
| 52 | fi |
| 53 | |
| 54 | if [ "$INSTALL_SERVICEMANAGER" == "true" ]; then |
| 55 | if [ "$INSTALL_KONG" == "false" ]; then |
| 56 | echo "Error: INSTALL_KONG must be true if INSTALL_SERVICEMANAGER is true. Aborting install." |
| 57 | exit 1 |
| 58 | fi |
| 59 | if [ "$INSTALL_CAPIF" == "false" ]; then |
| 60 | echo "Error: INSTALL_CAPIF must be true if INSTALL_SERVICEMANAGER is true. Aborting install." |
| 61 | exit 1 |
| 62 | fi |
| 63 | fi |
| 64 | |
| 65 | helm install --debug oran-nonrtric local/nonrtric --namespace nonrtric -f $OVERRIDEYAML --set nonrtric.persistence.mountPath="/dockerdata-nfs/deployment-$2" |
DenisGNoonan | 9043807 | 2024-08-14 12:38:47 +0100 | [diff] [blame] | 66 | |
| 67 | if [ "$INSTALL_SERVICEMANAGER" == "true" ]; then |
| 68 | pushd ../../../servicemanager-preload |
| 69 | # Send stderr to /dev/null to turn off chatty logging |
| 70 | ./servicemanager-preload.sh config-nonrtric.yaml 2>/dev/null |
| 71 | ./servicemanager-preload.sh config-smo.yaml 2>/dev/null |
| 72 | popd |
| 73 | fi |