Commit 67789ca3 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Multiple improvements:

ECOC'22 test:
- added CTTC OLS and Automation component deployment to script

Common:
- corrected DeviceType name for transponder

Compute:
- added bearer definitions for ECOC'22 demo
- removed hard errors and replaced by warning log messages
- forced to use VPLS, i.e., always slices
- added definition of L2-VPN service settings

Device component:
- forced to use emulated devices for openconfig devices (just for demo purposes, for the sake of reducing demo time)
- added commit_per_delete setting in OpenConfigDriver
- improved detection of PORT components for ADVA devices

PathComp-Frontend component:
- added default settings for TAPI connections
- corrected reply composition; subservices were added wrongly
- added log lines for debug purposes

Service component:
- corrected ConfigRules for L2NM Emulated Service Handler
- adapted TAPI Service Handler to new framework
- added log lines in TaskScheduler compose_from_service (debugging)
- TaskScheduler compose_from_service does not retrieve all resources (debugging)
- removed ConnectionExpander from Tasks ConfigureConnection and DeconfigureConnection

WebUI component:
- minor improvements
parent 538ab09f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ class DeviceTypeEnum(Enum):
    DATACENTER                = 'datacenter'
    MICROVAWE_RADIO_SYSTEM    = 'microwave-radio-system'
    OPTICAL_ROADM             = 'optical-roadm'
    OPTICAL_TRANDPONDER       = 'optical-trandponder'
    OPTICAL_TRANSPONDER       = 'optical-transponder'
    OPEN_LINE_SYSTEM          = 'open-line-system'
    PACKET_ROUTER             = 'packet-router'
    PACKET_SWITCH             = 'packet-switch'
+7 −4
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ DEFAULT_ADDRESS_FAMILIES = ['IPV4']
DEFAULT_BGP_AS           = 65000
DEFAULT_BGP_ROUTE_TARGET = '{:d}:{:d}'.format(DEFAULT_BGP_AS, 333)

# TODO: improve definition of bearer mappings

# Bearer mappings:
# device_uuid:endpoint_uuid => (
#       device_uuid, endpoint_uuid, router_id, route_distinguisher, sub_if_index, address_ip, address_prefix)
@@ -56,8 +58,9 @@ BEARER_MAPPINGS = {
    #'R4@D2:3/3': ('R4@D2', '3/3', '10.0.2.4', '65002:104', 100, '2.4.3.3', 24),

    # ECOC'22
    'DC1-GW:CS1-GW1': ('CS1-GW1', '10/1', '10.0.1.101', '65000:101', 300, None, None),
    'DC1-GW:CS1-GW2': ('CS1-GW2', '10/1', '10.0.2.101', '65000:102', 300, None, None),
    'DC2-GW:CS2-GW1': ('CS2-GW1', '10/1', '10.0.1.102', '65000:103', 300, None, None),
    'DC2-GW:CS2-GW2': ('CS2-GW2', '10/1', '10.0.2.102', '65000:104', 300, None, None),
    # bearer_ref => device_uuid, endpoint_uuid, sub_if_index, router_id, remote_router, circuit_id
    'DC1-GW:CS1-GW1': ('CS1-GW1', '10/1', 0, '5.5.1.1', '5.5.2.1', 111),
    'DC1-GW:CS1-GW2': ('CS1-GW2', '10/1', 0, '5.5.1.2', '5.5.2.2', 222),
    'DC2-GW:CS2-GW1': ('CS2-GW1', '10/1', 0, '5.5.2.1', '5.5.1.1', 111),
    'DC2-GW:CS2-GW2': ('CS2-GW2', '10/1', 0, '5.5.2.2', '5.5.1.2', 222),
}
+4 −1
Original line number Diff line number Diff line
@@ -91,7 +91,10 @@ class L2VPN_Service(Resource):
                response.status_code = HTTP_NOCONTENT
                return response

            raise Exception('VPN({:s}) not found in database'.format(str(vpn_id)))
            LOGGER.warning('VPN({:s}) not found in database. Nothing done.'.format(str(vpn_id)))
            response = jsonify({})
            response.status_code = HTTP_NOCONTENT
            return response
        except Exception as e: # pylint: disable=broad-except
            LOGGER.exception('Something went wrong Deleting VPN({:s})'.format(str(vpn_id)))
            response = jsonify({'error': str(e)})
+5 −1
Original line number Diff line number Diff line
@@ -44,7 +44,11 @@ class L2VPN_Services(Resource):
        vpn_services : List[Dict] = request_data['ietf-l2vpn-svc:vpn-service']
        for vpn_service in vpn_services:
            try:
                vpn_service_type = vpn_service['vpn-svc-type']
                # By now, assume requests from OSM always need transport slices
                # TODO: think how to differentiate
                #vpn_service_type = vpn_service['vpn-svc-type']
                vpn_service_type = 'vpls'

                if vpn_service_type == 'vpws':
                    # pylint: disable=no-member
                    service_request = Service()
+15 −12
Original line number Diff line number Diff line
@@ -65,7 +65,9 @@ def process_site_network_access(context_client : ContextClient, site_id : str, s
    if mapping is None:
        msg = 'Specified Bearer({:s}) is not configured.'
        raise Exception(msg.format(str(bearer_reference)))
    device_uuid,endpoint_uuid,router_id,route_distinguisher,sub_if_index,address_ip,address_prefix = mapping
    #device_uuid,endpoint_uuid,router_id,route_dist,sub_if_index,address_ip,address_prefix = mapping
    route_dist, address_ip, address_prefix = None, None, None
    device_uuid, endpoint_uuid, sub_if_index, router_id, remote_router, circuit_id = mapping

    target : Union[Service, Slice, None] = None
    if target is None: target = get_slice  (context_client, vpn_id)
@@ -88,20 +90,21 @@ def process_site_network_access(context_client : ContextClient, site_id : str, s
    service_settings_key = '/settings'
    update_config_rule_custom(config_rules, service_settings_key, {
        'mtu'             : (DEFAULT_MTU,              True),
        'address_families': (DEFAULT_ADDRESS_FAMILIES, True),
        'bgp_as'          : (DEFAULT_BGP_AS,           True),
        'bgp_route_target': (DEFAULT_BGP_ROUTE_TARGET, True),
        #'address_families': (DEFAULT_ADDRESS_FAMILIES, True),
        #'bgp_as'          : (DEFAULT_BGP_AS,           True),
        #'bgp_route_target': (DEFAULT_BGP_ROUTE_TARGET, True),
    })

    endpoint_settings_key = '/device[{:s}]/endpoint[{:s}]/settings'.format(device_uuid, endpoint_uuid)
    field_updates = {
        'router_id'          : (router_id,           True),
        'route_distinguisher': (route_distinguisher, True),
        'sub_interface_index': (sub_if_index,        True),
        'vlan_id'            : (cvlan_id,            True),
    }
    field_updates = {}
    if router_id      is not None: field_updates['router_id'          ] = (router_id,      True)
    if route_dist     is not None: field_updates['route_distinguisher'] = (route_dist,     True)
    if sub_if_index   is not None: field_updates['sub_interface_index'] = (sub_if_index,   True)
    if cvlan_id       is not None: field_updates['vlan_id'            ] = (cvlan_id,       True)
    if address_ip     is not None: field_updates['address_ip'         ] = (address_ip,     True)
    if address_prefix is not None: field_updates['address_prefix'     ] = (address_prefix, True)
    if remote_router  is not None: field_updates['remote_router'      ] = (remote_router,  True)
    if circuit_id     is not None: field_updates['circuit_id'         ] = (circuit_id,     True)
    update_config_rule_custom(config_rules, endpoint_settings_key, field_updates)

    field_updates = {}
Loading