X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Ffull_install_osm.sh;h=cfbab57945c8f3f0ffe6eb9d3a254d8e65041a1b;hb=fb566274af34f3a262830747aa92dd450682f8fd;hp=ce32f37d135309b80a4368d9301b7e4c215aaa77;hpb=ddd7a3ee6c921141d380bb68c6ef6048838f7658;p=osm%2Fdevops.git diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index ce32f37d..cfbab579 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -31,16 +31,17 @@ function usage(){ echo -e " --pm_stack: additionally deploy a Prometheus+Grafana stack for performance monitoring (PM)" echo -e " -o : do not install OSM, but ONLY one of the addons (vimemu, elk_stack, pm_stack) (assumes OSM is already installed)" echo -e " -D use local devops installation path" + echo -e " --nolxd: do not install and configure LXD, allowing unattended installations (assumes LXD is already installed and confifured)" echo -e " --uninstall: uninstall OSM: remove the containers and delete NAT rules" echo -e " --source: install OSM from source code using the latest stable tag" - echo -e " --lxdimages: download lxd images from OSM repository instead of creating them from scratch" - echo -e " -l : use specified repository url for lxd images" - echo -e " -p : use specified repository path for lxd images" - echo -e " --soui: install classic build of OSM (Rel THREE v3.1, based on LXD containers, with SO and UI)" echo -e " --develop: (deprecated, use '-b master') install OSM from source code using the master branch" + echo -e " --soui: install classic build of OSM (Rel THREE v3.1, based on LXD containers, with SO and UI)" + echo -e " --lxdimages: (only for Rel THREE with --soui) download lxd images from OSM repository instead of creating them from scratch" + echo -e " -l : (only for Rel THREE with --soui) use specified repository url for lxd images" + echo -e " -p : (only for Rel THREE with --soui) use specified repository path for lxd images" # echo -e " --reconfigure: reconfigure the modules (DO NOT change NAT rules)" - echo -e " --nat: install only NAT rules" - echo -e " --noconfigure: DO NOT install osmclient, DO NOT install NAT rules, DO NOT configure modules" + echo -e " --nat: (only for Rel THREE with --soui) install only NAT rules" + echo -e " --noconfigure: (only for Rel THREE with --soui) DO NOT install osmclient, DO NOT install NAT rules, DO NOT configure modules" # echo -e " --update: update to the latest stable release or to the latest commit if using a specific branch" echo -e " --showopts: print chosen options and exit (only for debugging)" echo -e " -y: do not prompt for confirmation, assumes yes" @@ -553,7 +554,7 @@ function install_docker_compose() { function install_juju() { echo "Installing juju" sudo snap install juju --classic - sudo dpkg-reconfigure -p medium lxd + [ -z "$INSTALL_NOLXD" ] && sudo dpkg-reconfigure -p medium lxd sg lxd -c "juju bootstrap --bootstrap-series=xenial localhost osm" [ $(sg lxd -c "juju status" |grep "osm" |wc -l) -eq 1 ] || FATAL "Juju installation failed" echo "Finished installation of juju" @@ -577,14 +578,12 @@ EONG git -C ${LWTEMPDIR}/LCM checkout ${COMMIT_ID} git -C ${LWTEMPDIR} clone https://osm.etsi.org/gerrit/osm/LW-UI git -C ${LWTEMPDIR}/LW-UI checkout ${COMMIT_ID} - newgrp docker << EONG - docker build ${LWTEMPDIR}/MON -f ${LWTEMPDIR}/MON/docker/Dockerfile -t osm/mon --no-cache || ! echo "cannot build MON docker image" >&2 - docker build ${LWTEMPDIR}/MON/policy_module -f ${LWTEMPDIR}/MON/policy_module/Dockerfile -t osm/pm --no-cache || ! echo "cannot build PM docker image" >&2 - docker build ${LWTEMPDIR}/NBI -f ${LWTEMPDIR}/NBI/Dockerfile.local -t osm/nbi --no-cache || ! echo "cannot build NBI docker image" >&2 - docker build ${LWTEMPDIR}/RO -f ${LWTEMPDIR}/RO/docker/Dockerfile-local -t osm/ro --no-cache || ! echo "cannot build RO docker image" >&2 - docker build ${LWTEMPDIR}/LCM -f ${LWTEMPDIR}/LCM/Dockerfile.local -t osm/lcm --no-cache || ! echo "cannot build LCM docker image" >&2 - docker build ${LWTEMPDIR}/LW-UI -t osm/light-ui -f ${LWTEMPDIR}/LW-UI/Dockerfile --no-cache || ! echo "cannot build LW-UI docker image" >&2 -EONG + sg docker -c "docker build ${LWTEMPDIR}/MON -f ${LWTEMPDIR}/MON/docker/Dockerfile -t osm/mon --no-cache" || FATAL "cannot build MON docker image" + sg docker -c "docker build ${LWTEMPDIR}/MON/policy_module -f ${LWTEMPDIR}/MON/policy_module/Dockerfile -t osm/pm --no-cache" || FATAL "cannot build PM docker image" + sg docker -c "docker build ${LWTEMPDIR}/NBI -f ${LWTEMPDIR}/NBI/Dockerfile.local -t osm/nbi --no-cache" || FATAL "cannot build NBI docker image" + sg docker -c "docker build ${LWTEMPDIR}/RO -f ${LWTEMPDIR}/RO/docker/Dockerfile-local -t osm/ro --no-cache" || FATAL "cannot build RO docker image" + sg docker -c "docker build ${LWTEMPDIR}/LCM -f ${LWTEMPDIR}/LCM/Dockerfile.local -t osm/lcm --no-cache" || FATAL "cannot build LCM docker image" + sg docker -c "docker build ${LWTEMPDIR}/LW-UI -t osm/light-ui -f ${LWTEMPDIR}/LW-UI/Dockerfile --no-cache" || FATAL "cannot build LW-UI docker image" echo "Finished generation of docker images" } @@ -686,7 +685,7 @@ function deploy_elk() { function deploy_perfmon() { 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 || ! echo 'cannot build kafka-exporter docker image' >&2" + 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" sudo mkdir -p /etc/osm/docker/osm_metrics sudo cp ${DEVOPS}/installers/docker/osm_metrics/*.yml /etc/osm/docker/osm_metrics @@ -706,16 +705,18 @@ function install_lightweight() { DEFAULT_IF=`route -n |awk '$1~/^0.0.0.0/ {print $8}'` DEFAULT_IP=`ip -o -4 a |grep ${DEFAULT_IF}|awk '{split($4,a,"/"); print a[1]}'` DEFAULT_MTU=$(ip addr show ${DEFAULT_IF} | perl -ne 'if (/mtu\s(\d+)/) {print $1;}') - need_packages_lw="lxd" - 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." \ - || sudo apt-get update \ - || FATAL "failed to run apt-get update" - dpkg -l $need_packages_lw &>/dev/null \ - || ! echo -e "Installing $need_packages_lw requires root privileges." \ - || sudo apt-get install -y $need_packages_lw \ - || FATAL "failed to install $need_packages_lw" + if [ -z "$INSTALL_NOLXD" ]; then + need_packages_lw="lxd" + 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." \ + || sudo apt-get update \ + || FATAL "failed to run apt-get update" + dpkg -l $need_packages_lw &>/dev/null \ + || ! echo -e "Installing $need_packages_lw requires root privileges." \ + || sudo apt-get install -y $need_packages_lw \ + || FATAL "failed to install $need_packages_lw" + fi install_juju track juju install_docker_ce @@ -745,7 +746,7 @@ function install_vimemu() { git clone https://osm.etsi.org/gerrit/osm/vim-emu.git $EMUTEMPDIR # build vim-emu docker echo "Building vim-emu Docker container..." - sudo docker build -t vim-emu-img -f $EMUTEMPDIR/Dockerfile --no-cache $EMUTEMPDIR/ + sudo docker build -t vim-emu-img -f $EMUTEMPDIR/Dockerfile --no-cache $EMUTEMPDIR/ || FATAL "cannot build vim-emu-img docker image" # start vim-emu container as daemon echo "Starting vim-emu Docker container 'vim-emu' ..." if [ -n "$INSTALL_LIGHTWEIGHT" ]; then @@ -783,6 +784,7 @@ function dump_vars(){ echo "INSTALL_ONLY=$INSTALL_ONLY" echo "INSTALL_ELK=$INSTALL_ELK" echo "INSTALL_PERFMON=$INSTALL_PERFMON" + echo "INSTALL_NOLXD=$INSTALL_NOLXD" echo "RELEASE=$RELEASE" echo "REPOSITORY=$REPOSITORY" echo "REPOSITORY_BASE=$REPOSITORY_BASE" @@ -817,7 +819,7 @@ SHOWOPTS="" COMMIT_ID="" ASSUME_YES="" INSTALL_FROM_SOURCE="" -RELEASE="-R ReleaseTHREE" +RELEASE="-R ReleaseFOUR" REPOSITORY="-r stable" INSTALL_VIMEMU="" INSTALL_FROM_LXDIMAGES="" @@ -827,6 +829,7 @@ INSTALL_LIGHTWEIGHT="y" INSTALL_ONLY="" INSTALL_ELK="" INSTALL_PERFMON="" +INSTALL_NOLXD="" NOCONFIGURE="" RELEASE_DAILY="" SESSION_ID=`date +%s` @@ -877,6 +880,7 @@ while getopts ":hy-:b:r:k:u:R:l:p:D:o:" o; do [ "${OPTARG}" == "reconfigure" ] && RECONFIGURE="y" && continue [ "${OPTARG}" == "test" ] && TEST_INSTALLER="y" && continue [ "${OPTARG}" == "lxdinstall" ] && INSTALL_LXD="y" && continue + [ "${OPTARG}" == "nolxd" ] && INSTALL_NOLXD="y" && continue [ "${OPTARG}" == "lxdimages" ] && INSTALL_FROM_LXDIMAGES="y" && continue [ "${OPTARG}" == "lightweight" ] && INSTALL_LIGHTWEIGHT="y" && continue [ "${OPTARG}" == "soui" ] && INSTALL_LIGHTWEIGHT="" && RELEASE="-R ReleaseTHREE" && REPOSITORY="-r stable" && continue @@ -905,6 +909,8 @@ done [ -n "$INSTALL_FROM_LXDIMAGES" ] && [ -n "$INSTALL_LIGHTWEIGHT" ] && FATAL "Incompatible options: --lxd can only be used with --soui" [ -n "$NAT" ] && [ -n "$INSTALL_LIGHTWEIGHT" ] && FATAL "Incompatible options: --nat can only be used with --soui" [ -n "$NOCONFIGURE" ] && [ -n "$INSTALL_LIGHTWEIGHT" ] && FATAL "Incompatible options: --noconfigure can only be used with --soui" +[ -n "$RELEASE_DAILY" ] && [ -n "$INSTALL_LIGHTWEIGHT" ] && FATAL "Incompatible options: --daily can only be used with --soui" +[ -n "$INSTALL_NOLXD" ] && [ -z "$INSTALL_LIGHTWEIGHT" ] && FATAL "Incompatible option: --nolxd cannot be used with --soui" if [ -n "$SHOWOPTS" ]; then dump_vars