Feature 11007: replace charmed mongodb with bitnami helm chart
[osm/devops.git] / installers / full_install_osm.sh
index 2ec0333..e053bd7 100755 (executable)
@@ -215,45 +215,6 @@ function docker_login() {
     [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
 }
 
-function pull_docker_images() {
-    [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
-    echo "Pulling docker images"
-    [ -n "${DOCKER_REGISTRY_URL}" ] && docker_login
-
-    echo "Pulling non-OSM docker images"
-    sg docker -c "docker pull wurstmeister/zookeeper" || FATAL "cannot get zookeeper docker image"
-    sg docker -c "docker pull wurstmeister/kafka:${KAFKA_TAG}" || FATAL "cannot get kafka docker image"
-    sg docker -c "docker pull prom/prometheus:${PROMETHEUS_TAG}" || FATAL "cannot get prometheus docker image"
-    sg docker -c "docker pull google/cadvisor:${PROMETHEUS_CADVISOR_TAG}" || FATAL "cannot get prometheus cadvisor docker image"
-    sg docker -c "docker pull grafana/grafana:${GRAFANA_TAG}" || FATAL "cannot get grafana docker image"
-    sg docker -c "docker pull kiwigrid/k8s-sidecar:${KIWIGRID_K8S_SIDECAR_TAG}" || FATAL "cannot get kiwigrid k8s-sidecar docker image"
-    sg docker -c "docker pull mariadb:${KEYSTONEDB_TAG}" || FATAL "cannot get keystone-db docker image"
-    sg docker -c "docker pull mysql:5" || FATAL "cannot get mysql docker image"
-
-    list_of_modules="MON NBI KEYSTONE RO LCM NG-UI osmclient prometheus"
-    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,,}
-        module_tag="${OSM_DOCKER_TAG}"
-        if [ -n "${MODULE_DOCKER_TAG}" ] && echo $TO_REBUILD | grep -q $module ; then
-            module_tag="${MODULE_DOCKER_TAG}"
-        fi
-        echo "Pulling ${DOCKER_REGISTRY_URL}${DOCKER_USER}/${module_lower}:${module_tag} docker image"
-        sg docker -c "docker pull ${DOCKER_REGISTRY_URL}${DOCKER_USER}/${module_lower}:${module_tag}" || FATAL "cannot pull $module docker image"
-    done
-
-    echo "Finished pulling docker images"
-    [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
-}
-
 function generate_docker_images() {
     [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
     echo "Generating docker images"
@@ -347,7 +308,10 @@ function deploy_charmed_services() {
 #deploy mongodb
 function deploy_mongodb() {
     [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
-    deploy_charmed_services
+    MONGO_OPTS="-d ${OSM_HELM_WORK_DIR} -D ${OSM_DEVOPS} -t ${OSM_DOCKER_TAG} -U ${DOCKER_USER} ${DEBUG_INSTALL}"
+    [ -n "${DOCKER_REGISTRY_URL}" ] && MONGO_OPTS="${MONGO_OPTS} -r ${DOCKER_REGISTRY_URL}"
+    $OSM_DEVOPS/installers/install_mongodb.sh ${MONGO_OPTS} || \
+    FATAL_TRACK install_osm_mongodb_service "install_mongodb.sh failed"
     [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
 }
 
@@ -538,7 +502,6 @@ function install_osm() {
     track juju juju_ok
 
     # Deploy OSM services
-    [ -z "$DOCKER_NOBUILD" ] && pull_docker_images
     [ -z "$DOCKER_NOBUILD" ] && [ -z "$PULL_IMAGES" ] && generate_docker_images
     track docker_images docker_images_ok
 
@@ -572,7 +535,7 @@ function install_osm() {
 
     arrange_docker_default_network_policy
 
-    wget -q -O- https://osm-download.etsi.org/ftp/osm-13.0-thirteen/README2.txt &> /dev/null
+    wget -q -O- https://osm-download.etsi.org/ftp/osm-14.0-fourteen/README2.txt &> /dev/null
     track end
     sudo find /etc/osm
     [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
@@ -766,7 +729,7 @@ OSM_WORK_DIR="/etc/osm"
 OSM_HELM_WORK_DIR="${OSM_WORK_DIR}/helm"
 OSM_HOST_VOL="/var/lib/osm"
 OSM_NAMESPACE_VOL="${OSM_HOST_VOL}/${OSM_NAMESPACE}"
-OSM_DOCKER_TAG=latest
+OSM_DOCKER_TAG="testing-daily"
 DOCKER_USER=opensourcemano
 PULL_IMAGES="y"
 KAFKA_TAG=2.11-1.0.2
@@ -977,7 +940,7 @@ fi
 # Installation starts here
 
 # Get README and create OSM_TRACK_INSTALLATION_ID
-wget -q -O- https://osm-download.etsi.org/ftp/osm-13.0-thirteen/README.txt &> /dev/null
+wget -q -O- https://osm-download.etsi.org/ftp/osm-14.0-fourteen/README.txt &> /dev/null
 export OSM_TRACK_INSTALLATION_ID="$(date +%s)-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16)"
 
 # Get OS info to be tracked
@@ -993,7 +956,7 @@ if [ -n "$CHARMED" ]; then
     sudo snap install jq || FATAL "Could not install jq (snap package). Make sure that snap works"
     ${OSM_DEVOPS}/installers/charmed_install.sh --tag $OSM_DOCKER_TAG "$@" || \
     FATAL_TRACK charmed_install "charmed_install.sh failed"
-    wget -q -O- https://osm-download.etsi.org/ftp/osm-13.0-thirteen/README2.txt &> /dev/null
+    wget -q -O- https://osm-download.etsi.org/ftp/osm-14.0-fourteen/README2.txt &> /dev/null
     echo -e "\nDONE"
     exit 0
 fi