Archive Airflow DAGs logs in stage3
[osm/devops.git] / installers / full_install_osm.sh
index 426b79c..a7f46a2 100755 (executable)
@@ -36,7 +36,8 @@ function usage(){
     echo -e "     -P <VCA pubkey> use VCA/juju public key file"
     echo -e "     -A <VCA apiproxy> use VCA/juju API proxy"
     echo -e "     --pla:          install the PLA module for placement support"
-    echo -e "     --ng-sa:        install Airflow and Pushgateway to get VNF and NS status (experimental)"
+    echo -e "     --old-sa:       install old Service Assurance framework (MON, POL); do not install Airflow and Pushgateway"
+    echo -e "     --ng-sa:        install new Service Assurance framework (Airflow, AlertManager and Pushgateway)  (enabled by default)"
     echo -e "     -m <MODULE>:    install OSM but only rebuild or pull the specified docker images (NG-UI, NBI, LCM, RO, MON, POL, PLA, KAFKA, MONGO, PROMETHEUS, PROMETHEUS-CADVISOR, KEYSTONE-DB, NONE)"
     echo -e "     -o <ADDON>:     ONLY (un)installs one of the addons (k8s_monitor, ng-sa)"
     echo -e "     -O <openrc file path/cloud name>: Install OSM to an OpenStack infrastructure. <openrc file/cloud name> is required. If a <cloud name> is used, the clouds.yaml file should be under ~/.config/openstack/ or /etc/openstack/"
@@ -247,12 +248,18 @@ function pull_docker_images() {
         sg docker -c "docker pull mysql:5" || FATAL "cannot get mysql docker image"
     fi
 
-    echo "Pulling OSM docker images"
-    for module in MON POL NBI KEYSTONE RO LCM NG-UI PLA osmclient Airflow; do
+    list_of_modules="MON NBI KEYSTONE RO LCM NG-UI osmclient"
+    if [ -n "$INSTALL_NGSA" ]; then
+        list_of_modules="${list_of_modules} Airflow Webhook"
+    else
+        list_of_modules="${list_of_modules} POL"
+    fi
+    if [ -n "$INSTALL_PLA" ]; then
+        list_of_modules="${list_of_modules} PLA"
+    fi
+    echo "Pulling OSM docker images for the following modules: ${list_of_modules}"
+    for module in ${list_of_modules}; do
         module_lower=${module,,}
-        if [ $module == "PLA" -a ! -n "$INSTALL_PLA" ]; then
-            continue
-        fi
         module_tag="${OSM_DOCKER_TAG}"
         if [ -n "${MODULE_DOCKER_TAG}" ] && echo $TO_REBUILD | grep -q $module ; then
             module_tag="${MODULE_DOCKER_TAG}"
@@ -500,10 +507,11 @@ function kube_secrets(){
     kubectl create secret generic ro-db-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/ro-db.env
     kubectl create secret generic ro-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/ro.env
     kubectl create secret generic keystone-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/keystone.env
-    kubectl create secret generic pol-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/pol.env
     if [ -n "${INSTALL_NGSA}" ]; then
         kubectl create secret generic ngsa-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/ngsa.env
         kubectl create secret generic webhook-translator-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/webhook-translator.env
+    else
+        kubectl create secret generic pol-secret -n $OSM_NAMESPACE --from-env-file=$OSM_DOCKER_WORK_DIR/pol.env
     fi
     [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
 }
@@ -511,6 +519,8 @@ function kube_secrets(){
 #deploys osm pods and services
 function deploy_osm_services() {
     [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
+    echo "The following manifests under $OSM_K8S_WORK_DIR will be deployed:"
+    ls $OSM_K8S_WORK_DIR
     kubectl apply -n $OSM_NAMESPACE -f $OSM_K8S_WORK_DIR
     [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
 }
@@ -547,7 +557,7 @@ function parse_yaml() {
     for module in $services; do
         if [ "$module" == "pla" ]; then
             if [ -n "$INSTALL_PLA" ]; then
-                echo "Updating K8s manifest file from opensourcemano\/pla:.* to ${DOCKER_REGISTRY_URL}${DOCKER_USER}\/pla:${TAG}"
+                echo "Updating K8s manifest file for ${module} from opensourcemano\/pla:.* to ${DOCKER_REGISTRY_URL}${DOCKER_USER}\/pla:${TAG}"
                 sudo sed -i "s#opensourcemano/pla:.*#${DOCKER_REGISTRY_URL}${DOCKER_USER}/pla:${TAG}#g" ${OSM_DOCKER_WORK_DIR}/osm_pla/pla.yaml
             fi
         else
@@ -557,7 +567,7 @@ function parse_yaml() {
             elif [ "$module" == "ng-mon" ]; then
                 image="mon"
             fi
-            echo "Updating K8s manifest file from opensourcemano\/${image}:.* to ${DOCKER_REGISTRY_URL}${DOCKER_USER}\/${image}:${TAG}"
+            echo "Updating K8s manifest file for ${module} from opensourcemano\/${image}:.* to ${DOCKER_REGISTRY_URL}${DOCKER_USER}\/${image}:${TAG}"
             sudo sed -i "s#opensourcemano/${image}:.*#${DOCKER_REGISTRY_URL}${DOCKER_USER}/${image}:${TAG}#g" ${OSM_K8S_WORK_DIR}/${module}.yaml
         fi
     done
@@ -565,6 +575,7 @@ function parse_yaml() {
 }
 
 function update_manifest_files() {
+    [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
     osm_services="nbi lcm ro pol mon ng-mon ng-ui keystone pla prometheus ng-prometheus"
     list_of_services=""
     for module in $osm_services; do
@@ -1004,7 +1015,7 @@ DEBUG_INSTALL=""
 RELEASE="ReleaseTEN"
 REPOSITORY="stable"
 INSTALL_K8S_MONITOR=""
-INSTALL_NGSA=""
+INSTALL_NGSA="y"
 INSTALL_PLA=""
 INSTALL_VIMEMU=""
 LXD_REPOSITORY_BASE="https://osm-download.etsi.org/repository/osm/lxd"
@@ -1204,6 +1215,7 @@ while getopts ":a:b:r:n:k:u:R:D:o:O:m:N:H:S:s:t:U:P:A:l:L:K:d:p:T:f:F:-: hy" o;
             [ "${OPTARG}" == "tag" ] && continue
             [ "${OPTARG}" == "registry" ] && continue
             [ "${OPTARG}" == "pla" ] && INSTALL_PLA="y" && continue
+            [ "${OPTARG}" == "old-sa" ] && INSTALL_NGSA="" && continue
             [ "${OPTARG}" == "ng-sa" ] && INSTALL_NGSA="y" && continue
             [ "${OPTARG}" == "volume" ] && OPENSTACK_ATTACH_VOLUME="true" && continue
             [ "${OPTARG}" == "nocachelxdimages" ] && continue