| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 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 | |
| Benjamin Diaz | 9261c66 | 2019-02-25 17:18:51 -0300 | [diff] [blame] | 27 | RUN 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 Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 42 | |
| Gianpietro Lavado | c051554 | 2019-11-29 17:54:30 +0000 | [diff] [blame^] | 43 | RUN python3 -m pip install -U juju |
| Benjamin Diaz | 14017e5 | 2018-11-20 12:35:06 -0300 | [diff] [blame] | 44 | |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 45 | ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian |
| 46 | ARG RELEASE=ReleaseFOUR-daily |
| 47 | ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg |
| 48 | ARG REPOSITORY=testing |
| 49 | |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 50 | ARG MON_VERSION |
| 51 | ARG COMMON_VERSION |
| Benjamin Diaz | 6c8cb57 | 2018-11-20 09:19:27 -0300 | [diff] [blame] | 52 | ARG N2VC_VERSION |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 53 | |
| Benjamin Diaz | 9261c66 | 2019-02-25 17:18:51 -0300 | [diff] [blame] | 54 | RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add - \ |
| 55 | && add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} MON N2VC common" \ |
| 56 | && apt update \ |
| 57 | && apt-get -y install python3-osm-common${COMMON_VERSION} \ |
| 58 | python3-osm-mon${MON_VERSION} \ |
| 59 | python3-n2vc${N2VC_VERSION} |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 60 | COPY scripts/ scripts/ |
| 61 | |
| Benjamin Diaz | e6f7b45 | 2019-02-07 12:09:57 -0300 | [diff] [blame] | 62 | ENV OSMMON_MESSAGE_DRIVER kafka |
| 63 | ENV OSMMON_MESSAGE_HOST kafka |
| 64 | ENV OSMMON_MESSAGE_PORT 9092 |
| 65 | |
| 66 | ENV OSMMON_DATABASE_DRIVER mongo |
| 67 | ENV OSMMON_DATABASE_URI mongodb://mongo:27017 |
| 68 | |
| 69 | ENV OSMMON_SQL_DATABASE_URI sqlite:///mon_sqlite.db |
| 70 | ENV OSMMON_OPENSTACK_DEFAULT_GRANULARITY 300 |
| 71 | ENV OSMMON_GLOBAL_REQUEST_TIMEOUT 10 |
| 72 | ENV OSMMON_GLOBAL_LOGLEVEL INFO |
| Benjamin Diaz | 6a23987 | 2018-11-15 10:31:08 -0300 | [diff] [blame] | 73 | ENV OSMMON_VCA_HOST localhost |
| 74 | ENV OSMMON_VCA_SECRET secret |
| 75 | ENV OSMMON_VCA_USER admin |
| Benjamin Diaz | e6f7b45 | 2019-02-07 12:09:57 -0300 | [diff] [blame] | 76 | ENV OSMMON_DATABASE_COMMONKEY changeme |
| 77 | ENV OSMMON_COLLECTOR_INTERVAL 30 |
| 78 | ENV OSMMON_EVALUATOR_INTERVAL 30 |
| 79 | ENV OSMMON_PROMETHEUS_URL http://prometheus:9090 |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 80 | |
| Benjamin Diaz | 03ceed3 | 2018-11-21 18:10:05 -0300 | [diff] [blame] | 81 | EXPOSE 8000 |
| 82 | |
| tierno | 836e9db | 2019-07-22 13:23:56 +0000 | [diff] [blame] | 83 | HEALTHCHECK --start-period=120s --interval=10s --timeout=5s --retries=5 \ |
| Benjamin Diaz | 03ceed3 | 2018-11-21 18:10:05 -0300 | [diff] [blame] | 84 | CMD osm-mon-healthcheck || exit 1 |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 85 | |
| Benjamin Diaz | 9261c66 | 2019-02-25 17:18:51 -0300 | [diff] [blame] | 86 | CMD /bin/bash scripts/start.sh |