Feature 11077: new option to install specific components with a specific tag from... 30/15530/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 11 Nov 2025 22:04:39 +0000 (23:04 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 21 Nov 2025 09:17:01 +0000 (10:17 +0100)
Change-Id: Id49c65d3f22e123d7e4ad3c83cf93df2281ea6ad
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
installers/00-default-install-options.rc
installers/01-export-osm-install-options.sh
installers/40-deploy-osm.sh
installers/full_install_osm.sh
installers/install_osm.sh

index 59ee549..6159a52 100644 (file)
@@ -33,6 +33,7 @@ export DOCKER_REGISTRY_USER=
 export DOCKER_REGISTRY_PASSWORD=
 export DOCKER_REGISTRY_URL=
 export DOCKER_PROXY_URL=
+export MODULES_FOR_TESTING=
 export MODULE_DOCKER_TAG=
 export OSM_CLIENT_VERSION="master"
 export OSM_IM_VERSION="master"
index 7fa0302..a69eb64 100755 (executable)
@@ -49,6 +49,7 @@ export DOCKER_REGISTRY_USER=${DOCKER_REGISTRY_USER}
 export DOCKER_REGISTRY_PASSWORD=${DOCKER_REGISTRY_PASSWORD}
 export DOCKER_REGISTRY_URL=${DOCKER_REGISTRY_URL}
 export DOCKER_PROXY_URL=${DOCKER_PROXY_URL}
+export MODULES_FOR_TESTING=${MODULES_FOR_TESTING}
 export MODULE_DOCKER_TAG=${MODULE_DOCKER_TAG}
 export OSM_CLIENT_VERSION=${OSM_CLIENT_VERSION}
 export OSM_IM_VERSION=${OSM_IM_VERSION}
index 9d032cf..492471f 100755 (executable)
@@ -122,6 +122,25 @@ if [ -n "${OSM_BEHIND_PROXY}" ]; then
     fi
 fi
 
+# Only applicable to OSM CICD pipeline
+# Test specific modules specified in MODULES_FOR_TESTING, using docker tag MODULE_DOCKER_TAG
+if [ -n "${MODULES_FOR_TESTING}" ]; then
+    for module in MON NBI RO LCM KEYSTONE NGUI NG-SA prometheus webhookTranslator; do
+        if echo ${MODULES_FOR_TESTING} | grep -q ${module} ; then
+            if [ "${module}" == "NG-SA" ]; then
+                OSM_HELM_OPTS="${OSM_HELM_OPTS} --set-string airflow.defaultAirflowTag=${MODULE_DOCKER_TAG}"
+            elif [ "${module}" == "prometheus" ]; then
+                OSM_HELM_OPTS="${OSM_HELM_OPTS} --set prometheus.server.sidecarContainers.prometheus-config-sidecar.image=${DOCKER_REGISTRY_URL}${DOCKER_USER}/prometheus:${OSM_DOCKER_TAG}"
+            else
+                # For the rest of cases, set the image tag normally
+                helm_entry=${module,,}
+                echo "Setting custom docker tag ${MODULE_DOCKER_TAG} for module ${module} in helm options"
+                OSM_HELM_OPTS="${OSM_HELM_OPTS} --set ${helm_entry}.image.tag=${MODULE_DOCKER_TAG}"
+            fi
+        fi
+    done
+fi
+
 echo "helm upgrade --install -n $OSM_NAMESPACE --create-namespace $OSM_HELM_RELEASE ${HERE}/helm/osm ${OSM_HELM_OPTS}"
 helm upgrade --install -n $OSM_NAMESPACE --create-namespace $OSM_HELM_RELEASE ${HERE}/helm/osm ${OSM_HELM_OPTS}
 # Override existing values.yaml with the final values.yaml used to install OSM
index 35a9d9e..589fffa 100755 (executable)
@@ -35,7 +35,8 @@ function usage(){
     echo -e "     -s <namespace>  namespace where OSM helm chart will be deployed (default is osm)"
     echo -e "     -d <docker registry URL> use docker registry URL instead of dockerhub"
     echo -e "     -p <docker proxy URL> set docker proxy URL as part of docker CE configuration"
-    echo -e "     -T <docker tag> specify docker tag for the modules specified with option -m"
+    echo -e "     -m <MODULE>:    module to test a specific docker image (NG-UI, NBI, LCM, RO, MON) (can be used several times)"
+    echo -e "     -T <docker tag> use specific docker tag for the module specified with option -m"
     echo -e "     -U <docker user>: specify docker user to use when pulling images from a private registry"
     echo -e "     -D <devops path>: use particular devops installation path"
     echo -e "     -e <external IP>: set the external IP address of the OSM cluster (default is empty, which means autodetect)"
@@ -51,7 +52,7 @@ echo "Load default options and export user installation options"
 source $OSM_DEVOPS/installers/00-default-install-options.rc
 
 RE_CHECK='^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'
-while getopts ":a:c:e:r:k:u:R:D:s:t:U:d:p:T:M:G:O:-: hy" o; do
+while getopts ":a:c:e:r:k:u:R:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do
     case "${o}" in
         a)
             APT_PROXY_URL=${OPTARG}
@@ -101,6 +102,18 @@ while getopts ":a:c:e:r:k:u:R:D:s:t:U:d:p:T:M:G:O:-: hy" o; do
         p)
             DOCKER_PROXY_URL="${OPTARG}"
             ;;
+        m)
+            [ "${OPTARG}" == "NG-UI" ] && MODULES_FOR_TESTING="$MODULES_FOR_TESTING NGUI" && continue
+            [ "${OPTARG}" == "NBI" ] && MODULES_FOR_TESTING="$MODULES_FOR_TESTING NBI" && continue
+            [ "${OPTARG}" == "LCM" ] && MODULES_FOR_TESTING="$MODULES_FOR_TESTING LCM" && continue
+            [ "${OPTARG}" == "RO" ] && MODULES_FOR_TESTING="$MODULES_FOR_TESTING RO" && continue
+            [ "${OPTARG}" == "MON" ] && MODULES_FOR_TESTING="$MODULES_FOR_TESTING MON" && continue
+            [ "${OPTARG}" == "NG-SA" ] && MODULES_FOR_TESTING="$MODULES_FOR_TESTING NG-SA" && continue
+            [ "${OPTARG}" == "osmclient" ] && MODULES_FOR_TESTING="$MODULES_FOR_TESTING osmclient" && continue
+            [ "${OPTARG}" == "prometheus" ] && MODULES_FOR_TESTING="$MODULES_FOR_TESTING prometheus" && continue
+            [ "${OPTARG}" == "webhookTranslator" ] && MODULES_FOR_TESTING="$MODULES_FOR_TESTING webhookTranslator" && continue
+            [ "${OPTARG}" == "keystone" ] && MODULES_FOR_TESTING="$MODULES_FOR_TESTING keystone" && continue
+            ;;
         T)
             MODULE_DOCKER_TAG="${OPTARG}"
             ;;
index 870de5c..f007bd9 100755 (executable)
@@ -42,7 +42,8 @@ function usage(){
     echo -e "     -K:             Specifies the name of the controller to use - The controller must be already bootstrapped"
     echo -e "     -d <docker registry URL> use docker registry URL instead of dockerhub"
     echo -e "     -p <docker proxy URL> set docker proxy URL as part of docker CE configuration"
-    echo -e "     -T <docker tag> specify docker tag for the modules specified with option -m"
+    echo -e "     -m <MODULE>:    module to test a specific docker image (NG-UI, NBI, LCM, RO, MON) (can be used several times)"
+    echo -e "     -T <docker tag> use specific docker tag for the module specified with option -m"
     echo -e "     --debug:        debug mode"
     echo -e "     --uninstall:    uninstall OSM: remove the containers and delete NAT rules"
 }
@@ -100,7 +101,7 @@ EOF"
     [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
 }
 
-while getopts ":a:c:e:r:k:u:R:D:s:t:U:d:p:T:M:G:O:-: hy" o; do
+while getopts ":a:c:e:r:k:u:R:D:s:t:U:d:p:m:T:M:G:O:-: hy" o; do
     case "${o}" in
         D)
             DEVOPS_PATH="${OPTARG}"