X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=installers%2Finstall_osm.sh;h=7cdf8bc41102c5eedf12b93b10e885b475c06b34;hb=102cd7fa3aab911b99691e56a8c0526b5e53f601;hp=87caad34b40b386b5a00263287d0fc92e006ef58;hpb=7077be66623b911d95bec3c463d53b535371411e;p=osm%2Fdevops.git diff --git a/installers/install_osm.sh b/installers/install_osm.sh index 87caad34..7cdf8bc4 100755 --- a/installers/install_osm.sh +++ b/installers/install_osm.sh @@ -31,7 +31,8 @@ function usage(){ 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 " --lightweight: install lightweight build of OSM" + echo -e " --lightweight: install lightweight build of OSM (default installation)" + echo -e " --soui: install classic build of OSM (based on LXD containers, with SO and UI)" echo -e " --vimemu: additionally fetch, build, and deploy the VIM emulator as a docker container" echo -e " --develop: (deprecated, use '-b master') install OSM from source code using the master branch" # echo -e " --reconfigure: reconfigure the modules (DO NOT change NAT rules)" @@ -533,7 +534,7 @@ function install_juju() { echo "Installing juju" sudo snap install juju --classic sudo dpkg-reconfigure -p medium lxd - juju bootstrap localhost osm + sg lxd -c "juju bootstrap localhost osm" echo "Finished installation of juju" } @@ -554,6 +555,8 @@ function generate_docker_images() { docker build ${LWTEMPDIR}/RO/lcm -t osm/lcm || ! echo "cannot build LCM docker image" >&2 git -C ${LWTEMPDIR} clone https://github.com/superfluidity/osm-light-ui.git docker build ${LWTEMPDIR}/osm-light-ui -t osm/light-ui -f ${LWTEMPDIR}/osm-light-ui/code/docker/Dockerfile +# git -C ${LWTEMPDIR} clone https://osm.etsi.org/gerrit/osm/LW-UI +# docker build ${LWTEMPDIR}/LW-UI -t osm/light-ui -f ${LWTEMPDIR}/LW-UI/Dockerfile EONG echo "Finished generation of docker images" } @@ -573,6 +576,11 @@ function generate_docker_env_files() { function deploy_lightweight() { echo "Deploying lightweight build" + if [ "${DEFAULT_MTU}" != "1500" ]; then + DOCKER_NETS=`sg docker -c "docker network list" | awk '{print $2}' | egrep -v "^ID$" | paste -d " " -s` + DOCKER_GW_NET=`sg docker -c "docker network inspect ${DOCKER_NETS}" | grep Subnet | awk -F\" '{print $4}' | egrep "^172" | sort -u | tail -1 | awk -F\. '{if ($2 != 255) print $1"."$2+1"."$3"."$4; else print "-1";}'` + sg docker -c "docker network create --subnet ${DOCKER_GW_NET} --opt com.docker.network.bridge.name=docker_gwbridge --opt com.docker.network.bridge.enable_icc=false --opt com.docker.network.bridge.enable_ip_masquerade=true --opt com.docker.network.driver.mtu=${DEFAULT_MTU} docker_gwbridge" + fi newgrp docker << EONG docker swarm init --advertise-addr ${DEFAULT_IP} docker network create --driver=overlay --attachable --opt com.docker.network.driver.mtu=${DEFAULT_MTU} netOSM @@ -687,7 +695,7 @@ INSTALL_VIMEMU="" INSTALL_FROM_LXDIMAGES="" LXD_REPOSITORY_BASE="https://osm-download.etsi.org/repository/osm/lxd" LXD_REPOSITORY_PATH="" -INSTALL_LIGHTWEIGHT="" +INSTALL_LIGHTWEIGHT="y" NOCONFIGURE="" RELEASE_DAILY="" SESSION_ID=`date +%s` @@ -734,6 +742,7 @@ while getopts ":hy-:b:r:k:u:R:l:p:D:" o; do [ "${OPTARG}" == "lxdinstall" ] && INSTALL_LXD="y" && continue [ "${OPTARG}" == "lxdimages" ] && INSTALL_FROM_LXDIMAGES="y" && continue [ "${OPTARG}" == "lightweight" ] && INSTALL_LIGHTWEIGHT="y" && continue + [ "${OPTARG}" == "soui" ] && INSTALL_LIGHTWEIGHT="" && && continue [ "${OPTARG}" == "vimemu" ] && INSTALL_VIMEMU="y" && continue [ "${OPTARG}" == "noconfigure" ] && NOCONFIGURE="y" && continue [ "${OPTARG}" == "showopts" ] && SHOWOPTS="y" && continue