blob: ecb475fbca636337812004c3aea7b067277ed454 [file] [log] [blame]
Mike Marchetti182bd732018-09-05 09:52:42 -04001# Copyright 2018 Whitestack, LLC
2# *************************************************************
3
4# This file is part of OSM Monitoring module
5# All Rights Reserved to Whitestack, LLC
6
7# Licensed under the Apache License, Version 2.0 (the "License"); you may
8# not use this file except in compliance with the License. You may obtain
9# a copy of the License at
10
11# http://www.apache.org/licenses/LICENSE-2.0
12
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16# License for the specific language governing permissions and limitations
17# under the License.
18
19# For those usages not covered by the Apache License, Version 2.0 please
20# contact: bdiaz@whitestack.com or glavado@whitestack.com
21##
22
23FROM ubuntu:16.04
24
25LABEL authors="Guillermo Calvino"
26
Benjamin Diaz9261c662019-02-25 17:18:51 -030027RUN apt-get update \
28 && apt-get -y install curl \
29 software-properties-common \
30 git \
31 python \
32 python-pip \
33 python3 \
34 python3-pip \
35 libmysqlclient-dev \
36 libssl-dev \
37 libffi-dev \
38 mysql-client \
39 && apt-get clean \
40 && rm -rf /var/lib/apt/lists/* \
41 && pip3 install pip==9.0.3
Mike Marchetti13d76c82018-09-19 15:00:36 -040042
Felipe Vicensce8b5a42019-11-30 19:35:52 +010043RUN pip3 install 'macaroonbakery>=1.1,<2.0' 'pyRFC3339>=1.0,<2.0' \
44 'pyyaml>=5.1.2' 'theblues>=0.3.8,<1.0' 'websockets>=4.0,<5.0' \
45 'paramiko' # PyNaCl
Benjamin Diaz14017e52018-11-20 12:35:06 -030046
Mike Marchetti182bd732018-09-05 09:52:42 -040047ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
48ARG RELEASE=ReleaseFOUR-daily
49ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
50ARG REPOSITORY=testing
51
Mike Marchetti13d76c82018-09-19 15:00:36 -040052ARG MON_VERSION
53ARG COMMON_VERSION
Benjamin Diaz6c8cb572018-11-20 09:19:27 -030054ARG N2VC_VERSION
Mike Marchetti182bd732018-09-05 09:52:42 -040055
Benjamin Diaz9261c662019-02-25 17:18:51 -030056RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add - \
57 && add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} MON N2VC common" \
58 && apt update \
59 && apt-get -y install python3-osm-common${COMMON_VERSION} \
60 python3-osm-mon${MON_VERSION} \
61 python3-n2vc${N2VC_VERSION}
Felipe Vicensce8b5a42019-11-30 19:35:52 +010062
63
64RUN python3 -m pip install -U juju
65
Mike Marchetti182bd732018-09-05 09:52:42 -040066COPY scripts/ scripts/
67
Benjamin Diaze6f7b452019-02-07 12:09:57 -030068ENV OSMMON_MESSAGE_DRIVER kafka
69ENV OSMMON_MESSAGE_HOST kafka
70ENV OSMMON_MESSAGE_PORT 9092
71
72ENV OSMMON_DATABASE_DRIVER mongo
73ENV OSMMON_DATABASE_URI mongodb://mongo:27017
74
75ENV OSMMON_SQL_DATABASE_URI sqlite:///mon_sqlite.db
76ENV OSMMON_OPENSTACK_DEFAULT_GRANULARITY 300
77ENV OSMMON_GLOBAL_REQUEST_TIMEOUT 10
78ENV OSMMON_GLOBAL_LOGLEVEL INFO
Benjamin Diaz6a239872018-11-15 10:31:08 -030079ENV OSMMON_VCA_HOST localhost
80ENV OSMMON_VCA_SECRET secret
81ENV OSMMON_VCA_USER admin
Benjamin Diaze6f7b452019-02-07 12:09:57 -030082ENV OSMMON_DATABASE_COMMONKEY changeme
83ENV OSMMON_COLLECTOR_INTERVAL 30
84ENV OSMMON_EVALUATOR_INTERVAL 30
85ENV OSMMON_PROMETHEUS_URL http://prometheus:9090
Mike Marchetti182bd732018-09-05 09:52:42 -040086
Benjamin Diaz03ceed32018-11-21 18:10:05 -030087EXPOSE 8000
88
tierno836e9db2019-07-22 13:23:56 +000089HEALTHCHECK --start-period=120s --interval=10s --timeout=5s --retries=5 \
Benjamin Diaz03ceed32018-11-21 18:10:05 -030090 CMD osm-mon-healthcheck || exit 1
Mike Marchetti182bd732018-09-05 09:52:42 -040091
Benjamin Diaz9261c662019-02-25 17:18:51 -030092CMD /bin/bash scripts/start.sh