Skip to content
Snippets Groups Projects
Commit 13d76c82 authored by Mike Marchetti's avatar Mike Marchetti
Browse files

Add dockerfile for MDG's


- Added option to installer to use specfic docker build tag

Change-Id: Ia6cf6316c6fb84a18ecdbaf98747a95c20ce2f0b
Signed-off-by: default avatarMike Marchetti <mmarchetti@sandvine.com>
parent b8420859
No related branches found
No related tags found
No related merge requests found
Showing
with 401 additions and 27 deletions
build/
# This creates som/LCM docker from from last stable package
FROM ubuntu:16.04
# Set the working directory to /app
WORKDIR /app/osm_lcm
# avoid extra information from packages
RUN echo 'path-exclude /usr/share/doc/*\n\
path-include /usr/share/doc/*/copyright\n\
path-exclude /usr/share/man/*\n\
path-exclude /usr/share/groff/*\n\
path-exclude /usr/share/info/*\n\
path-exclude /usr/share/lintian/*\n\
path-exclude /usr/share/linda/*\n'\
> /etc/dpkg/dpkg.cfg.d/01_nodoc && \
echo 'APT::Install-Recommends "false";\n\
APT::AutoRemove::RecommendsImportant "false";\n\
APT::AutoRemove::SuggestsImportant "false";\n'\
> /etc/apt/apt.conf.d/99_norecommends
RUN apt-get update && apt-get -y install curl software-properties-common
RUN apt-get update && apt-get install -y git make python3 \
python3-pip python3-pymongo python3-yaml python3-aiohttp \
python3-all python3-setuptools \
python3-bitarray python3-regex python3-lxml dh-python wget tox \
python3-cffi \
&& pip3 install pip==9.0.3 \
&& pip3 install -U aiokafka pyang lxml six enum34 \
&& pip3 install websockets==4.0.1 \
&& pip3 install requests
RUN pip3 install PyNaCl
RUN git clone https://osm.etsi.org/gerrit/osm/N2VC.git \
&& cd N2VC \
&& git checkout BUILD_v4.0.1_1 \
&& cd modules/libjuju && python3 setup.py develop && cd ../.. \
&& pip3 install -U -r requirements.txt
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
RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} LCM N2VC common" && apt update
ARG LCM_VERSION
ARG COMMON_VERSION
ARG N2VC_VERSION
RUN apt-get update && apt-get install -y python3-osm-lcm${LCM_VERSION} \
python3-osm-common${COMMON_VERSION} \
python3-n2vc${N2VC_VERSION} \
&& rm -rf /var/lib/apt/lists/*
EXPOSE 9999
LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
Description="This implements life cycle management engine for OSM" \
Version="1.0" \
Author="Alfonso Tierno"
# Used for local storage
VOLUME /app/storage
# Used for logs
VOLUME /app/log
# The following ENV can be added with "docker run -e xxx' to configure LCM
ENV OSMLCM_RO_HOST ro
ENV OSMLCM_RO_PORT 9090
ENV OSMLCM_RO_TENANT osm
# VCA
ENV OSMLCM_VCA_HOST vca
ENV OSMLCM_VCA_PORT: 17070
ENV OSMLCM_VCA_USER: admin
ENV OSMLCM_VCA_SECRET: secret
# database
ENV OSMLCM_DATABASE_DRIVER mongo
ENV OSMLCM_DATABASE_HOST mongo
ENV OSMLCM_DATABASE_PORT 27017
ENV OSMLCM_STORAGE_DRIVER local
ENV OSMLCM_STORAGE_PATH /app/storage
# message
ENV OSMLCM_MESSAGE_DRIVER kafka
ENV OSMLCM_MESSAGE_HOST kafka
ENV OSMLCM_MESSAGE_PORT 9092
# Run app.py when the container launches
CMD ["python3", "/usr/lib/python3/dist-packages/osm_lcm/lcm.py"]
include ../mk/Makefile.include
MDG=$(shell basename $(CURDIR))
......@@ -26,19 +26,22 @@ LABEL authors="Guillermo Calvino"
RUN apt-get update && apt-get -y install curl software-properties-common
RUN apt-get --yes update \
&& apt-get --yes install git python python-pip python3 python3-pip libmysqlclient-dev libssl-dev libffi-dev \
&& pip3 install pip==9.0.3
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
RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} MON IM common" && apt update
RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} MON common" && apt update
RUN apt-get --yes update \
&& apt-get --yes install git python python-pip python3 python3-pip libmysqlclient-dev libssl-dev libffi-dev \
&& pip3 install pip==9.0.3
ARG MON_VERSION
ARG COMMON_VERSION
RUN apt-get --yes update && apt-get -y install python3-osm-common python3-osm-mon
RUN apt-get --yes update && apt-get -y install python3-osm-common${COMMON_VERSION} python3-osm-mon${MON_VERSION}
COPY scripts/ scripts/
......
include ../mk/Makefile.include
MDG=$(shell basename $(CURDIR))
#
# Copyright 2017 Sandvine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
SUBDIRS = MON NBI osmclient RO LCM light-ui pm
include mk/dirs.mk
......@@ -4,6 +4,12 @@ FROM ubuntu:16.04
RUN apt-get update && apt-get -y install curl software-properties-common
RUN apt-get update && apt-get install -y git python3 python3-jsonschema \
python3-pymongo python3-yaml python3-pip \
&& pip3 install pip==9.0.3 \
&& pip3 install aiokafka cherrypy pyangbind \
&& mkdir -p /app/storage/kafka && mkdir -p /app/log
ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
ARG RELEASE=ReleaseFOUR-daily
ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
......@@ -12,19 +18,21 @@ ARG REPOSITORY=testing
RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} NBI IM common" && apt update
RUN apt-get -y install python3-osm-nbi python3-osm-common python3-osm-im
ARG NBI_VERSION
ARG COMMON_VERSION
ARG IM_VERSION
RUN apt-get update && apt-get -y install python3-osm-nbi${NBI_VERSION} python3-osm-common${COMMON_VERSION} python3-osm-im${IM_VERSION}
# Set the working directory to /app
WORKDIR /app/osm_nbi
RUN apt-get update && apt-get install -y git python3 python3-jsonschema \
python3-pymongo python3-yaml python3-pip \
&& pip3 install pip==9.0.3 \
&& pip3 install aiokafka cherrypy pyangbind \
&& mkdir -p /app/storage/kafka && mkdir -p /app/log
EXPOSE 9999
RUN cp -R /usr/lib/python3/dist-packages/osm_nbi/html_public /app/osm_nbi/html_public
RUN cp /usr/lib/python3/dist-packages/osm_nbi/nbi.cfg /app/osm_nbi/
RUN cp -R /usr/lib/python3/dist-packages/osm_nbi/http /app/osm_nbi/
LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
Description="This implements a north bound interface for OSM" \
Version="1.0" \
......@@ -46,7 +54,7 @@ ENV OSMNBI_DATABASE_DRIVER mongo
ENV OSMNBI_DATABASE_HOST mongo
ENV OSMNBI_DATABASE_PORT 27017
# web
ENV OSMNBI_STATIC_DIR /usr/lib/python3/dist-packages/osm_nbi/html_public
ENV OSMNBI_STATIC_DIR /app/osm_nbi/html_public
# logs
ENV OSMNBI_LOG_FILE /app/log
ENV OSMNBI_LOG_LEVEL DEBUG
......
include ../mk/Makefile.include
MDG=$(shell basename $(CURDIR))
......@@ -2,7 +2,8 @@ from ubuntu:xenial
MAINTAINER Gennadiy Dubina <gennadiy.dubina@dataat.com>; Alfonso Tierno <alfonso.tiernosepulveda@telefoncia.com>
RUN apt-get update && apt-get -y install curl software-properties-common
RUN apt-get update && apt-get -y install curl software-properties-common git
RUN apt-get update && apt-get install -y python-setuptools python-wheel mysql-client python-bitarray
ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
ARG RELEASE=ReleaseFOUR-daily
......@@ -12,8 +13,10 @@ ARG REPOSITORY=testing
RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} RO IM common openvim" && apt update
RUN apt-get update && apt-get install -y python-setuptools python-wheel mysql-client python-bitarray
RUN apt-get update && apt-get install -y python-osm-ro python-osm-im
ARG RO_VERSION
ARG IM_VERSION
RUN apt-get update && apt-get install -y python-osm-ro${RO_VERSION} python-osm-im${IM_VERSION}
RUN mkdir -p /bin/RO
......
include ../mk/Makefile.include
MDG=$(shell basename $(CURDIR))
FROM ubuntu:16.04
WORKDIR /usr/src/app
RUN apt-get update && apt-get install -y npm git python-pip nginx supervisor
RUN npm install -g bower
RUN git clone https://osm.etsi.org/gerrit/osm/LW-UI /usr/src/app
RUN ln -s /usr/bin/nodejs /usr/bin/node
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/src/app/nginx-app.conf /etc/nginx/sites-available/default
RUN cp /usr/src/app/supervisor-app.conf /etc/supervisor/conf.d/
# delete the copy of the database inside the container (if exists)
RUN rm -f db.sqlite3
ENV DJANGO_ENV=prod
RUN python manage.py makemigrations authosm
RUN python manage.py migrate
RUN python manage.py collectstatic --noinput
EXPOSE 80
CMD ["supervisord", "-n"]
include ../mk/Makefile.include
# Currently LW-UI needs no-cache (binary version packages not yet available)
DOCKER_ARGS += $(NO_CACHE)
MDG=$(shell basename $(CURDIR))
TOPDIR=$(shell readlink -f .|sed -e 's/\/docker\/.*//')
MKINCLUDE=$(TOPDIR)/docker/mk
MKBUILD=$(TOPDIR)/docker/build
all: build
TAG ?= latest
REPOSITORY_BASE ?= http://osm-download.etsi.org/repository/osm/debian
RELEASE ?= ReleaseFOUR-daily
REPOSITORY_KEY ?= OSM%20ETSI%20Release%20Key.gpg
REPOSITORY ?= testing
NO_CACHE ?= --no-cache
LOWER_MDG = $(shell echo $(MDG) | tr '[:upper:]' '[:lower:]')
CMD_DOCKER_ARGS ?= -q
DOCKER_ARGS = $(CMD_DOCKER_ARGS)
DEPS := MON IM LCM RO common osmclient devops NBI
DEPS_TARGETS = $(addprefix $(MKBUILD)/.dep_, $(DEPS))
Q=@
$(MKBUILD):
$Qmkdir -p $(MKBUILD)
$(MKBUILD)/.dep_%:
$Q$(MKINCLUDE)/get_version.sh -m $* > $@
build: $(MKBUILD) $(DEPS_TARGETS)
$Qdocker build -t osm/$(LOWER_MDG):$(TAG) \
--build-arg RELEASE=$(RELEASE) \
--build-arg REPOSITORY=$(REPOSITORY) \
--build-arg REPOSITORY_KEY=$(REPOSITORY_KEY) \
--build-arg REPOSITORY_BASE=$(REPOSITORY_BASE) \
--build-arg MON_VERSION==$(shell cat $(MKBUILD)/.dep_MON) \
--build-arg IM_VERSION==$(shell cat $(MKBUILD)/.dep_IM) \
--build-arg RO_VERSION==$(shell cat $(MKBUILD)/.dep_RO) \
--build-arg LCM_VERSION==$(shell cat $(MKBUILD)/.dep_LCM) \
--build-arg COMMON_VERSION==$(shell cat $(MKBUILD)/.dep_common) \
--build-arg OSMCLIENT_VERSION==$(shell cat $(MKBUILD)/.dep_osmclient) \
--build-arg NBI_VERSION==$(shell cat $(MKBUILD)/.dep_NBI) \
$(DOCKER_ARGS) .
clean:
rm -f $(MKBUILD)/.dep*
tag:
docker tag osm/$(LOWER_MDG) osm/$(LOWER_MDG):$(TAG)
#
# Copyright 2017 Sandvine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
TOPDIR=$(shell readlink -f .|sed -e 's/\/descriptor-packages\/.*//')
TOOLS_DIR := $(TOPDIR)/tools
SUBDIRS_CLEAN = $(addsuffix .clean, $(SUBDIRS))
SUBDIRS_TEST = $(addsuffix .test, $(SUBDIRS))
SUBDIRS_TAG = $(addsuffix .tag, $(SUBDIRS))
.PHONY: $(SUBDIRS) $(SUBDIRS_CLEAN) clean test tag
all: $(SUBDIRS)
clean: $(SUBDIRS_CLEAN)
test: $(SUBDIRS_TEST)
tag: $(SUBDIRS_TAG)
$(SUBDIRS_CLEAN): %.clean:
@$(MAKE) --no-print-directory -C $* clean
$(SUBDIRS_TEST): %.test:
@$(MAKE) --no-print-directory -C $* test
$(SUBDIRS_TAG): %.tag:
@$(MAKE) --no-print-directory -C $* tag
$(SUBDIRS):
@$(MAKE) --no-print-directory -C $@
test:
$(TOOLS_DIR)/launch_tests.sh
#!/bin/sh
RELEASE="ReleaseFOUR-daily"
REPOSITORY_KEY="OSM%20ETSI%20Release%20Key.gpg"
REPOSITORY="testing"
REPOSITORY_BASE="http://osm-download.etsi.org/repository/osm/debian"
DEBUG=
while getopts ":r:k:u:R:b:-:dm:" o; do
case "${o}" in
r)
REPOSITORY=${OPTARG}
;;
R)
RELEASE=${OPTARG}
;;
k)
REPOSITORY_KEY=${OPTARG}
;;
u)
REPOSITORY_BASE=${OPTARG}
;;
d)
DEBUG=y
;;
m)
MDG=${OPTARG}
;;
-)
;;
esac
done
if [ -z "$MDG" ]; then
echo "missing MDG"
fi
if [ -n "$DEBUG" ]; then
echo curl $REPOSITORY_BASE/$RELEASE/dists/$REPOSITORY/$MDG/binary-amd64/Packages
fi
curl $REPOSITORY_BASE/$RELEASE/dists/$REPOSITORY/$MDG/binary-amd64/Packages 2>/dev/null | awk -v mdg=$MDG '{
if ( /Package:/ && match($2,tolower(mdg)) ) {
package=1;
} else if (package==1 && match($1,"Version:")) {
package=0;
printf("%s\n", $2);
}
}' | head -1
......@@ -4,6 +4,10 @@ LABEL authors="Michael Marchetti"
RUN apt-get update && apt-get -y install curl software-properties-common
RUN apt-get update && apt-get -y install python \
libcurl4-gnutls-dev libgnutls-dev iputils-ping python-pip
RUN pip install python-magic pytest
ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
ARG RELEASE=ReleaseFOUR-daily
ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
......@@ -12,9 +16,10 @@ ARG REPOSITORY=testing
RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} devops osmclient" && apt update
RUN apt-get update && apt-get -y install python \
libcurl4-gnutls-dev libgnutls-dev osm-devops python-osmclient iputils-ping python-pip
RUN pip install python-magic pytest
ARG OSMCLIENT_VERSION
ARG DEVOPS_VERSION
RUN apt-get update && apt-get -y install osm-devops${DEVOPS_VERSION} python-osmclient${OSMCLIENT_VERSION}
ENV OSM_SOL005=True
ENV OSM_HOSTNAME=nbi:9999
......
include ../mk/Makefile.include
MDG=$(shell basename $(CURDIR))
# Copyright 2018 Whitestack, LLC
# *************************************************************
# This file is part of OSM Monitoring module
# All Rights Reserved to Whitestack, LLC
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# For those usages not covered by the Apache License, Version 2.0 please
# contact: bdiaz@whitestack.com or glavado@whitestack.com
##
FROM ubuntu:16.04
LABEL authors="Benjamín Díaz"
RUN apt-get --yes update \
&& apt-get --yes install python3 python3-pip libmysqlclient-dev git \
&& pip3 install pip==9.0.3
RUN git clone https://osm.etsi.org/gerrit/osm/MON MON
#COPY requirements.txt /policy_module/requirements.txt
RUN pip3 install -r /MON/policy_module/requirements.txt
RUN pip3 install /MON/policy_module
CMD bash /MON/policy_module/scripts/gen_config_from_env.sh && osm-policy-agent --config osm_policy_agent.cfg
include ../mk/Makefile.include
# Currently LW-UI needs no-cache (binary version packages not yet available)
DOCKER_ARGS += $(NO_CACHE)
MDG=$(shell basename $(CURDIR))
......@@ -13,13 +13,13 @@ networks:
# com.docker.network.driver.mtu: "1446"
services:
zookeeper:
image: wurstmeister/zookeeper
image: wurstmeister/zookeeper:${ZOOKEEPER_TAG:-latest}
# ports:
# - "2181:2181"
networks:
- netOSM
kafka:
image: wurstmeister/kafka
image: wurstmeister/kafka:${KAFKA_TAG:-latest}
ports:
- "9092"
networks:
......@@ -41,7 +41,7 @@ services:
volumes:
- mongo_db:/data/db
nbi:
image: osm/nbi
image: osm/nbi:${TAG:-latest}
networks:
- netOSM
volumes:
......@@ -55,7 +55,7 @@ services:
# - kafka
# - mongo
lcm:
image: osm/lcm
image: osm/lcm:${TAG:-latest}
networks:
- netOSM
volumes:
......@@ -81,7 +81,7 @@ services:
# ports:
# - "3306:3306"
ro:
image: osm/ro
image: osm/ro:${TAG:-latest}
networks:
- netOSM
environment:
......@@ -93,7 +93,7 @@ services:
ports:
- "${OSM_RO_PORTS:-9090:9090}"
mon:
image: osm/mon
image: osm/mon:${TAG:-latest}
networks:
- netOSM
volumes:
......@@ -108,7 +108,7 @@ services:
ports:
- "8662"
pm:
image: osm/pm
image: osm/pm:${TAG:-latest}
networks:
- netOSM
environment:
......@@ -117,7 +117,7 @@ services:
# - kafka
# - mon
light-ui:
image: osm/light-ui
image: osm/light-ui:${TAG:-latest}
networks:
- netOSM
environment:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment