Merge "Adding an charm generator"
[osm/devops.git] / docker / MON / Dockerfile
1 # 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
23 FROM ubuntu:16.04
24
25 LABEL authors="Guillermo Calvino"
26
27 RUN apt-get update && apt-get -y install curl software-properties-common
28
29 RUN apt-get --yes update \
30  && apt-get --yes install git python python-pip python3 python3-pip libmysqlclient-dev libssl-dev libffi-dev \
31  && pip3 install pip==9.0.3
32
33 RUN pip3 install  'macaroonbakery>=1.1,<2.0' 'pyRFC3339>=1.0,<2.0' \
34       'pyyaml>=3.0,<4.0' 'theblues>=0.3.8,<1.0' 'websockets>=4.0,<5.0' \
35       'paramiko'   # PyNaCl
36
37 ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
38 ARG RELEASE=ReleaseFOUR-daily
39 ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
40 ARG REPOSITORY=testing
41
42 RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
43 RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} MON N2VC common" && apt update
44
45 ARG MON_VERSION
46 ARG COMMON_VERSION
47 ARG N2VC_VERSION
48
49 RUN apt-get --yes update  && apt-get -y install python3-osm-common${COMMON_VERSION} python3-osm-mon${MON_VERSION} python3-n2vc${N2VC_VERSION}
50
51 COPY scripts/ scripts/
52
53 ENV OSMMON_MESSAGE_DRIVER kafka
54 ENV OSMMON_MESSAGE_HOST kafka
55 ENV OSMMON_MESSAGE_PORT 9092
56
57 ENV OSMMON_DATABASE_DRIVER mongo
58 ENV OSMMON_DATABASE_URI mongodb://mongo:27017
59
60 ENV OSMMON_SQL_DATABASE_URI sqlite:///mon_sqlite.db
61 ENV OSMMON_OPENSTACK_DEFAULT_GRANULARITY 300
62 ENV OSMMON_GLOBAL_REQUEST_TIMEOUT 10
63 ENV OSMMON_GLOBAL_LOGLEVEL INFO
64 ENV OSMMON_VCA_HOST localhost
65 ENV OSMMON_VCA_SECRET secret
66 ENV OSMMON_VCA_USER admin
67 ENV OSMMON_DATABASE_COMMONKEY changeme
68 ENV OSMMON_COLLECTOR_INTERVAL 30
69 ENV OSMMON_EVALUATOR_INTERVAL 30
70 ENV OSMMON_PROMETHEUS_URL http://prometheus:9090
71
72 EXPOSE 8000
73
74 HEALTHCHECK --interval=5s --timeout=2s --retries=12 \
75   CMD osm-mon-healthcheck || exit 1
76
77 CMD /bin/bash scripts/runInstall.sh