RUN apt-get update && apt-get install -y git python3 python3-pip \
&& python3 -m pip install --upgrade pip \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install libssl-dev libmysqlclient-dev mysql-client \
+ build-essential libffi-dev cargo \
&& DEBIAN_FRONTEND=noninteractive python3 -m pip install -U networking-l2gw \
&& DEBIAN_FRONTEND=noninteractive python3 -m pip install -U progressbar pyvmomi pyvcloud==19.1.1 \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install genisoimage
&& mv /tmp/libzenohc.so /usr/local/lib/libzenohc.so \
&& DEBIAN_FRONTEND=noninteractive python3 -m pip install -U jsonrpclib-pelix cvprac "azure==4.0.0" boto \
pyone "oca @ git+https://github.com/python-oca/python-oca#egg=oca" \
- pyangbind sphinx zenoh==0.3.0 yaks==0.3.0.post1 fog05-sdk==0.2.0 fog05==0.2.0
+ pyangbind sphinx zenoh==0.3.0 yaks==0.3.0.post1 fog05-sdk==0.2.0 fog05==0.2.0 "cryptography>=2.5"
# DEBIAN_FRONTEND=noninteractive apt-get -y install python-openstacksdk python-openstackclient && \
# logs
ENV OSMRO_LOG_LEVEL DEBUG
-CMD python3 -m osm_ng_ro.ro_main
+CMD ["python3", "-u", "-m", "osm_ng_ro.ro_main"]
# HEALTHCHECK --start-period=30s --interval=10s --timeout=5s --retries=12 \
# CMD curl --silent --fail http://localhost:9090/ro || exit 1
logger_server = logging.getLogger("cherrypy.error")
logger_access = logging.getLogger("cherrypy.access")
logger_cherry = logging.getLogger("cherrypy")
- logger_nbi = logging.getLogger("ro")
+ logger = logging.getLogger("ro")
if "log.file" in engine_config["global"]:
file_handler = logging.handlers.RotatingFileHandler(engine_config["global"]["log.file"],
maxBytes=100e6, backupCount=9, delay=0)
file_handler.setFormatter(log_formatter_simple)
logger_cherry.addHandler(file_handler)
- logger_nbi.addHandler(file_handler)
+ logger.addHandler(file_handler)
# log always to standard output
for format_, logger in {"ro.server %(filename)s:%(lineno)s": logger_server,
"ro.access %(filename)s:%(lineno)s": logger_access,
- "%(name)s %(filename)s:%(lineno)s": logger_nbi
+ "%(name)s %(filename)s:%(lineno)s": logger
}.items():
log_format_cherry = "%(asctime)s %(levelname)s {} %(message)s".format(format_)
log_formatter_cherry = logging.Formatter(log_format_cherry, datefmt='%Y-%m-%dT%H:%M:%S')
if engine_config["global"].get("log.level"):
logger_cherry.setLevel(engine_config["global"]["log.level"])
- logger_nbi.setLevel(engine_config["global"]["log.level"])
+ logger.setLevel(engine_config["global"]["log.level"])
# logging other modules
for k1, logname in {"message": "ro.msg", "database": "ro.db", "storage": "ro.fs"}.items():
engine_config[k1]["logger_name"] = logname
__ELINE_num_connection_points = 2
__supported_service_types = ["ELINE", "ELAN"]
__supported_encapsulation_types = ["dot1q"]
- __WIM_LOGGER = 'openmano.sdnconn.arista'
+ __WIM_LOGGER = 'ro.sdn.arista'
__SERVICE_ENDPOINT_MAPPING = 'service_endpoint_mapping'
__ENCAPSULATION_TYPE_PARAM = "service_endpoint_encapsulation_type"
__ENCAPSULATION_INFO_PARAM = "service_endpoint_encapsulation_info"
datacenter_id vim_account vim_account
id: (internal, do not use)
wim_id: (internal, do not use)
- :param logger (logging.Logger): optional logger object. If none is passed 'openmano.sdn.sdnconn' is used.
+ :param logger (logging.Logger): optional logger object. If none is passed 'ro.sdn.sdnconn' is used.
"""
self.__regex = re.compile(
r'^(?:http|ftp)s?://' # http:// or https://
class DpbConnector(SdnConnectorBase):
""" Use the DPB to establish multipoint connections """
- __LOGGER_NAME = "openmano.rosdnconn.dpb"
+ __LOGGER_NAME = "ro.sdn.dpb"
__SUPPORTED_SERV_TYPES = ["ELAN (L2)", "ELINE (L2)"]
__SUPPORTED_CONNECTION_TYPES = ["REST", "SSH"]
__SUPPORTED_SSH_AUTH_TYPES = ["KEY", "PASS"]
class DynpacConnector(SdnConnectorBase):
__supported_service_types = ["ELINE (L2)", "ELINE"]
__supported_encapsulation_types = ["dot1q"]
- __WIM_LOGGER = 'openmano.sdnconn.dynpac'
+ __WIM_LOGGER = 'ro.sdn.dynpac'
__ENCAPSULATION_TYPE_PARAM = "service_endpoint_encapsulation_type"
__ENCAPSULATION_INFO_PARAM = "service_endpoint_encapsulation_info"
__BACKUP_PARAM = "backup"
self.ofi2pp = {} # From OpenFlow Index to Physical Port
self.headers = {'content-type': 'application/json', 'Accept': 'application/json'}
self.version = None
- self.logger = logging.getLogger('SDN.floodlightOF')
+ self.logger = logging.getLogger('ro.sdn.floodlightof')
self.logger.setLevel(params.get("of_debug", "ERROR"))
self._set_version(params.get("of_version"))
def __init__(self, wim, wim_account, config=None, logger=None):
"""Creates a connectivity based on pro-active openflow rules
"""
- self.logger = logging.getLogger('openmano.sdnconn.floodlightof')
+ self.logger = logging.getLogger('ro.sdn.floodlightof')
super().__init__(wim, wim_account, config, logger)
of_params = {
"of_url": wim["wim_url"],
wim (dict): WIM record, as stored in the database
wim_account (dict): WIM account record, as stored in the database
"""
- self.logger = logging.getLogger('openmano.sdnconn.ietfl2vpn')
+ self.logger = logging.getLogger('ro.sdn.ietfl2vpn')
super().__init__(wim, wim_account, config, logger)
self.headers = {'Content-Type': 'application/json'}
self.mappings = {m['service_endpoint_id']: m
def __init__(self, url, config=None, user=None, password=None, logger=None):
- self.logger = logger or logging.getLogger("openmano.sdnconn.junipercontrail.sdnapi")
+ self.logger = logger or logging.getLogger("ro.sdn.junipercontrail.sdnapi")
self.controller_url = url
if not url:
tutorial_with_rest.html
- https://github.com/tonyliu0592/contrail-toolbox/blob/master/sriov/sriov
"""
- _WIM_LOGGER = "openmano.sdnconn.junipercontrail"
+ _WIM_LOGGER = "ro.sdn.junipercontrail"
def __init__(self, wim, wim_account, config=None, logger=None):
"""
datacenter_id vim_account vim_account
id: (internal, do not use)
wim_id: (internal, do not use)
- :param logger (logging.Logger): optional logger object. If none is passed 'openmano.sdn.sdnconn' is used.
+ :param logger (logging.Logger): optional logger object. If none is passed 'ro.sdn.sdnconn' is used.
"""
self.logger = logger or logging.getLogger(self._WIM_LOGGER)
self.logger.debug('wim: {}, wim_account: {}, config: {}'.format(wim, wim_account, config))
log_formatter = logging.Formatter(log_format, datefmt='%Y-%m-%dT%H:%M:%S')
handler = logging.StreamHandler()
handler.setFormatter(log_formatter)
- logger = logging.getLogger('openmano.sdnconn.junipercontrail')
+ logger = logging.getLogger('ro.sdn.junipercontrail')
# logger.setLevel(level=logging.ERROR)
# logger.setLevel(level=logging.INFO)
logger.setLevel(level=logging.DEBUG)
self.auth = self.auth.decode()
self.headers['authorization'] = 'Basic ' + self.auth
- self.logger = logging.getLogger('openmano.sdnconn.onosof')
+ self.logger = logging.getLogger('ro.sdn.onosof')
# self.logger.setLevel(getattr(logging, params.get("of_debug", "ERROR")))
self.logger.debug("odlof plugin initialized")
def __init__(self, wim, wim_account, config=None, logger=None):
"""Creates a connectivity based on pro-active openflow rules
"""
- self.logger = logging.getLogger('openmano.sdnconn.odlof')
+ self.logger = logging.getLogger('ro.sdn.odlof')
super().__init__(wim, wim_account, config, logger)
of_params = {
"of_url": wim["wim_url"],
self.auth = self.auth.decode()
self.headers['authorization'] = 'Basic ' + self.auth
- self.logger = logging.getLogger('openmano.sdnconn.onosof')
+ self.logger = logging.getLogger('ro.sdn.onosof')
# self.logger.setLevel( getattr(logging, params.get("of_debug", "ERROR")) )
self.logger.debug("onosof plugin initialized")
self.ip_address = None
def __init__(self, wim, wim_account, config=None, logger=None):
"""Creates a connectivity based on pro-active openflow rules
"""
- self.logger = logging.getLogger('openmano.sdnconn.onosof')
+ self.logger = logging.getLogger('ro.sdn.onosof')
super().__init__(wim, wim_account, config, logger)
of_params = {
"of_url": wim["wim_url"],
"""
https://wiki.onosproject.org/display/ONOS/VPLS+User+Guide
"""
- _WIM_LOGGER = "openmano.sdnconn.onosvpls"
+ _WIM_LOGGER = "ro.sdn.onosvpls"
def __init__(self, wim, wim_account, config=None, logger=None):
self.logger = logger or logging.getLogger(self._WIM_LOGGER)
if __name__ == '__main__':
- logger = logging.getLogger('openmano.sdn.onos_vpls')
+ logger = logging.getLogger('ro.sdn.onos_vpls')
logging.basicConfig()
logger.setLevel(getattr(logging, "DEBUG"))
# wim_url = "http://10.95.172.251:8181"
elif isinstance(flavor_data, dict):
self.flavor_info = flavor_data
- self.logger = logging.getLogger('openmano.vim.aws')
+ self.logger = logging.getLogger('ro.vim.aws')
if log_level:
self.logger.setLevel(getattr(logging, log_level))
self.vnet_address_space = None
# LOGGER
- self.logger = logging.getLogger('openmano.vim.azure')
+ self.logger = logging.getLogger('ro.vim.azure')
if log_level:
logging.basicConfig()
self.logger.setLevel(getattr(logging, log_level))
"""
+import logging
import uuid
import socket
import struct
vimconn.VimConnector.__init__(self, uuid, name, tenant_id, tenant_name, url, url_admin, user, passwd, log_level,
config, persistent_info)
+ self.logger = logging.getLogger('ro.vim.fos')
self.logger.debug('vimconn_fos init with config: {}'.format(config))
self.arch = config.get('arch', 'x86_64')
self.hv = config.get('hypervisor', 'LXD')
__author__ = "Jose Maria Carmona Perez,Juan Antonio Hernando Labajo, Emilio Abraham Garrido Garcia,Alberto Florez " \
"Pages, Andres Pozo Munoz, Santiago Perez Marin, Onlife Networks Telefonica I+D Product Innovation "
__date__ = "$13-dec-2017 11:09:29$"
+
from osm_ro_plugin import vimconn
+import logging
import requests
# import logging
import oca
vimconn.VimConnector.__init__(self, uuid, name, tenant_id, tenant_name, url, url_admin, user, passwd, log_level,
config)
+ self.logger = logging.getLogger('ro.vim.openstack')
+
def _new_one_connection(self):
return pyone.OneServer(self.url, session=self.user + ':' + self.passwd)
logging.getLogger('urllib3').setLevel(logging.WARNING)
logging.getLogger('keystoneauth').setLevel(logging.WARNING)
logging.getLogger('novaclient').setLevel(logging.WARNING)
- self.logger = logging.getLogger('openmano.vim.openstack')
+ self.logger = logging.getLogger('ro.vim.openstack')
# allow security_groups to be a list or a single string
if isinstance(self.config.get('security_groups'), str):
# ###### VIO Specific Changes #########
if self.vim_type == "VIO":
- self.logger = logging.getLogger('openmano.vim.vio')
+ self.logger = logging.getLogger('ro.vim.vio')
if log_level:
self.logger.setLevel(getattr(logging, log_level))
vimconn.VimConnector.__init__(self, uuid, name, tenant_id, tenant_name, url, url_admin, user, passwd, log_level, config)
self.tenant = None
self.headers_req = {'content-type': 'application/json'}
- self.logger = logging.getLogger('openmano.vim.openvim')
+ self.logger = logging.getLogger('ro.vim.openvim')
self.persistent_info = persistent_info
if tenant_id:
self.tenant = tenant_id
vimconn.VimConnector.__init__(self, uuid, name, tenant_id, tenant_name, url,
url_admin, user, passwd, log_level, config)
- self.logger = logging.getLogger('openmano.vim.vmware')
+ self.logger = logging.getLogger('ro.vim.vmware')
self.logger.setLevel(10)
self.persistent_info = persistent_info
self.name = "openflow_conector"
self.pp2ofi = {} # From Physical Port to OpenFlow Index
self.ofi2pp = {} # From OpenFlow Index to Physical Port
- self.logger = logging.getLogger('openmano.sdn.openflow_conn')
+ self.logger = logging.getLogger('ro.sdn.openflow_conn')
def get_of_switches(self):
""""
flow_fields = ('priority', 'vlan', 'ingress_port', 'actions', 'dst_mac', 'src_mac', 'net_id')
def __init__(self, wim, wim_account, config=None, logger=None, of_connector=None):
- self.logger = logger or logging.getLogger('openmano.sdn.openflow_conn')
+ self.logger = logger or logging.getLogger('ro.sdn.openflow_conn')
self.of_connector = of_connector
config = config or {}
self.of_controller_nets_with_same_vlan = config.get("of_controller_nets_with_same_vlan", False)
An extra property, ``service_endpoint_mapping`` is created from ``config``.
"""
def __init__(self, wim, wim_account, config=None, logger=None):
- self.logger = logger or logging.getLogger('openmano.sdnconn.dummy')
+ self.logger = logger or logging.getLogger('ro.sdn.dummy')
super(SdnDummyConnector, self).__init__(wim, wim_account, config, self.logger)
self.logger.debug("__init: wim='{}' wim_account='{}'".format(wim, wim_account))
self.connections = {}
wim_id: (internal, do not use)
:param logger (logging.Logger): optional logger object. If none is passed 'openmano.sdn.sdnconn' is used.
"""
- self.logger = logger or logging.getLogger('openmano.sdnconn')
+ self.logger = logger or logging.getLogger('ro.sdn')
self.wim = wim
self.wim_account = wim_account
config={}, persistent_info={}):
super().__init__(uuid, name, tenant_id, tenant_name, url, url_admin, user, passwd, log_level,
config, persistent_info)
- self.logger = logging.getLogger('openmano.vim.dummy')
+ self.logger = logging.getLogger('ro.vim.dummy')
if log_level:
self.logger.setLevel(getattr(logging, log_level))
self.nets = {
self.passwd = passwd
self.config = config or {}
self.availability_zone = None
- self.logger = logging.getLogger('openmano.vim')
+ self.logger = logging.getLogger('ro.vim')
if log_level:
self.logger.setLevel(getattr(logging, log_level))
if not self.url_admin: # try to use normal url