From: Patricia Reinoso Date: Thu, 1 Sep 2022 13:18:13 +0000 (+0200) Subject: Make PLA optional in charmed installer X-Git-Tag: release-v13.0-start~37 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F16%2F12516%2F8;p=osm%2Fdevops.git Make PLA optional in charmed installer PLA is no longer installed by default for the charmed installer flag --pla is needed Change-Id: Ib0ea0691fd53884dc5bf11d067e9f9d9df55c876 Signed-off-by: Patricia Reinoso --- diff --git a/installers/charm/bundles/osm-ha/bundle.yaml b/installers/charm/bundles/osm-ha/bundle.yaml index 7d1a4469..166cb00c 100644 --- a/installers/charm/bundles/osm-ha/bundle.yaml +++ b/installers/charm/bundles/osm-ha/bundle.yaml @@ -122,15 +122,6 @@ applications: charm: nginx-ingress-integrator channel: latest/stable scale: 3 - pla: - charm: osm-pla - channel: latest/stable - scale: 3 - series: kubernetes - options: - log_level: DEBUG - resources: - image: opensourcemano/pla:testing-daily prometheus: charm: osm-prometheus channel: latest/stable @@ -180,10 +171,6 @@ relations: - kafka:kafka - - mon:vca - vca:vca - - - pla:kafka - - kafka:kafka - - - pla:mongodb - - mongodb:database - - nbi:mongodb - mongodb:database - - nbi:kafka diff --git a/installers/charm/bundles/osm/bundle.yaml b/installers/charm/bundles/osm/bundle.yaml index f9fc6b99..64e73cd9 100644 --- a/installers/charm/bundles/osm/bundle.yaml +++ b/installers/charm/bundles/osm/bundle.yaml @@ -120,15 +120,6 @@ applications: charm: nginx-ingress-integrator channel: latest/stable scale: 1 - pla: - charm: osm-pla - channel: latest/stable - scale: 1 - series: kubernetes - options: - log_level: DEBUG - resources: - image: opensourcemano/pla:testing-daily prometheus: charm: osm-prometheus channel: latest/stable @@ -178,10 +169,6 @@ relations: - kafka:kafka - - mon:vca - vca:vca - - - pla:kafka - - kafka:kafka - - - pla:mongodb - - mongodb:database - - nbi:mongodb - mongodb:database - - nbi:kafka diff --git a/installers/charmed_install.sh b/installers/charmed_install.sh index 844e6463..2cd9a07c 100755 --- a/installers/charmed_install.sh +++ b/installers/charmed_install.sh @@ -26,6 +26,9 @@ IMAGES_OVERLAY_FILE=~/.osm/images-overlay.yaml PASSWORD_OVERLAY_FILE=~/.osm/password-overlay.yaml PATH=/snap/bin:${PATH} OSM_DEVOPS="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/.. &> /dev/null && pwd )" +INSTALL_PLA="" +PLA_OVERLAY_FILE=~/.osm/pla-overlay.yaml + if [ -f ${OSM_DEVOPS}/common/all_funcs ] ; then source ${OSM_DEVOPS}/common/all_funcs else @@ -59,6 +62,7 @@ function check_arguments(){ --tag) TAG="$2" ;; --registry) REGISTRY_INFO="$2" ;; --only-vca) ONLY_VCA=y ;; + --pla) INSTALL_PLA=y ;; esac shift done @@ -254,10 +258,12 @@ function deploy_charmed_osm(){ generate_password_overlay && secret_overlay="--overlay $PASSWORD_OVERLAY_FILE" + [ -n "$INSTALL_PLA" ] && create_pla_overlay && pla_overlay="--overlay $PLA_OVERLAY_FILE" + if [ -v BUNDLE ]; then - juju deploy --trust --channel $CHARMHUB_CHANNEL -m $MODEL_NAME $BUNDLE $images_overlay $extra_overlay $secret_overlay + juju deploy --trust --channel $CHARMHUB_CHANNEL -m $MODEL_NAME $BUNDLE $images_overlay $extra_overlay $secret_overlay $pla_overlay else - juju deploy --trust --channel $CHARMHUB_CHANNEL -m $MODEL_NAME $OSM_BUNDLE $images_overlay $extra_overlay $secret_overlay + juju deploy --trust --channel $CHARMHUB_CHANNEL -m $MODEL_NAME $OSM_BUNDLE $images_overlay $extra_overlay $secret_overlay $pla_overlay fi if [ ! -v KUBECFG ]; then @@ -295,7 +301,8 @@ function deploy_charmed_osm(){ function check_osm_deployed() { TIME_TO_WAIT=600 start_time="$(date -u +%s)" - total_service_count=16 + total_service_count=15 + [ -n "$INSTALL_PLA" ] && total_service_count=$((total_service_count + 1)) previous_count=0 while true do @@ -345,10 +352,34 @@ EOF mv /tmp/password-overlay.yaml $PASSWORD_OVERLAY_FILE } +function create_pla_overlay(){ + echo "Creating PLA Overlay" + [ $BUNDLE == $OSM_HA_BUNDLE ] && scale=3 || scale=1 + cat << EOF > /tmp/pla-overlay.yaml +applications: + pla: + charm: osm-pla + channel: latest/stable + scale: $scale + series: kubernetes + options: + log_level: DEBUG + resources: + image: opensourcemano/pla:testing-daily +relations: + - - pla:kafka + - kafka:kafka + - - pla:mongodb + - mongodb:database +EOF + mv /tmp/pla-overlay.yaml $PLA_OVERLAY_FILE +} + function generate_images_overlay(){ echo "applications:" > /tmp/images-overlay.yaml - charms_with_resources="nbi lcm mon pol ng-ui ro pla" + charms_with_resources="nbi lcm mon pol ng-ui ro" + [ -n "$INSTALL_PLA" ] && charms_with_resources+=" pla" for charm in $charms_with_resources; do cat << EOF > /tmp/${charm}_registry.yaml registrypath: ${REGISTRY_URL}opensourcemano/${charm}:$TAG