X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=installers%2Ffull_install_osm.sh;h=42c2ed564430919424613b1c57dd098bdae80312;hb=cda4fbcc6ca2002b85303df528c711c7ca174c3b;hp=04605da77a649a33f6d9ebe40e916faad2abf898;hpb=ac08600d90e5a9604346d691f8a21ebe6f08eeac;p=osm%2Fdevops.git diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index 04605da7..42c2ed56 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -54,6 +54,7 @@ function usage(){ echo -e " -d use docker registry URL instead of dockerhub" echo -e " -p set docker proxy URL as part of docker CE configuration" echo -e " -T specify docker tag for the modules specified with option -m" + echo -e " --nocachelxdimages: do not cache local lxd images, do not create cronjob for that cache (will save installation time, might affect instantiation time)" echo -e " --nolxd: do not install and configure LXD, allowing unattended installations (assumes LXD is already installed and confifured)" echo -e " --nodocker: do not install docker, do not initialize a swarm (assumes docker is already installed and a swarm has been initialized)" echo -e " --nojuju: do not juju, assumes already installed" @@ -76,6 +77,7 @@ function usage(){ echo -e " [--lxd ]: Takes a YAML file as a parameter with the LXD Cloud information (--charmed option)" echo -e " [--lxd-cred ]: Takes a YAML file as a parameter with the LXD Credentials information (--charmed option)" echo -e " [--microstack]: Installs microstack as a vim. (--charmed option)" + echo -e " [--overlay]: Add an overlay to override some defaults of the default bundle (--charmed option)" echo -e " [--ha]: Installs High Availability bundle. (--charmed option)" echo -e " [--tag]: Docker image tag. (--charmed option)" echo -e " [--registry]: Docker registry with optional credentials as user:pass@hostname:port (--charmed option)" @@ -220,7 +222,7 @@ function uninstall_lightweight() { remove_stack osm_elk fi echo "Now osm docker images and volumes will be deleted" - # TODO: clean-up of images should take into account if other tags were used for specific modules + # TODO: clean-up of images should take into account if other tags were used for specific modules newgrp docker << EONG for module in ro lcm keystone nbi mon pol pla osmclient; do docker image rm ${DOCKER_REGISTRY_URL}${DOCKER_USER}/${module}:${OSM_DOCKER_TAG} @@ -339,6 +341,13 @@ function install_osmclient(){ sudo -H LC_ALL=C python3 -m pip install -U pip sudo -H LC_ALL=C python3 -m pip install -U python-magic pyangbind verboselogs sudo apt-get install -y python3-osm-im python3-osmclient + if [ -f /usr/lib/python3/dist-packages/osm_im/requirements.txt ]; then + python3 -m pip install -r /usr/lib/python3/dist-packages/osm_im/requirements.txt + fi + if [ -f /usr/lib/python3/dist-packages/osmclient/requirements.txt ]; then + sudo apt-get install -y libcurl4-openssl-dev libssl-dev + python3 -m pip install -r /usr/lib/python3/dist-packages/osmclient/requirements.txt + fi #sed 's,OSM_SOL005=[^$]*,OSM_SOL005=True,' -i ${HOME}/.bashrc #echo 'export OSM_HOSTNAME=localhost' >> ${HOME}/.bashrc #echo 'export OSM_SOL005=True' >> ${HOME}/.bashrc @@ -444,7 +453,7 @@ function install_juju() { echo "Installing juju" sudo snap install juju --classic --channel=2.8/stable [[ ":$PATH": != *":/snap/bin:"* ]] && PATH="/snap/bin:${PATH}" - update_juju_images + [ -n "$INSTALL_NOCACHELXDIMAGES" ] || update_juju_images echo "Finished installation of juju" return 0 } @@ -578,11 +587,11 @@ function generate_docker_images() { if [ $module == "PLA" -a ! -n "$INSTALL_PLA" ]; then continue fi - module_tag="${OSM_DOCKER_TAG}" + 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" + 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 else @@ -844,6 +853,7 @@ function install_kube() { #initializes kubernetes control plane function init_kubeadm() { sudo swapoff -a + sudo sed -i.bak '/.*none.*swap/s/^\(.*\)$/#\1/g' /etc/fstab sudo kubeadm init --config $1 sleep 5 } @@ -1532,6 +1542,7 @@ function dump_vars(){ echo "INSTALL_LIGHTWEIGHT=$INSTALL_LIGHTWEIGHT" echo "INSTALL_ONLY=$INSTALL_ONLY" echo "INSTALL_ELK=$INSTALL_ELK" + echo "INSTALL_NOCACHELXDIMAGES=$INSTALL_NOCACHELXDIMAGES" #echo "INSTALL_PERFMON=$INSTALL_PERFMON" echo "INSTALL_TO_OPENSTACK=$INSTALL_TO_OPENSTACK" echo "OPENSTACK_PUBLIC_NET_NAME=$OPENSTACK_PUBLIC_NET_NAME" @@ -1625,6 +1636,7 @@ KUBERNETES="y" NGUI="y" INSTALL_K8S_MONITOR="" INSTALL_NOHOSTCLIENT="" +INSTALL_NOCACHELXDIMAGES="" SESSION_ID=`date +%s` OSM_DEVOPS= OSM_VCA_HOST= @@ -1813,12 +1825,15 @@ while getopts ":b:r:c:n:k:u:R:D:o:O:m:N:H:S:s:w:t:U:P:A:l:L:K:d:p:T:f:F:-: hy" o [ "${OPTARG}" == "lxd" ] && continue [ "${OPTARG}" == "lxd-cred" ] && continue [ "${OPTARG}" == "microstack" ] && continue + [ "${OPTARG}" == "overlay" ] && continue + [ "${OPTARG}" == "only-vca" ] && continue [ "${OPTARG}" == "vca" ] && continue [ "${OPTARG}" == "ha" ] && continue [ "${OPTARG}" == "tag" ] && continue [ "${OPTARG}" == "registry" ] && continue [ "${OPTARG}" == "pla" ] && INSTALL_PLA="y" && continue [ "${OPTARG}" == "volume" ] && OPENSTACK_ATTACH_VOLUME="true" && continue + [ "${OPTARG}" == "nocachelxdimages" ] && INSTALL_NOCACHELXDIMAGES="y" && continue echo -e "Invalid option: '--$OPTARG'\n" >&2 usage && exit 1 ;;