X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Ffull_install_osm.sh;h=40700984da768abc254b396213ddac7537811eed;hb=6259144a75e944a76ff148776043d8dc9f50d978;hp=3515797feb319f416a155e9d635c33fc0bd05814;hpb=e00c8f935be102d88710200711d69a2b64e58d11;p=osm%2Fdevops.git diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 3515797f..40700984 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -646,7 +646,7 @@ function generate_docker_images() { BUILD_ARGS+=(--build-arg RELEASE="$RELEASE") BUILD_ARGS+=(--build-arg REPOSITORY_KEY="$REPOSITORY_KEY") BUILD_ARGS+=(--build-arg REPOSITORY_BASE="$REPOSITORY_BASE") - + if [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q KAFKA ; then 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" @@ -656,6 +656,10 @@ function generate_docker_images() { sg docker -c "docker pull mongo" || FATAL "cannot get mongo docker image" fi + if [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q PROMETHEUS ; then + sg docker -c "docker pull prom/prometheus:${PROMETHEUS_TAG}" || FATAL "cannot get prometheus docker image" + fi + if [ -n "$PULL_IMAGES" ]; then sg docker -c "docker pull ${DOCKER_USER}/mon:${OSM_DOCKER_TAG}" || FATAL "cannot pull MON docker image" sg docker -c "docker pull ${DOCKER_USER}/pol:${OSM_DOCKER_TAG}" || FATAL "cannot pull POL docker image" @@ -722,6 +726,7 @@ function cmp_overwrite() { function generate_config_log_folders() { echo "Generating config and log folders" $WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/docker-compose.yaml $OSM_DOCKER_WORK_DIR/docker-compose.yaml + $WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/prometheus.yml $OSM_DOCKER_WORK_DIR/prometheus.yml echo "Finished generation of config and log folders" } @@ -791,15 +796,18 @@ function deploy_lightweight() { OSM_KEYSTONE_PORT=5000 OSM_UI_PORT=80 OSM_MON_PORT=8662 + OSM_PROM_PORT=9090 + OSM_PROM_HOSTPORT=9091 [ -n "$INSTALL_ELK" ] && OSM_ELK_PORT=5601 [ -n "$INSTALL_PERFMON" ] && OSM_PM_PORT=3000 - + if [ -n "$NO_HOST_PORTS" ]; then OSM_PORTS+=(OSM_NBI_PORTS=$OSM_NBI_PORT) OSM_PORTS+=(OSM_RO_PORTS=$OSM_RO_PORT) OSM_PORTS+=(OSM_KEYSTONE_PORTS=$OSM_KEYSTONE_PORT) OSM_PORTS+=(OSM_UI_PORTS=$OSM_UI_PORT) OSM_PORTS+=(OSM_MON_PORTS=$OSM_MON_PORT) + OSM_PORTS+=(OSM_PROM_PORTS=$OSM_PROM_PORT) [ -n "$INSTALL_PERFMON" ] && OSM_PORTS+=(OSM_PM_PORTS=$OSM_PM_PORT) [ -n "$INSTALL_ELK" ] && OSM_PORTS+=(OSM_ELK_PORTS=$OSM_ELK_PORT) else @@ -808,6 +816,7 @@ function deploy_lightweight() { OSM_PORTS+=(OSM_KEYSTONE_PORTS=$OSM_KEYSTONE_PORT:$OSM_KEYSTONE_PORT) OSM_PORTS+=(OSM_UI_PORTS=$OSM_UI_PORT:$OSM_UI_PORT) OSM_PORTS+=(OSM_MON_PORTS=$OSM_MON_PORT:$OSM_MON_PORT) + OSM_PORTS+=(OSM_PROM_PORTS=$OSM_PROM_HOSTPORT:$OSM_PROM_PORT) [ -n "$INSTALL_PERFMON" ] && OSM_PORTS+=(OSM_PM_PORTS=$OSM_PM_PORT:$OSM_PM_PORT) [ -n "$INSTALL_ELK" ] && OSM_PORTS+=(OSM_ELK_PORTS=$OSM_ELK_PORT:$OSM_ELK_PORT) fi @@ -816,6 +825,7 @@ function deploy_lightweight() { echo "export TAG=${OSM_DOCKER_TAG}" | $WORKDIR_SUDO tee --append $OSM_DOCKER_WORK_DIR/osm_ports.sh echo "export DOCKER_USER=${DOCKER_USER}" | $WORKDIR_SUDO tee --append $OSM_DOCKER_WORK_DIR/osm_ports.sh echo "export KAFKA_TAG=${KAFKA_TAG}" | $WORKDIR_SUDO tee --append $OSM_DOCKER_WORK_DIR/osm_ports.sh + echo "export PROMETHEUS_TAG=${PROMETHEUS_TAG}" | $WORKDIR_SUDO tee --append $OSM_DOCKER_WORK_DIR/osm_ports.sh @@ -875,18 +885,14 @@ function deploy_elk() { } function deploy_perfmon() { - echo "Pulling docker images for PM (Grafana and Prometheus)" - sg docker -c "docker pull prom/prometheus" || FATAL "cannot get prometheus docker image" + echo "Pulling docker images for PM (Grafana)" sg docker -c "docker pull grafana/grafana" || FATAL "cannot get grafana docker image" echo "Finished pulling PM docker images" - echo "Generating osm/kafka-exporter docker image" - sg docker -c "docker build ${OSM_DEVOPS}/installers/docker/osm_metrics/kafka-exporter -f ${OSM_DEVOPS}/installers/docker/osm_metrics/kafka-exporter/Dockerfile -t osm/kafka-exporter --no-cache" || FATAL "cannot build kafka-exporter docker image" - echo "Finished generation of osm/kafka-exporter docker image" $WORKDIR_SUDO mkdir -p $OSM_DOCKER_WORK_DIR/osm_metrics $WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/osm_metrics/*.yml $OSM_DOCKER_WORK_DIR/osm_metrics $WORKDIR_SUDO cp -b ${OSM_DEVOPS}/installers/docker/osm_metrics/*.json $OSM_DOCKER_WORK_DIR/osm_metrics remove_stack osm_metrics - echo "Deploying PM stack (Kafka exporter + Prometheus + Grafana)" + echo "Deploying PM stack (Grafana)" sg docker -c "OSM_NETWORK=net${OSM_STACK_NAME} docker stack deploy -c $OSM_DOCKER_WORK_DIR/osm_metrics/docker-compose.yml osm_metrics" echo "Finished deployment of PM stack" return 0 @@ -910,7 +916,7 @@ function install_lightweight() { # if no host is passed in, we need to install lxd/juju, unless explicilty asked not to if [ -z "$OSMLCM_VCA_HOST" ] && [ -z "$INSTALL_NOLXD" ]; then - need_packages_lw="lxd" + need_packages_lw="lxd snapd" echo -e "Checking required packages: $need_packages_lw" dpkg -l $need_packages_lw &>/dev/null \ || ! echo -e "One or several required packages are not installed. Updating apt cache requires root privileges." \ @@ -1075,6 +1081,7 @@ OSM_WORK_DIR="/etc/osm" OSM_DOCKER_TAG=latest DOCKER_USER=osm KAFKA_TAG=2.11-1.0.2 +PROMETHEUS_TAG=v2.4.3 while getopts ":hy-:b:r:k:u:R:l:p:D:o:m:H:S:s:w:t:" o; do case "${o}" in