Commit e12677e6 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch 'fix/release-2' into 'develop'

Fixes for OFC'22 and ECOC'22 tests

See merge request !48
parents c3ede397 5f5099b1
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -75,19 +75,19 @@ export NATS_REDEPLOY=""
# ----- QuestDB ----------------------------------------------------------------

# If not already set, set the namespace where QuestDB will be deployed.
export QDB_NAMESPACE=${QDB_NAMESPACE:-"qdb"}
export QDB_NAMESPACE="qdb"

# If not already set, set the database username to be used by Monitoring.
export QDB_USERNAME=${QDB_USERNAME:-"admin"}
export QDB_USERNAME="admin"

# If not already set, set the database user's password to be used by Monitoring.
export QDB_PASSWORD=${QDB_PASSWORD:-"quest"}
export QDB_PASSWORD="quest"

# If not already set, set the table name to be used by Monitoring.
export QDB_TABLE=${QDB_TABLE:-"tfs_monitoring"}
export QDB_TABLE="tfs_monitoring"

## If not already set, disable flag for dropping table if exists.
#export QDB_DROP_TABLE_IF_EXISTS=${QDB_DROP_TABLE_IF_EXISTS:-""}
#export QDB_DROP_TABLE_IF_EXISTS=""

# If not already set, disable flag for re-deploying QuestDB from scratch.
export QDB_REDEPLOY=${QDB_REDEPLOY:-""}
export QDB_REDEPLOY=""
+7 −0
Original line number Diff line number Diff line
@@ -63,7 +63,9 @@ class KDisjointPathAlgorithm(_Algorithm):
                if constraint.WhichOneof('constraint') == 'endpoint_location':
                    endpoint_id = constraint.endpoint_location.endpoint_id
                    device_uuid = endpoint_id.device_id.device_uuid.uuid
                    device_uuid = self.device_name_mapping.get(device_uuid, device_uuid)
                    endpoint_uuid = endpoint_id.endpoint_uuid.uuid
                    endpoint_uuid = self.endpoint_name_mapping.get((device_uuid, endpoint_uuid), endpoint_uuid)
                    location_kind = constraint.endpoint_location.location.WhichOneof('location')
                    if location_kind != 'region':
                        MSG = 'Unsupported LocationType({:s}) in Constraint({:s})'
@@ -74,7 +76,9 @@ class KDisjointPathAlgorithm(_Algorithm):
                if constraint.WhichOneof('constraint') == 'endpoint_priority':
                    endpoint_id = constraint.endpoint_priority.endpoint_id
                    device_uuid = endpoint_id.device_id.device_uuid.uuid
                    device_uuid = self.device_name_mapping.get(device_uuid, device_uuid)
                    endpoint_uuid = endpoint_id.endpoint_uuid.uuid
                    endpoint_uuid = self.endpoint_name_mapping.get((device_uuid, endpoint_uuid), endpoint_uuid)
                    priority = constraint.endpoint_priority.priority
                    endpoints.setdefault((device_uuid, endpoint_uuid), dict())['priority'] = priority

@@ -116,8 +120,10 @@ class KDisjointPathAlgorithm(_Algorithm):
        algorithm = KShortestPathAlgorithm(Algorithm_KShortestPath(k_inspection=0, k_return=1))
        algorithm.sync_paths = True
        algorithm.device_list = self.device_list
        algorithm.device_name_mapping = self.device_name_mapping
        algorithm.device_dict = self.device_dict
        algorithm.endpoint_dict = self.endpoint_dict
        algorithm.endpoint_name_mapping = self.endpoint_name_mapping
        algorithm.link_list = self.link_list
        algorithm.link_dict = self.link_dict
        algorithm.endpoint_to_link_dict = self.endpoint_to_link_dict
@@ -139,6 +145,7 @@ class KDisjointPathAlgorithm(_Algorithm):
                _service.service_id.context_id.context_uuid.uuid = service_key[0]
                _service.service_id.service_uuid.uuid = service_key[1]
                _service.service_type = service_type

                for constraint_type, constraint_value in constraints.items():
                    constraint = _service.service_constraints.add()
                    constraint.custom.constraint_type = constraint_type
+11 −0
Original line number Diff line number Diff line
@@ -40,7 +40,9 @@ class _Algorithm:

        self.device_list : List[Dict] = list()
        self.device_dict : Dict[str, Tuple[Dict, Device]] = dict()
        self.device_name_mapping : Dict[str, str] = dict()
        self.endpoint_dict : Dict[str, Dict[str, Tuple[Dict, EndPointId]]] = dict()
        self.endpoint_name_mapping : Dict[Tuple[str, str], str] = dict()
        self.link_list : List[Dict] = list()
        self.link_dict : Dict[str, Tuple[Dict, Link]] = dict()
        self.endpoint_to_link_dict : Dict[Tuple[str, str], Tuple[Dict, Link]] = dict()
@@ -56,12 +58,21 @@ class _Algorithm:
            device_uuid = json_device['device_Id']
            self.device_dict[device_uuid] = (json_device, grpc_device)

            _device_uuid = grpc_device.device_id.device_uuid.uuid
            _device_name = grpc_device.name
            self.device_name_mapping[_device_name] = _device_uuid

            device_endpoint_dict : Dict[str, Tuple[Dict, EndPointId]] = dict()
            for json_endpoint,grpc_endpoint in zip(json_device['device_endpoints'], grpc_device.device_endpoints):
                endpoint_uuid = json_endpoint['endpoint_id']['endpoint_uuid']
                endpoint_tuple = (json_endpoint['endpoint_id'], grpc_endpoint.endpoint_id)
                device_endpoint_dict[endpoint_uuid] = endpoint_tuple

                _endpoint_uuid = grpc_endpoint.endpoint_id.endpoint_uuid.uuid
                _endpoint_name = grpc_endpoint.name
                self.endpoint_name_mapping[(_device_uuid, _endpoint_name)] = _endpoint_uuid
                self.endpoint_name_mapping[(_device_name, _endpoint_name)] = _endpoint_uuid

            self.endpoint_dict[device_uuid] = device_endpoint_dict

    def add_links(self, grpc_links : Union[List[Link], LinkList]) -> None:
+81 −4
Original line number Diff line number Diff line
# Set the URL of your local Docker registry where the images will be uploaded to.
export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/"
#!/bin/bash
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# ----- TeraFlowSDN ------------------------------------------------------------

# Set the URL of the internal MicroK8s Docker registry where the images will be uploaded to.
export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/"

# Set the list of components, separated by spaces, you want to build images for, and deploy.
#export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui load_generator"
export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui"

# Set the tag you want to use for your images.
export TFS_IMAGE_TAG="dev"

# Set the name of the Kubernetes namespace to deploy to.
# Set the name of the Kubernetes namespace to deploy TFS to.
export TFS_K8S_NAMESPACE="tfs"

# Set additional manifest files to be applied after the deployment
export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml"

# Set the neew Grafana admin password
# Set the new Grafana admin password
export TFS_GRAFANA_PASSWORD="admin123+"

# Disable skip-build flag to rebuild the Docker images.
export TFS_SKIP_BUILD=""


# ----- CockroachDB ------------------------------------------------------------

# Set the namespace where CockroackDB will be deployed.
export CRDB_NAMESPACE="crdb"

# Set the database username to be used by Context.
export CRDB_USERNAME="tfs"

# Set the database user's password to be used by Context.
export CRDB_PASSWORD="tfs123"

# Set the database name to be used by Context.
export CRDB_DATABASE="tfs"

# Set CockroachDB installation mode to 'single'. This option is convenient for development and testing.
# See ./deploy/all.sh or ./deploy/crdb.sh for additional details
export CRDB_DEPLOY_MODE="single"

# Disable flag for dropping database, if exists.
export CRDB_DROP_DATABASE_IF_EXISTS=""

# Disable flag for re-deploying CockroachDB from scratch.
export CRDB_REDEPLOY=""


# ----- NATS -------------------------------------------------------------------

# Set the namespace where NATS will be deployed.
export NATS_NAMESPACE="nats"

# Disable flag for re-deploying NATS from scratch.
export NATS_REDEPLOY=""


# ----- QuestDB ----------------------------------------------------------------

# If not already set, set the namespace where QuestDB will be deployed.
export QDB_NAMESPACE="qdb"

# If not already set, set the database username to be used by Monitoring.
export QDB_USERNAME="admin"

# If not already set, set the database user's password to be used by Monitoring.
export QDB_PASSWORD="quest"

# If not already set, set the table name to be used by Monitoring.
export QDB_TABLE="tfs_monitoring"

## If not already set, disable flag for dropping table if exists.
#export QDB_DROP_TABLE_IF_EXISTS=""

# If not already set, disable flag for re-deploying QuestDB from scratch.
export QDB_REDEPLOY=""
+38 −19
Original line number Diff line number Diff line
{
    "contexts": [
        {
            "context_id": {"context_uuid": {"uuid": "admin"}},
            "topology_ids": [], "service_ids": []
        }
        {"context_id": {"context_uuid": {"uuid": "admin"}}}
    ],
    "topologies": [
        {
            "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}},
            "device_ids": [], "link_ids": []
        }
        {"topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}}}
    ],
    "devices": [
        {
@@ -17,7 +11,11 @@
            "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [
                {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}},
                {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}},
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"int\"}]}"}}
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [
                    {"sample_types": [], "type": "copper", "uuid": "eth1"},
                    {"sample_types": [], "type": "copper", "uuid": "eth2"},
                    {"sample_types": [], "type": "copper", "uuid": "int"}
                ]}}}
            ]}
        },
        {
@@ -25,39 +23,55 @@
            "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [
                {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}},
                {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}},
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"eth2\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"int\"}]}"}}
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [
                    {"sample_types": [], "type": "copper", "uuid": "eth1"},
                    {"sample_types": [], "type": "copper", "uuid": "eth2"},
                    {"sample_types": [], "type": "copper", "uuid": "int"}
                ]}}}
            ]}
        },
        {
            "device_id": {"device_uuid": {"uuid": "CS1-GW1"}}, "device_type": "packet-router", "device_drivers": [1],
            "device_id": {"device_uuid": {"uuid": "CS1-GW1"}}, "device_type": "emu-packet-router", "device_drivers": [1],
            "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [
                {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}},
                {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}},
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}]}"}}
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [
                    {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "10/1"},
                    {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "1/1"}
                ]}}}
            ]}
        },
        {
            "device_id": {"device_uuid": {"uuid": "CS1-GW2"}}, "device_type": "packet-router", "device_drivers": [1],
            "device_id": {"device_uuid": {"uuid": "CS1-GW2"}}, "device_type": "emu-packet-router", "device_drivers": [1],
            "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [
                {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}},
                {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}},
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}]}"}}
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [
                    {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "10/1"},
                    {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "1/1"}
                ]}}}
            ]}
        },
        {
            "device_id": {"device_uuid": {"uuid": "CS2-GW1"}}, "device_type": "packet-router", "device_drivers": [1],
            "device_id": {"device_uuid": {"uuid": "CS2-GW1"}}, "device_type": "emu-packet-router", "device_drivers": [1],
            "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [
                {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}},
                {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}},
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}]}"}}
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [
                    {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "10/1"},
                    {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "1/1"}
                ]}}}
            ]}
        },
        {
            "device_id": {"device_uuid": {"uuid": "CS2-GW2"}}, "device_type": "packet-router", "device_drivers": [1],
            "device_id": {"device_uuid": {"uuid": "CS2-GW2"}}, "device_type": "emu-packet-router", "device_drivers": [1],
            "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [
                {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}},
                {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}},
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"10/1\"}, {\"sample_types\": [], \"type\": \"copper\", \"uuid\": \"1/1\"}]}"}}
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [
                    {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "10/1"},
                    {"sample_types": [101, 102, 201, 202], "type": "copper", "uuid": "1/1"}
                ]}}}
            ]}
        },
        {
@@ -65,7 +79,12 @@
            "device_endpoints": [], "device_operational_status": 1, "device_config": {"config_rules": [
                {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "127.0.0.1"}},
                {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "0"}},
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": "{\"endpoints\": [{\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"aade6001-f00b-5e2f-a357-6a0a9d3de870\"}, {\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"eb287d83-f05e-53ec-ab5a-adf6bd2b5418\"}, {\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"0ef74f99-1acc-57bd-ab9d-4b958b06c513\"}, {\"sample_types\": [], \"type\": \"optical\", \"uuid\": \"50296d99-58cc-5ce7-82f5-fc8ee4eec2ec\"}]}"}}
                {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [
                    {"sample_types": [], "type": "optical", "uuid": "aade6001-f00b-5e2f-a357-6a0a9d3de870"},
                    {"sample_types": [], "type": "optical", "uuid": "eb287d83-f05e-53ec-ab5a-adf6bd2b5418"},
                    {"sample_types": [], "type": "optical", "uuid": "0ef74f99-1acc-57bd-ab9d-4b958b06c513"},
                    {"sample_types": [], "type": "optical", "uuid": "50296d99-58cc-5ce7-82f5-fc8ee4eec2ec"}
                ]}}}
            ]}
        }
    ],
Loading