| 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 | |
| palsus | e3cecd9 | 2021-01-18 08:36:26 +0000 | [diff] [blame^] | 23 | FROM ubuntu:20.04 |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 24 | |
| 25 | LABEL authors="Guillermo Calvino" |
| 26 | |
| Benjamin Diaz | 9261c66 | 2019-02-25 17:18:51 -0300 | [diff] [blame] | 27 | RUN apt-get update \ |
| lavado | 6e80483 | 2020-02-05 12:14:39 -0800 | [diff] [blame] | 28 | && DEBIAN_FRONTEND=noninteractive apt-get install -y curl \ |
| Benjamin Diaz | 9261c66 | 2019-02-25 17:18:51 -0300 | [diff] [blame] | 29 | software-properties-common \ |
| 30 | git \ |
| Benjamin Diaz | 9261c66 | 2019-02-25 17:18:51 -0300 | [diff] [blame] | 31 | python3 \ |
| 32 | python3-pip \ |
| Benjamin Diaz | 9261c66 | 2019-02-25 17:18:51 -0300 | [diff] [blame] | 33 | libssl-dev \ |
| 34 | libffi-dev \ |
| Benjamin Diaz | 9261c66 | 2019-02-25 17:18:51 -0300 | [diff] [blame] | 35 | && apt-get clean \ |
| 36 | && rm -rf /var/lib/apt/lists/* \ |
| lavado | 6e80483 | 2020-02-05 12:14:39 -0800 | [diff] [blame] | 37 | && python3 -m pip install -U pip |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 38 | |
| palsus | e3cecd9 | 2021-01-18 08:36:26 +0000 | [diff] [blame^] | 39 | RUN pip3 install 'pyyaml>=5.1.2' 'paramiko' 'chardet==3.0.4' \ |
| 40 | 'lxml==4.6.2' 'humanfriendly==9.0.*' 'aiokafka==0.6.0' \ |
| 41 | 'prometheus_client==0.4.*' 'python-keystoneclient==3.15.*' \ |
| 42 | 'six==1.15.0' 'requests==2.25.*' 'gnocchiclient==7.0.*' \ |
| 43 | 'pyvcloud==23.0.*' 'python-novaclient==12.0.*' \ |
| 44 | 'python-ceilometerclient==2.9.*' 'python-neutronclient==5.1.*' |
| Benjamin Diaz | 14017e5 | 2018-11-20 12:35:06 -0300 | [diff] [blame] | 45 | |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 46 | ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian |
| garciadeblas | fa81f28 | 2020-12-15 00:32:13 +0000 | [diff] [blame] | 47 | ARG RELEASE=ReleaseNINE-daily |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 48 | ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg |
| 49 | ARG REPOSITORY=testing |
| 50 | |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 51 | ARG MON_VERSION |
| 52 | ARG COMMON_VERSION |
| Benjamin Diaz | 6c8cb57 | 2018-11-20 09:19:27 -0300 | [diff] [blame] | 53 | ARG N2VC_VERSION |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 54 | |
| Benjamin Diaz | 9261c66 | 2019-02-25 17:18:51 -0300 | [diff] [blame] | 55 | RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add - \ |
| 56 | && add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} MON N2VC common" \ |
| 57 | && apt update \ |
| lavado | 6e80483 | 2020-02-05 12:14:39 -0800 | [diff] [blame] | 58 | && DEBIAN_FRONTEND=noninteractive apt-get -y install python3-osm-common${COMMON_VERSION} \ |
| Benjamin Diaz | 9261c66 | 2019-02-25 17:18:51 -0300 | [diff] [blame] | 59 | python3-osm-mon${MON_VERSION} \ |
| 60 | python3-n2vc${N2VC_VERSION} |
| Felipe Vicens | ce8b5a4 | 2019-11-30 19:35:52 +0100 | [diff] [blame] | 61 | |
| 62 | |
| David Garcia | 358a7c3 | 2020-10-21 16:12:04 +0200 | [diff] [blame] | 63 | RUN python3 -m pip install -U "juju==2.8.4" |
| Felipe Vicens | ce8b5a4 | 2019-11-30 19:35:52 +0100 | [diff] [blame] | 64 | |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 65 | COPY scripts/ scripts/ |
| 66 | |
| Benjamin Diaz | e6f7b45 | 2019-02-07 12:09:57 -0300 | [diff] [blame] | 67 | ENV OSMMON_MESSAGE_DRIVER kafka |
| 68 | ENV OSMMON_MESSAGE_HOST kafka |
| 69 | ENV OSMMON_MESSAGE_PORT 9092 |
| 70 | |
| 71 | ENV OSMMON_DATABASE_DRIVER mongo |
| 72 | ENV OSMMON_DATABASE_URI mongodb://mongo:27017 |
| 73 | |
| 74 | ENV OSMMON_SQL_DATABASE_URI sqlite:///mon_sqlite.db |
| 75 | ENV OSMMON_OPENSTACK_DEFAULT_GRANULARITY 300 |
| 76 | ENV OSMMON_GLOBAL_REQUEST_TIMEOUT 10 |
| 77 | ENV OSMMON_GLOBAL_LOGLEVEL INFO |
| Benjamin Diaz | 6a23987 | 2018-11-15 10:31:08 -0300 | [diff] [blame] | 78 | ENV OSMMON_VCA_HOST localhost |
| 79 | ENV OSMMON_VCA_SECRET secret |
| 80 | ENV OSMMON_VCA_USER admin |
| lavado | d468d6c | 2019-12-06 06:54:18 -0500 | [diff] [blame] | 81 | ENV OSMMON_VCA_CACERT cacert |
| Benjamin Diaz | e6f7b45 | 2019-02-07 12:09:57 -0300 | [diff] [blame] | 82 | ENV OSMMON_DATABASE_COMMONKEY changeme |
| 83 | ENV OSMMON_COLLECTOR_INTERVAL 30 |
| 84 | ENV OSMMON_EVALUATOR_INTERVAL 30 |
| 85 | ENV OSMMON_PROMETHEUS_URL http://prometheus:9090 |
| bravof | cfbccb5 | 2020-04-01 11:01:11 -0300 | [diff] [blame] | 86 | ENV OSMMON_GRAFANA_URL http://grafana:3000 |
| 87 | ENV OSMMON_GRAFANA_USER admin |
| 88 | ENV OSMMON_GRAFANA_PASSWORD admin |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 89 | |
| Benjamin Diaz | 03ceed3 | 2018-11-21 18:10:05 -0300 | [diff] [blame] | 90 | EXPOSE 8000 |
| 91 | |
| palsus | e3cecd9 | 2021-01-18 08:36:26 +0000 | [diff] [blame^] | 92 | HEALTHCHECK --start-period=120s --interval=5s --timeout=2s --retries=12\ |
| Benjamin Diaz | 03ceed3 | 2018-11-21 18:10:05 -0300 | [diff] [blame] | 93 | CMD osm-mon-healthcheck || exit 1 |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 94 | |
| Benjamin Diaz | 9261c66 | 2019-02-25 17:18:51 -0300 | [diff] [blame] | 95 | CMD /bin/bash scripts/start.sh |