FROM ubuntu:16.04
RUN apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get -y install git build-essential apt-utils && \
- DEBIAN_FRONTEND=noninteractive apt-get -y install python python-dev python-all python-stdeb fakeroot pypi2deb && \
- DEBIAN_FRONTEND=noninteractive apt-get -y install python-pip libmysqlclient-dev libssl-dev libffi-dev && \
- DEBIAN_FRONTEND=noninteractive pip install --upgrade pip && \
- DEBIAN_FRONTEND=noninteractive pip install --upgrade setuptools && \
- DEBIAN_FRONTEND=noninteractive apt-get -y install python-argcomplete python-boto python-bottle python-jsonschema python-logutils python-cinderclient python-glanceclient python-keystoneclient python-neutronclient python-novaclient python-openstackclient python-mysqldb
+ DEBIAN_FRONTEND=noninteractive apt-get -y install git make python python-pip debhelper && \
+ DEBIAN_FRONTEND=noninteractive apt-get -y install wget tox && \
+ DEBIAN_FRONTEND=noninteractive pip install -U pip && \
+ DEBIAN_FRONTEND=noninteractive pip install -U setuptools setuptools-version-command stdeb && \
+ DEBIAN_FRONTEND=noninteractive pip install -U pyang pyangbind && \
+ DEBIAN_FRONTEND=noninteractive apt-get -y install python-yaml python-netaddr python-boto && \
+ DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common && \
+ DEBIAN_FRONTEND=noninteractive add-apt-repository -y cloud-archive:ocata && \
+ DEBIAN_FRONTEND=noninteractive apt-get update && \
+ DEBIAN_FRONTEND=noninteractive apt-get -y install python-novaclient python-keystoneclient python-glanceclient python-cinderclient python-neutronclient && \
+ DEBIAN_FRONTEND=noninteractive pip install -U progressbar pyvmomi pyvcloud && \
+ DEBIAN_FRONTEND=noninteractive apt-get -y install python-argcomplete python-bottle python-cffi python-packaging python-paramiko python-pkgconfig libmysqlclient-dev libssl-dev libffi-dev python-mysqldb && \
+ DEBIAN_FRONTEND=noninteractive apt-get -y install python-logutils python-openstackclient python-openstacksdk
#include MANIFEST.in
#include requirements.txt
include README.rst
-include RO_VERSION
include openmano
include openmanod
recursive-include osm_ro *
+.PHONY: all test clean
+
SHELL := /bin/bash
-all: package install
-clean_deb:
- rm -rf .build
+BRANCH ?= master
+
+all: lib-openvim osm-im
+ $(MAKE) clean_build build
+ $(MAKE) clean_build package
+
+clean: clean_build
+ rm -rf .build openvim IM
-clean:
+clean_build:
rm -rf build
find osm_ro -name '*.pyc' -delete
find osm_ro -name '*.pyo' -delete
+
prepare:
- pip install --user --upgrade setuptools
+# ip install --user --upgrade setuptools
mkdir -p build/
- VER1=$(shell git describe | sed -e 's/^v//' |cut -d- -f1); \
- VER2=$(shell git describe | cut -d- -f2); \
- VER3=$(shell git describe | cut -d- -f3); \
- echo "$$VER1.dev$$VER2+$$VER3" > build/RO_VERSION
+# VER1=$(shell git describe | sed -e 's/^v//' |cut -d- -f1); \
+# VER2=$(shell git describe | cut -d- -f2); \
+# VER3=$(shell git describe | cut -d- -f3); \
+# echo "$$VER1.dev$$VER2+$$VER3" > build/RO_VERSION
+ cp tox.ini build/
cp MANIFEST.in build/
cp requirements.txt build/
cp README.rst build/
python build/osm_ro/openmanolinkervimconn.py
rm -f build/osm_ro/openmanolinkervimconn.py
-build: clean connectors prepare
+build: connectors prepare
python -m py_compile build/osm_ro/*.py
+# cd build && tox -e flake8
+
+lib-openvim:
+ $(shell git clone https://osm.etsi.org/gerrit/osm/openvim)
+ LIB_BRANCH=$(shell git -C openvim branch -a|grep -oP 'remotes/origin/\K$(BRANCH)'); \
+ [ -z "$$LIB_BRANCH" ] && LIB_BRANCH='master'; \
+ echo "BRANCH: $(BRANCH)"; \
+ echo "LIB_OPENVIM_BRANCH: $$LIB_BRANCH"; \
+ git -C openvim checkout $$LIB_BRANCH
+ make -C openvim clean lite
-pip: prepare
- cd build && ./setup.py sdist
+osm-im:
+ $(shell git clone https://osm.etsi.org/gerrit/osm/IM)
+ make -C IM clean all
-package: clean clean_deb prepare
- #apt-get install -y python-stdeb
+package: prepare
+# apt-get install -y python-stdeb
cd build && python setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True
cd build && cp osm_ro/scripts/python-osm-ro.postinst deb_dist/osm-ro*/debian/
cd build/deb_dist/osm-ro* && dpkg-buildpackage -rfakeroot -uc -us
echo "Nothing to be done yet"
install:
- DEBIAN_FRONTEND=noninteractive apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip && \
- pip install --upgrade pip && \
- dpkg -i .build/*.deb
+ dpkg -i IM/deb_dist/python-osm-im*.deb
+ dpkg -i openvim/.build/python-lib-osm-openvim*.deb
+ dpkg -i .build/python-osm-ro*.deb
+ cd .. && \
+ OSMLIBOVIM_PATH=`python -c 'import lib_osm_openvim; print lib_osm_openvim.__path__[0]'` || FATAL "lib-osm-openvim was not properly installed" && \
+ OSMRO_PATH=`python -c 'import osm_ro; print osm_ro.__path__[0]'` || FATAL "osm-ro was not properly installed" && \
+ USER=root DEBIAN_FRONTEND=noninteractive $$OSMRO_PATH/database_utils/install-db-server.sh --updatedb || FATAL "osm-ro db installation failed" && \
+ USER=root DEBIAN_FRONTEND=noninteractive $$OSMLIBOVIM_PATH/database_utils/install-db-server.sh -u mano -p manopw -d mano_vim_db --updatedb || FATAL "lib-osm-openvim db installation failed"
+ service osm-ro restart
develop: prepare
- #pip install -r requirements.txt
+# pip install -r requirements.txt
cd build && ./setup.py develop
test:
- ./test/basictest.sh --force --insert-bashrc --install-openvim --init-openvim
+ . ./test/basictest.sh -f --insert-bashrc --install-openvim --init-openvim
+ . ./test/basictest.sh -f reset add-openvim
+ ./test/test_RO.py deploy -n mgmt -t osm -i cirros034 -d local-openvim --timeout=30 --failfast
+ ./test/test_RO.py vim -t osm -d local-openvim --timeout=30 --failfast
build-docker-from-source:
docker build -t osm/openmano -f docker/Dockerfile-local .
#!/bin/sh
-make package
+make clean all BRANCH=v2.0
+#make install && \
+#make test
#import glob
_name = 'osm_ro'
-_version = open('RO_VERSION').read().strip()
_description = 'OSM Resource Orchestrator'
_author = 'ETSI OSM'
_author_email = 'alfonso.tiernosepulveda@telefonica.com'
_requirements = [
"PyYAML",
"bottle",
- "MySQL-python",
+ #"mysqlclient",
+ #"MySQLdb",
"jsonschema",
"paramiko",
"argcomplete",
"python-glanceclient",
"python-neutronclient",
"python-cinderclient",
- "pyvcloud",
- "progressbar",
+ #"pyvcloud",
+ #"progressbar",
"prettytable",
- "pyvmomi",
+ #"pyvmomi",
"boto",
+ #"lib_osm_openvim",
+ #"osm_im",
]
setup(name=_name,
- version = _version,
+ version_command=('git describe', 'pep440-git'),
description = _description,
long_description = open('README.rst').read(),
author = _author,
scripts=['openmanod', 'openmano', 'osm_ro/scripts/service-openmano', 'osm_ro/scripts/openmano-report',],
install_requires=_requirements,
include_package_data=True,
+ setup_requires=['setuptools-version-command'],
+ #test_suite='nose.collector',
)
Suite: xenial
XS-Python-Version: >= 2.7
Maintainer: Gerardo Garcia <gerardo.garciadeblas@telefonica.com>
-Depends: python-pip, libmysqlclient-dev, libssl-dev, libffi-dev, python-argcomplete, python-boto, python-bottle, python-jsonschema, python-logutils, python-cinderclient, python-glanceclient, python-keystoneclient, python-neutronclient, python-novaclient, python-openstackclient, python-mysqldb
+Depends: python-pip, libmysqlclient-dev, libssl-dev, libffi-dev, python-argcomplete, python-boto, python-bottle, python-jsonschema, python-logutils, python-cinderclient, python-glanceclient, python-keystoneclient, python-neutronclient, python-novaclient, python-openstackclient, python-mysqldb, python-lib-osm-openvim
--- /dev/null
+[tox]
+#envlist = py27,py3
+envlist = py27
+toxworkdir={homedir}/.tox
+
+[testenv]
+deps=nose
+ mock
+commands=nosetests
+
+[testenv:flake8]
+basepython = python
+deps = flake8
+commands =
+ flake8 setup.py
+
+[testenv:build]
+basepython = python
+deps = stdeb
+ setuptools-version-command
+commands = python setup.py --command-packages=stdeb.command bdist_deb
+