From 8ddd3b9ad9b588a712b040a0ebc6dfd4e019b7c3 Mon Sep 17 00:00:00 2001 From: Benjamin Diaz Date: Tue, 18 Sep 2018 12:43:18 -0300 Subject: [PATCH] Small fixes in Dockerfile, requirements and setup.py Adds envs in Dockerfile Adds version_command in setup.py Cleans unused deps in requirements.txt Signed-off-by: Benjamin Diaz --- .gitignore | 5 ++++- docker/Dockerfile | 13 ++++++----- requirements.txt | 6 +---- setup.cfg | 2 -- setup.py | 57 ++++++++++++++++++++++++----------------------- 5 files changed, 42 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index d994eb7..d12e438 100644 --- a/.gitignore +++ b/.gitignore @@ -76,4 +76,7 @@ ChangeLog .settings/ __pycache__/ .idea -*.db \ No newline at end of file +*.db + +deb_dist +*.tar.gz \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index 4b77102..26845d8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -22,10 +22,10 @@ FROM ubuntu:16.04 -LABEL authors="Guillermo Calvino" +LABEL authors="Benjamín Díaz" RUN apt-get --yes update \ - && apt-get --yes install git python python-pip python3 python3-pip libmysqlclient-dev libssl-dev libffi-dev \ + && apt-get --yes install git python3 python3-pip libmysqlclient-dev libssl-dev libffi-dev \ && pip3 install pip==9.0.3 COPY requirements.txt /mon/requirements.txt @@ -36,9 +36,12 @@ COPY . /mon RUN pip3 install /mon -# These ENV must be provided -# ENV BROKER_URI=kafka:9092 -# ENV OS_NOTIFIER_URI=:8662 +ENV BROKER_URI kafka:9092 +ENV MONGO_URI mongo:27017 +ENV DATABASE sqlite:///mon_sqlite.db +ENV OS_NOTIFIER_URI localhost:8662 +ENV OS_DEFAULT_GRANULARITY 300 +ENV REQUEST_TIMEOUT 10 EXPOSE 8662 diff --git a/requirements.txt b/requirements.txt index 071104c..fd9c838 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,14 +19,10 @@ # For those usages not covered by the Apache License, Version 2.0 please # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com kafka==1.3.* -lxml==4.2.* requests==2.18.* -logutils==0.3.* cherrypy==14.0.* jsmin==2.2.* jsonschema==2.6.* -python-openstackclient==3.15.* -python-novaclient==10.1.* python-keystoneclient==3.15.* boto==2.48 python-cloudwatchlogs-logging==0.0.3 @@ -37,4 +33,4 @@ six==1.11.* bottle==0.12.* peewee==3.1.* pyyaml==3.* -git+https://osm.etsi.org/gerrit/osm/common.git@857731b#egg=osm-common \ No newline at end of file +git+https://osm.etsi.org/gerrit/osm/common.git#egg=osm-common \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 5e76eca..df6b252 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,8 +34,6 @@ classifier = License :: ETSI Approved :: Apache Software License Operating System :: POSIX :: Linux Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.5 diff --git a/setup.py b/setup.py index 648d9e9..4f2250b 100644 --- a/setup.py +++ b/setup.py @@ -19,8 +19,6 @@ # For those usages not covered by the Apache License, Version 2.0 please # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com -__author__ = "Prithiv Mohan" -__date__ = "14/Sep/2017" from setuptools import setup @@ -30,31 +28,34 @@ def parse_requirements(requirements): _name = 'osm_mon' -_version = '1.0' -_description = 'OSM Monitoring Module' -_author = 'Prithiv Mohan' -_author_email = 'prithiv.mohan@intel.com' -_maintainer = 'Adrian Hoban' -_maintainer_email = 'adrian.hoban@intel.com' +_version_command = ('git describe --match v* --tags --long --dirty', 'pep440-git') +_description = 'OSM Policy Module' +_author = "Benjamín Díaz" +_author_email = 'bdiaz@whitestack.com' +_maintainer = 'Gianpietro Lavado' +_maintainer_email = 'glavado@whitestack.com' _license = 'Apache 2.0' _url = 'https://osm.etsi.org/gitweb/?p=osm/MON.git;a=tree' -setup(name="osm_mon", - version=_version, - description=_description, - long_description=open('README.rst').read(), - author=_author, - author_email=_author_email, - maintainer=_maintainer, - maintainer_email=_maintainer_email, - url=_url, - license=_license, - packages=[_name], - package_dir={_name: _name}, - scripts=['osm_mon/plugins/vRealiseOps/vROPs_Webservice/vrops_webservice', - 'osm_mon/core/message_bus/common_consumer.py'], - install_requires=parse_requirements('requirements.txt'), - include_package_data=True, - dependency_links=[ - 'git+https://osm.etsi.org/gerrit/osm/common.git@857731b#egg=osm-common' - ] - ) + +setup( + name=_name, + version_command=_version_command, + description=_description, + long_description=open('README.rst').read(), + author=_author, + author_email=_author_email, + maintainer=_maintainer, + maintainer_email=_maintainer_email, + url=_url, + license=_license, + packages=[_name], + package_dir={_name: _name}, + scripts=['osm_mon/plugins/vRealiseOps/vROPs_Webservice/vrops_webservice', + 'osm_mon/core/message_bus/common_consumer.py'], + install_requires=parse_requirements('requirements.txt'), + include_package_data=True, + dependency_links=[ + 'git+https://osm.etsi.org/gerrit/osm/common.git#egg=osm-common' + ], + setup_requires=['setuptools-version-command'] +) -- 2.25.1