aravind.est | acdf2fe | 2023-07-18 10:59:06 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # ============LICENSE_START=============================================== |
| 4 | # Copyright (C) 2023 Nordix Foundation. All rights reserved. |
aravind.est | 2a90215 | 2024-01-25 19:32:36 +0000 | [diff] [blame] | 5 | # Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved. |
aravind.est | acdf2fe | 2023-07-18 10:59:06 +0100 | [diff] [blame] | 6 | # ======================================================================== |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | # you may not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | # See the License for the specific language governing permissions and |
| 17 | # limitations under the License. |
| 18 | # ============LICENSE_END================================================= |
| 19 | # |
| 20 | |
| 21 | echo "######### Installing NONRTRIC components #########" |
| 22 | |
| 23 | git clone "https://gerrit.o-ran-sc.org/r/it/dep" |
| 24 | |
aravind.est | 5ec9687 | 2023-11-20 15:31:13 +0000 | [diff] [blame] | 25 | ENABLED_SERVICES=(installPms installA1controller installA1simulator installInformationservice installrAppmanager installDmeParticipant) |
aravind.est | c128f98 | 2023-08-14 07:28:12 +0100 | [diff] [blame] | 26 | DISABLED_SERVICES=(installControlpanel installRappcatalogueservice installRappcatalogueenhancedservice installNonrtricgateway installKong installDmaapadapterservice installDmaapmediatorservice installHelmmanager installOrufhrecovery installRansliceassurance installRanpm) |
aravind.est | acdf2fe | 2023-07-18 10:59:06 +0100 | [diff] [blame] | 27 | |
| 28 | RECEIPE_FILE="dep/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml" |
| 29 | |
| 30 | for element in "${ENABLED_SERVICES[@]}"; do |
| 31 | echo "Enabling service $element" |
| 32 | yq eval ".nonrtric.$element"="true" -i $RECEIPE_FILE |
| 33 | done |
| 34 | |
| 35 | for element in "${DISABLED_SERVICES[@]}"; do |
| 36 | echo "Disabling service $element" |
| 37 | yq eval ".nonrtric.$element"="false" -i $RECEIPE_FILE |
| 38 | done |
| 39 | |
aravind.est | 2a90215 | 2024-01-25 19:32:36 +0000 | [diff] [blame] | 40 | # Dev mode installation configuration |
| 41 | if [[ "$1" == "dev" ]]; then |
| 42 | SNAPSHOT_REPO='nexus3.o-ran-sc.org:10003/o-ran-sc' |
| 43 | RAPP_MANAGER_VERSION=$(grep -oPm2 "(?<=<version>)[^<]+" "../../pom.xml" | tail -n1) |
| 44 | DME_PARTICIPANT_VERSION=$(grep -oPm2 "(?<=<version>)[^<]+" "../../participants/pom.xml" | tail -n1) |
| 45 | echo "Rapp Manager Version: $RAPP_MANAGER_VERSION" |
| 46 | echo "DME Participant Version: $DME_PARTICIPANT_VERSION" |
| 47 | yq eval ".rappmanager.rappmanager.image.registry"=\"$SNAPSHOT_REPO\" -i $RECEIPE_FILE |
| 48 | yq eval ".rappmanager.rappmanager.image.tag"=\"$RAPP_MANAGER_VERSION\" -i $RECEIPE_FILE |
aravind.est | 547f7a3 | 2024-02-12 18:42:32 +0000 | [diff] [blame] | 49 | yq eval ".rappmanager.rappmanager.imagePullPolicy=\"Always\"" -i $RECEIPE_FILE |
aravind.est | 2a90215 | 2024-01-25 19:32:36 +0000 | [diff] [blame] | 50 | yq eval ".dmeparticipant.dmeparticipant.image.registry"=\"$SNAPSHOT_REPO\" -i $RECEIPE_FILE |
| 51 | yq eval ".dmeparticipant.dmeparticipant.image.tag"=\"$DME_PARTICIPANT_VERSION\" -i $RECEIPE_FILE |
aravind.est | 547f7a3 | 2024-02-12 18:42:32 +0000 | [diff] [blame] | 52 | yq eval ".dmeparticipant.dmeparticipant.imagePullPolicy=\"Always\"" -i $RECEIPE_FILE |
aravind.est | 2a90215 | 2024-01-25 19:32:36 +0000 | [diff] [blame] | 53 | fi |
| 54 | |
aravind.est | acdf2fe | 2023-07-18 10:59:06 +0100 | [diff] [blame] | 55 | sudo dep/bin/deploy-nonrtric -f $RECEIPE_FILE |
| 56 | |
| 57 | while [[ $TIME -lt 2000 ]]; do |
| 58 | NONRTRIC_PODS=$(kubectl get pods -n nonrtric --field-selector=status.phase!=Running --no-headers) |
| 59 | if [[ -z "$NONRTRIC_PODS" ]]; then |
| 60 | echo "All NONRTRIC Components are running." |
| 61 | kubectl get pods -n nonrtric |
| 62 | break |
| 63 | fi |
| 64 | |
| 65 | echo "Waiting for NONRTRIC Components to be running..." |
| 66 | echo "These pods are not running" |
| 67 | echo "$NONRTRIC_PODS" |
| 68 | TIME=$(expr $TIME + 5) |
| 69 | sleep 5 |
| 70 | done |
| 71 | |
| 72 | echo "NONRTRIC component installation completed..." |