[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
+function check_packages() {
+ NEEDED_PACKAGES="$1"
+ echo -e "Checking required packages: ${NEEDED_PACKAGES}"
+ for PACKAGE in ${NEEDED_PACKAGES} ; do
+ dpkg -L ${PACKAGE}
+ if [ $? -ne 0 ]; then
+ echo -e "Package ${PACKAGE} is not installed."
+ echo -e "Updating apt-cache ..."
+ sudo apt-get update
+ echo -e "Installing ${PACKAGE} ..."
+ sudo apt-get install -y ${PACKAGE} || FATAL "failed to install ${PACKAGE}"
+ fi
+ done
+ echo -e "Required packages are present: ${NEEDED_PACKAGES}"
+}
+
function install_lxd() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
# Apply sysctl production values for optimal performance
sg docker -c "docker pull wurstmeister/kafka:${KAFKA_TAG}" || FATAL "cannot get kafka docker image"
fi
- if [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q MONGO ; then
- 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 [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q GRAFANA ; then
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"
fi
if [ -z "$TO_REBUILD" ] || echo $TO_REBUILD | grep -q NBI || echo $TO_REBUILD | grep -q KEYSTONE-DB ; then
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
#Kubernetes resources
sudo cp -bR ${OSM_DEVOPS}/installers/docker/osm_pods $OSM_DOCKER_WORK_DIR
- sudo rm -f $OSM_K8S_WORK_DIR/mongo.yaml
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
function install_osm() {
[ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
+
+ trap ctrl_c INT
+ track start release $RELEASE none none docker_tag $OSM_DOCKER_TAG none none installation_type $OSM_INSTALLATION_TYPE none none
+
track checks checkingroot_ok
[ "$USER" == "root" ] && FATAL "You are running the installer as root. The installer is prepared to be executed as a normal user with sudo privileges."
track checks noroot_ok
DEFAULT_IF=$(ip route list|awk '$1=="default" {print $5; exit}')
[ -z "$DEFAULT_IF" ] && DEFAULT_IF=$(route -n |awk '$1~/^0.0.0.0/ {print $8; exit}')
[ -z "$DEFAULT_IF" ] && FATAL "Not possible to determine the interface with the default route 0.0.0.0"
- DEFAULT_IP=`ip -o -4 a s ${DEFAULT_IF} |awk '{split($4,a,"/"); print a[1]}'`
+ DEFAULT_IP=`ip -o -4 a s ${DEFAULT_IF} |awk '{split($4,a,"/"); print a[1]; exit}'`
[ -z "$DEFAULT_IP" ] && FATAL "Not possible to determine the IP address of the interface with the default route"
# configure apt proxy
# if no host is passed in, we need to install lxd/juju, unless explicilty asked not to
if [ -z "$OSM_VCA_HOST" ] && [ -z "$INSTALL_NOLXD" ] && [ -z "$LXD_CLOUD_FILE" ]; then
- need_packages_lw="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." \
- || 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"
install_lxd
fi
echo "OPENSTACK_VM_NAME"="$OPENSTACK_VM_NAME"
echo "OSM_DEVOPS=$OSM_DEVOPS"
echo "OSM_DOCKER_TAG=$OSM_DOCKER_TAG"
+ echo "OSM_DOCKER_WORK_DIR=$OSM_DOCKER_WORK_DIR"
+ echo "OSM_K8S_WORK_DIR=$OSM_K8S_WORK_DIR"
echo "OSM_STACK_NAME=$OSM_STACK_NAME"
echo "OSM_VCA_HOST=$OSM_VCA_HOST"
echo "OSM_VCA_PUBKEY=$OSM_VCA_PUBKEY"
[ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
}
+function ctrl_c() {
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
+ echo "** Trapped CTRL-C"
+ FATAL "User stopped the installation"
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
+}
+
LXD_VERSION=4.0
JUJU_VERSION=2.9
-JUJU_AGENT_VERSION=2.9.17
+JUJU_AGENT_VERSION=2.9.29
UNINSTALL=""
DEVELOP=""
UPDATE=""
DOCKER_USER=opensourcemano
PULL_IMAGES="y"
KAFKA_TAG=2.11-1.0.2
-PROMETHEUS_TAG=v2.4.3
-GRAFANA_TAG=latest
+KIWIGRID_K8S_SIDECAR_TAG="1.15.6"
+PROMETHEUS_TAG=v2.28.1
+GRAFANA_TAG=8.1.1
PROMETHEUS_NODE_EXPORTER_TAG=0.18.1
PROMETHEUS_CADVISOR_TAG=latest
KEYSTONEDB_TAG=10
# Uninstall if "--uninstall"
if [ -n "$UNINSTALL" ]; then
if [ -n "$CHARMED" ]; then
- track start release $RELEASE none none docker_tag $OSM_DOCKER_TAG none none installation_type $OSM_INSTALLATION_TYPE none none
${OSM_DEVOPS}/installers/charmed_uninstall.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D $OSM_DEVOPS -t $DOCKER_TAG "$@" || \
FATAL_TRACK charmed_uninstall "charmed_uninstall.sh failed"
else
# Charmed installation
if [ -n "$CHARMED" ]; then
- ${OSM_DEVOPS}/installers/charmed_install.sh -R $RELEASE -r $REPOSITORY -u $REPOSITORY_BASE -D $OSM_DEVOPS -t $DOCKER_TAG "$@" || \
+ export OSM_TRACK_INSTALLATION_ID="$(date +%s)-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16)"
+ track start release $RELEASE none none docker_tag $OSM_DOCKER_TAG none none installation_type $OSM_INSTALLATION_TYPE none none
+ ${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-11.0-eleven/README2.txt &> /dev/null
+ track end installation_type $OSM_INSTALLATION_TYPE
echo -e "\nDONE"
exit 0
fi
# if develop, we force master
[ -z "$COMMIT_ID" ] && [ -n "$DEVELOP" ] && COMMIT_ID="master"
-need_packages="git wget curl tar"
-
-echo -e "Checking required packages: $need_packages"
-dpkg -l $need_packages &>/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 &>/dev/null \
- || ! echo -e "Installing $need_packages requires root privileges." \
- || sudo apt-get install -y $need_packages \
- || FATAL "failed to install $need_packages"
+check_packages "git wget curl tar snapd"
+
sudo snap install jq
if [ -z "$OSM_DEVOPS" ]; then
if [ -n "$TEST_INSTALLER" ]; then
#Installation starts here
wget -q -O- https://osm-download.etsi.org/ftp/osm-11.0-eleven/README.txt &> /dev/null
export OSM_TRACK_INSTALLATION_ID="$(date +%s)-$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16)"
-
-track start release $RELEASE none none docker_tag $OSM_DOCKER_TAG none none installation_type $OSM_INSTALLATION_TYPE none none
-
install_osm
echo -e "\nDONE"
exit 0
-