From: lavado Date: Tue, 27 Nov 2018 18:35:18 +0000 (+0100) Subject: Merge "Adds healthcheck to MON Dockerfile" X-Git-Tag: v5.0.0~10 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=94efb80971c84f9f445b8678fcc1d12e8bfe9c36;hp=03ceed359b7f079712e20f105dc8328d37c44b2f;p=osm%2Fdevops.git Merge "Adds healthcheck to MON Dockerfile" --- diff --git a/docker/light-ui/Dockerfile b/docker/light-ui/Dockerfile index 4440b9a0..1e54567a 100644 --- a/docker/light-ui/Dockerfile +++ b/docker/light-ui/Dockerfile @@ -1,20 +1,26 @@ FROM ubuntu:16.04 -WORKDIR /usr/share/osm-lightui - -RUN apt-get update && apt-get install -y npm git python-pip nginx supervisor +RUN apt-get update && apt-get install -y npm git python-pip nginx supervisor curl software-properties-common RUN npm install -g bower +RUN ln -s /usr/bin/nodejs /usr/bin/node +RUN echo "daemon off;" >> /etc/nginx/nginx.conf -ARG LWUI_VERSION= -RUN git clone https://osm.etsi.org/gerrit/osm/LW-UI /usr/share/osm-lightui && echo LWUI_VERSION +ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian +ARG RELEASE=ReleaseFOUR-daily +ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg +ARG REPOSITORY=testing +ARG LWUI_VERSION -RUN ln -s /usr/bin/nodejs /usr/bin/node -RUN bower install --allow-root +RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add - +RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} LW-UI" && apt-get update + +RUN apt-get install -y osm-lightui${LWUI_VERSION} && \ + rm -rf /var/lib/apt/lists/* +WORKDIR /usr/share/osm-lightui +RUN bower install --allow-root RUN pip install -r requirements.txt RUN pip install uwsgi -# -RUN echo "daemon off;" >> /etc/nginx/nginx.conf RUN cp /usr/share/osm-lightui/nginx-app.conf /etc/nginx/sites-available/default RUN cp /usr/share/osm-lightui/supervisor-app.conf /etc/supervisor/conf.d/ diff --git a/docker/mk/Makefile.include b/docker/mk/Makefile.include index ced304aa..5f799205 100644 --- a/docker/mk/Makefile.include +++ b/docker/mk/Makefile.include @@ -19,7 +19,7 @@ CONTAINER_NAME ?= $(LOWER_MDG) CMD_DOCKER_ARGS ?= -q DOCKER_ARGS = $(CMD_DOCKER_ARGS) -DEPS := MON IM LCM RO common osmclient devops NBI policy-module Keystone N2VC +DEPS := MON IM LCM RO common osmclient devops NBI policy-module Keystone N2VC lightui DEPS_TARGETS = $(addprefix $(MKBUILD)/.dep_, $(DEPS)) @@ -31,6 +31,9 @@ $(MKBUILD): $(MKBUILD)/.dep_policy-module: $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m POL -p policy-module > $@ +$(MKBUILD)/.dep_lightui: + $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m LW-UI -p lightui > $@ + $(MKBUILD)/.dep_%: $Q$(MKINCLUDE)/get_version.sh -r $(REPOSITORY) -R $(RELEASE) -k $(REPOSITORY_KEY) -u $(REPOSITORY_BASE) -m $* > $@ @@ -50,7 +53,7 @@ build: $(MKBUILD) $(DEPS_TARGETS) --build-arg POL_VERSION==$(shell cat $(MKBUILD)/.dep_policy-module) \ --build-arg DEVOPS_VERSION==$(shell cat $(MKBUILD)/.dep_devops) \ --build-arg N2VC_VERSION==$(shell cat $(MKBUILD)/.dep_N2VC) \ - --build-arg LWUI_VERSION==$(shell date +%s) \ + --build-arg LWUI_VERSION==$(shell cat $(MKBUILD)/.dep_lightui) \ $(DOCKER_ARGS) . clean: diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index e1f2ff2b..146cda09 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -83,7 +83,7 @@ function uninstall(){ } # takes a juju/accounts.yaml file and returns the password specific -# for a controller. I wrote this using only bash tools to minimize +# for a controller. I wrote this using only bash tools to minimize # additions of other packages function parse_juju_password { password_file="${HOME}/.local/share/juju/accounts.yaml" @@ -551,12 +551,16 @@ function install_osmclient(){ #echo 'export OSM_SOL005=True' >> ${HOME}/.bashrc [ -z "$INSTALL_LIGHTWEIGHT" ] && export OSM_HOSTNAME=`lxc list | awk '($2=="SO-ub"){print $6}'` [ -z "$INSTALL_LIGHTWEIGHT" ] && export OSM_RO_HOSTNAME=`lxc list | awk '($2=="RO"){print $6}'` - [ -n "$INSTALL_LIGHTWEIGHT" ] && export OSM_HOSTNAME=127.0.0.1 echo -e "\nOSM client installed" - echo -e "You might be interested in adding the following OSM client env variables to your .bashrc file:" - echo " export OSM_HOSTNAME=${OSM_HOSTNAME}" - [ -n "$INSTALL_LIGHTWEIGHT" ] && echo " export OSM_SOL005=True" - [ -z "$INSTALL_LIGHTWEIGHT" ] && echo " export OSM_RO_HOSTNAME=${OSM_RO_HOSTNAME}" + if [ -z "$INSTALL_LIGHTWEIGHT" ]; then + echo -e "You might be interested in adding the following OSM client env variables to your .bashrc file:" + echo " export OSM_HOSTNAME=${OSM_HOSTNAME}" + echo " export OSM_RO_HOSTNAME=${OSM_RO_HOSTNAME}" + else + echo -e "OSM client assumes that OSM host is running in localhost (127.0.0.1)." + echo -e "In case you want to interact with a different OSM host, you will have to configure this env variable in your .bashrc file:" + echo " export OSM_HOSTNAME=" + fi return 0 } @@ -632,11 +636,11 @@ function install_juju() { } function juju_createcontroller() { - if ! sg lxd -c "juju show-controller $OSM_STACK_NAME &> /dev/null"; then + if ! juju show-controller $OSM_STACK_NAME &> /dev/null; then # Not found created, create the controller sg lxd -c "juju bootstrap --bootstrap-series=xenial localhost $OSM_STACK_NAME" fi - [ $(sg lxd -c "juju controllers" | awk "/^${OSM_STACK_NAME}[\*| ]/{print $1}"|wc -l) -eq 1 ] || FATAL "Juju installation failed" + [ $(juju controllers | awk "/^${OSM_STACK_NAME}[\*| ]/{print $1}"|wc -l) -eq 1 ] || FATAL "Juju installation failed" } function generate_docker_images() { @@ -1399,4 +1403,3 @@ fi wget -q -O- https://osm-download.etsi.org/ftp/osm-4.0-four/README2.txt &> /dev/null track end echo -e "\nDONE" -