From 7ab8e150dd24878155cdadce7ab10020bd08f184 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Thu, 11 May 2023 17:13:58 +0000 Subject: [PATCH 01/20] Manifests: - Removed unused code --- manifests/nginx_ingress_http.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/manifests/nginx_ingress_http.yaml b/manifests/nginx_ingress_http.yaml index 5db05d4af..80caefa93 100644 --- a/manifests/nginx_ingress_http.yaml +++ b/manifests/nginx_ingress_http.yaml @@ -36,13 +36,6 @@ spec: name: webuiservice port: number: 3000 - #- path: /context(/|$)(.*) - # pathType: Prefix - # backend: - # service: - # name: contextservice - # port: - # number: 8080 - path: /()(restconf/.*) pathType: Prefix backend: -- GitLab From e32b74a595ec5fe48dc04f2bd9556fc509a35d56 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Thu, 11 May 2023 17:17:04 +0000 Subject: [PATCH 02/20] OECC/PSC'22 - Interdomain test: - Updated descriptors to release 2 - Updated scripts to release 2 - Updated manifests to release 2 - Added TODO file --- src/tests/oeccpsc22/.gitignore | 1 + src/tests/oeccpsc22/TODO.txt | 3 + src/tests/oeccpsc22/delete_all.sh | 22 +++ src/tests/oeccpsc22/deploy_all.sh | 36 ++++ src/tests/oeccpsc22/deploy_dom1.sh | 29 +++ src/tests/oeccpsc22/deploy_dom2.sh | 29 +++ src/tests/oeccpsc22/deploy_specs_dom1.sh | 127 ++++++++++++++ src/tests/oeccpsc22/deploy_specs_dom2.sh | 127 ++++++++++++++ src/tests/oeccpsc22/descriptors/domain1.json | 148 ++++++++++++++++ src/tests/oeccpsc22/descriptors/domain2.json | 166 ++++++++++++++++++ src/tests/oeccpsc22/descriptors/domain3.json | 110 ++++++++++++ src/tests/oeccpsc22/descriptors/domain4.json | 101 +++++++++++ .../descriptors/inter-domain-service.json | 41 +++++ src/tests/oeccpsc22/dump_logs.sh | 45 +++-- src/tests/oeccpsc22/expose-services-dom1.yaml | 106 +++++++++++ src/tests/oeccpsc22/expose-services-dom2.yaml | 106 +++++++++++ .../oeccpsc22/expose_services_teraflow_1.yaml | 106 ----------- .../oeccpsc22/expose_services_teraflow_2.yaml | 106 ----------- src/tests/oeccpsc22/fast_redeploy.sh | 63 +++++++ .../nginx-ingress-controller-dom1.yaml | 134 ++++++++++++++ .../nginx-ingress-controller-dom2.yaml | 134 ++++++++++++++ .../oeccpsc22/nginx-ingress-http-dom1.yaml | 46 +++++ .../oeccpsc22/nginx-ingress-http-dom2.yaml | 53 ++++++ .../{ => old}/deploy_in_kubernetes.sh | 0 src/tests/oeccpsc22/show_deploy.sh | 33 +++- 25 files changed, 1636 insertions(+), 236 deletions(-) create mode 100644 src/tests/oeccpsc22/.gitignore create mode 100644 src/tests/oeccpsc22/TODO.txt create mode 100755 src/tests/oeccpsc22/delete_all.sh create mode 100755 src/tests/oeccpsc22/deploy_all.sh create mode 100755 src/tests/oeccpsc22/deploy_dom1.sh create mode 100755 src/tests/oeccpsc22/deploy_dom2.sh create mode 100755 src/tests/oeccpsc22/deploy_specs_dom1.sh create mode 100755 src/tests/oeccpsc22/deploy_specs_dom2.sh create mode 100644 src/tests/oeccpsc22/descriptors/domain1.json create mode 100644 src/tests/oeccpsc22/descriptors/domain2.json create mode 100644 src/tests/oeccpsc22/descriptors/domain3.json create mode 100644 src/tests/oeccpsc22/descriptors/domain4.json create mode 100644 src/tests/oeccpsc22/descriptors/inter-domain-service.json create mode 100644 src/tests/oeccpsc22/expose-services-dom1.yaml create mode 100644 src/tests/oeccpsc22/expose-services-dom2.yaml delete mode 100644 src/tests/oeccpsc22/expose_services_teraflow_1.yaml delete mode 100644 src/tests/oeccpsc22/expose_services_teraflow_2.yaml create mode 100755 src/tests/oeccpsc22/fast_redeploy.sh create mode 100644 src/tests/oeccpsc22/nginx-ingress-controller-dom1.yaml create mode 100644 src/tests/oeccpsc22/nginx-ingress-controller-dom2.yaml create mode 100644 src/tests/oeccpsc22/nginx-ingress-http-dom1.yaml create mode 100644 src/tests/oeccpsc22/nginx-ingress-http-dom2.yaml rename src/tests/oeccpsc22/{ => old}/deploy_in_kubernetes.sh (100%) diff --git a/src/tests/oeccpsc22/.gitignore b/src/tests/oeccpsc22/.gitignore new file mode 100644 index 000000000..6b97d6fe3 --- /dev/null +++ b/src/tests/oeccpsc22/.gitignore @@ -0,0 +1 @@ +# Add here your files containing confidential testbed details such as IP addresses, ports, usernames, passwords, etc. diff --git a/src/tests/oeccpsc22/TODO.txt b/src/tests/oeccpsc22/TODO.txt new file mode 100644 index 000000000..d786eee8b --- /dev/null +++ b/src/tests/oeccpsc22/TODO.txt @@ -0,0 +1,3 @@ +- Update domain descriptors to 2 domains +- Test scenario deployment +- Test scenario operation diff --git a/src/tests/oeccpsc22/delete_all.sh b/src/tests/oeccpsc22/delete_all.sh new file mode 100755 index 000000000..c0d39fa8b --- /dev/null +++ b/src/tests/oeccpsc22/delete_all.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + + +# Delete old namespaces +kubectl delete namespace tfs-dom1 tfs-dom2 + +# Delete secondary ingress controllers +kubectl delete -f oeccpsc22/nginx-ingress-controller-dom1.yaml +kubectl delete -f oeccpsc22/nginx-ingress-controller-dom2.yaml diff --git a/src/tests/oeccpsc22/deploy_all.sh b/src/tests/oeccpsc22/deploy_all.sh new file mode 100755 index 000000000..737230346 --- /dev/null +++ b/src/tests/oeccpsc22/deploy_all.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + + +# Delete old namespaces +kubectl delete namespace tfs-dom1 tfs-dom2 + +# Delete secondary ingress controllers +kubectl delete -f oeccpsc22/nginx-ingress-controller-dom1.yaml +kubectl delete -f oeccpsc22/nginx-ingress-controller-dom2.yaml + +# Create secondary ingress controllers +kubectl apply -f oeccpsc22/nginx-ingress-controller-dom1.yaml +kubectl apply -f oeccpsc22/nginx-ingress-controller-dom2.yaml + +# Deploy TFS for Domain 1 +source oeccpsc22/deploy_specs_dom1.sh +./deploy/all.sh +mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_dom1.sh + +# Deploy TFS for Domain 2 +source oeccpsc22/deploy_specs_dom2.sh +./deploy/all.sh +mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_dom2.sh diff --git a/src/tests/oeccpsc22/deploy_dom1.sh b/src/tests/oeccpsc22/deploy_dom1.sh new file mode 100755 index 000000000..81fb99844 --- /dev/null +++ b/src/tests/oeccpsc22/deploy_dom1.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + + +# Delete old namespaces +kubectl delete namespace tfs-dom1 + +# Delete secondary ingress controllers +kubectl delete -f oeccpsc22/nginx-ingress-controller-dom1.yaml + +# Create secondary ingress controllers +kubectl apply -f oeccpsc22/nginx-ingress-controller-dom1.yaml + +# Deploy TFS for Domain 1 +source oeccpsc22/deploy_specs_dom1.sh +./deploy/all.sh +mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_dom1.sh diff --git a/src/tests/oeccpsc22/deploy_dom2.sh b/src/tests/oeccpsc22/deploy_dom2.sh new file mode 100755 index 000000000..93fff1d15 --- /dev/null +++ b/src/tests/oeccpsc22/deploy_dom2.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + + +# Delete old namespaces +kubectl delete namespace tfs-dom2 + +# Delete secondary ingress controllers +kubectl delete -f oeccpsc22/nginx-ingress-controller-dom2.yaml + +# Create secondary ingress controllers +kubectl apply -f oeccpsc22/nginx-ingress-controller-dom2.yaml + +# Deploy TFS for Domain 2 +source oeccpsc22/deploy_specs_dom2.sh +./deploy/all.sh +mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_dom2.sh diff --git a/src/tests/oeccpsc22/deploy_specs_dom1.sh b/src/tests/oeccpsc22/deploy_specs_dom1.sh new file mode 100755 index 000000000..8bf7aaeb7 --- /dev/null +++ b/src/tests/oeccpsc22/deploy_specs_dom1.sh @@ -0,0 +1,127 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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 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 TFS to. +export TFS_K8S_NAMESPACE="tfs-dom1" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="oeccpsc22/nginx-ingress-http-dom1.yaml oeccpsc22/expose-services-dom1.yaml" + +# 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 external port CockroackDB Postgre SQL interface will be exposed to. +export CRDB_EXT_PORT_SQL="26257" + +# Set the external port CockroackDB HTTP Mgmt GUI interface will be exposed to. +export CRDB_EXT_PORT_HTTP="8081" + +# 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_dom1" + +# 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 it exists. +export CRDB_DROP_DATABASE_IF_EXISTS="YES" + +# Disable flag for re-deploying CockroachDB from scratch. +export CRDB_REDEPLOY="" + + +# ----- NATS ------------------------------------------------------------------- + +# Set the namespace where NATS will be deployed. +export NATS_NAMESPACE="nats-dom1" + +# Set the external port NATS Client interface will be exposed to. +export NATS_EXT_PORT_CLIENT="4223" + +# Set the external port NATS HTTP Mgmt GUI interface will be exposed to. +export NATS_EXT_PORT_HTTP="8223" + +# Disable flag for re-deploying NATS from scratch. +export NATS_REDEPLOY="" + + +# ----- QuestDB ---------------------------------------------------------------- + +# Set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE="qdb-dom1" + +# Set the external port QuestDB Postgre SQL interface will be exposed to. +export QDB_EXT_PORT_SQL="8813" + +# Set the external port QuestDB Influx Line Protocol interface will be exposed to. +export QDB_EXT_PORT_ILP="9011" + +# Set the external port QuestDB HTTP Mgmt GUI interface will be exposed to. +export QDB_EXT_PORT_HTTP="9001" + +# Set the database username to be used for QuestDB. +export QDB_USERNAME="admin" + +# Set the database user's password to be used for QuestDB. +export QDB_PASSWORD="quest" + +# Set the table name to be used by Monitoring for KPIs. +export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" + +# Set the table name to be used by Slice for plotting groups. +export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" + +# Disable flag for dropping tables if they exist. +export QDB_DROP_TABLES_IF_EXIST="YES" + +# Disable flag for re-deploying QuestDB from scratch. +export QDB_REDEPLOY="" + + +# ----- K8s Observability ------------------------------------------------------ + +# Set the external port Prometheus Mgmt HTTP GUI interface will be exposed to. +export PROM_EXT_PORT_HTTP="9090" + +# Set the external port Grafana HTTP Dashboards will be exposed to. +export GRAF_EXT_PORT_HTTP="3000" diff --git a/src/tests/oeccpsc22/deploy_specs_dom2.sh b/src/tests/oeccpsc22/deploy_specs_dom2.sh new file mode 100755 index 000000000..41c382409 --- /dev/null +++ b/src/tests/oeccpsc22/deploy_specs_dom2.sh @@ -0,0 +1,127 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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 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 TFS to. +export TFS_K8S_NAMESPACE="tfs-dom2" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="oeccpsc22/nginx-ingress-http-dom2.yaml oeccpsc22/expose-services-dom2.yaml" + +# Set the new Grafana admin password +export TFS_GRAFANA_PASSWORD="admin123+" + +# Disable skip-build flag to rebuild the Docker images. +export TFS_SKIP_BUILD="YES" + + +# ----- CockroachDB ------------------------------------------------------------ + +# Set the namespace where CockroackDB will be deployed. +export CRDB_NAMESPACE="crdb" + +# Set the external port CockroackDB Postgre SQL interface will be exposed to. +export CRDB_EXT_PORT_SQL="26257" + +# Set the external port CockroackDB HTTP Mgmt GUI interface will be exposed to. +export CRDB_EXT_PORT_HTTP="8081" + +# 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_dom2" + +# 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 it exists. +export CRDB_DROP_DATABASE_IF_EXISTS="YES" + +# Disable flag for re-deploying CockroachDB from scratch. +export CRDB_REDEPLOY="" + + +# ----- NATS ------------------------------------------------------------------- + +# Set the namespace where NATS will be deployed. +export NATS_NAMESPACE="nats-dom2" + +# Set the external port NATS Client interface will be exposed to. +export NATS_EXT_PORT_CLIENT="4224" + +# Set the external port NATS HTTP Mgmt GUI interface will be exposed to. +export NATS_EXT_PORT_HTTP="8224" + +# Disable flag for re-deploying NATS from scratch. +export NATS_REDEPLOY="" + + +# ----- QuestDB ---------------------------------------------------------------- + +# Set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE="qdb-dom2" + +# Set the external port QuestDB Postgre SQL interface will be exposed to. +export QDB_EXT_PORT_SQL="8814" + +# Set the external port QuestDB Influx Line Protocol interface will be exposed to. +export QDB_EXT_PORT_ILP="9012" + +# Set the external port QuestDB HTTP Mgmt GUI interface will be exposed to. +export QDB_EXT_PORT_HTTP="9002" + +# Set the database username to be used for QuestDB. +export QDB_USERNAME="admin" + +# Set the database user's password to be used for QuestDB. +export QDB_PASSWORD="quest" + +# Set the table name to be used by Monitoring for KPIs. +export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" + +# Set the table name to be used by Slice for plotting groups. +export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" + +# Disable flag for dropping tables if they exist. +export QDB_DROP_TABLES_IF_EXIST="YES" + +# Disable flag for re-deploying QuestDB from scratch. +export QDB_REDEPLOY="" + + +# ----- K8s Observability ------------------------------------------------------ + +# Set the external port Prometheus Mgmt HTTP GUI interface will be exposed to. +export PROM_EXT_PORT_HTTP="9090" + +# Set the external port Grafana HTTP Dashboards will be exposed to. +export GRAF_EXT_PORT_HTTP="3000" diff --git a/src/tests/oeccpsc22/descriptors/domain1.json b/src/tests/oeccpsc22/descriptors/domain1.json new file mode 100644 index 000000000..043b3955f --- /dev/null +++ b/src/tests/oeccpsc22/descriptors/domain1.json @@ -0,0 +1,148 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D1"}} + ], "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D1"}}, + "device_ids": [ + {"device_uuid": {"uuid": "DC1"}}, + {"device_uuid": {"uuid": "R1@D1"}}, + {"device_uuid": {"uuid": "R2@D1"}}, + {"device_uuid": {"uuid": "R3@D1"}}, + {"device_uuid": {"uuid": "R4@D1"}}, + {"device_uuid": {"uuid": "R5@D1"}} + ], "link_ids": [ + {"link_uuid": {"uuid": "DC1/D1==R1@D1/DC1"}}, + {"link_uuid": {"uuid": "R1@D1/2==R2@D1/1"}}, + {"link_uuid": {"uuid": "R2@D1/3==R3@D1/2"}}, + {"link_uuid": {"uuid": "R2@D1/5==R5@D1/2"}}, + {"link_uuid": {"uuid": "R3@D1/4==R4@D1/3"}}, + {"link_uuid": {"uuid": "R4@D1/5==R5@D1/4"}}, + {"link_uuid": {"uuid": "R5@D1/1==R1@D1/5"}} + ] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "DC1"}}, "device_type": "emu-datacenter", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/border", "uuid": "D1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "int"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R1@D1"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "5"}, + {"sample_types": [], "type": "copper/border", "uuid": "DC1"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R2@D1"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"}, + {"sample_types": [], "type": "copper/internal", "uuid": "5"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R3@D1"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R4@D1"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "3"}, + {"sample_types": [], "type": "copper/internal", "uuid": "5"}, + {"sample_types": [], "type": "copper/border", "uuid": "D2"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R5@D1"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"}, + {"sample_types": [], "type": "copper/border", "uuid": "D3"} + ]}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "DC1/D1==R1@D1/DC1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "DC1"}}, "endpoint_uuid": {"uuid": "D1"}}, + {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "DC1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R1@D1/2==R2@D1/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "2"}}, + {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D1/3==R3@D1/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D1"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D1/5==R5@D1/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "5"}}, + {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3@D1/4==R4@D1/3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3@D1"}}, "endpoint_uuid": {"uuid": "4"}}, + {"device_id": {"device_uuid": {"uuid": "R4@D1"}}, "endpoint_uuid": {"uuid": "3"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R4@D1/5==R5@D1/4"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4@D1"}}, "endpoint_uuid": {"uuid": "5"}}, + {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "4"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R5@D1/1==R1@D1/5"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "1"}}, + {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "5"}} + ] + } + ] +} diff --git a/src/tests/oeccpsc22/descriptors/domain2.json b/src/tests/oeccpsc22/descriptors/domain2.json new file mode 100644 index 000000000..81d397abf --- /dev/null +++ b/src/tests/oeccpsc22/descriptors/domain2.json @@ -0,0 +1,166 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D2"}} + ], "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D2"}}, + "device_ids": [ + {"device_uuid": {"uuid": "R1@D2"}}, + {"device_uuid": {"uuid": "R2@D2"}}, + {"device_uuid": {"uuid": "R3@D2"}}, + {"device_uuid": {"uuid": "R4@D2"}}, + {"device_uuid": {"uuid": "R5@D2"}}, + {"device_uuid": {"uuid": "R6@D2"}} + ], "link_ids": [ + {"link_uuid": {"uuid": "R1@D2/2==R2@D2/1"}}, + {"link_uuid": {"uuid": "R1@D2/6==R6@D2/1"}}, + {"link_uuid": {"uuid": "R1@D2/5==R5@D2/1"}}, + {"link_uuid": {"uuid": "R2@D2/3==R3@D2/2"}}, + {"link_uuid": {"uuid": "R2@D2/4==R4@D2/2"}}, + {"link_uuid": {"uuid": "R2@D2/5==R5@D2/2"}}, + {"link_uuid": {"uuid": "R2@D2/6==R6@D2/2"}}, + {"link_uuid": {"uuid": "R3@D2/6==R6@D2/3"}}, + {"link_uuid": {"uuid": "R4@D2/5==R5@D2/4"}} + ] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "5"}, + {"sample_types": [], "type": "copper/internal", "uuid": "6"}, + {"sample_types": [], "type": "copper/border", "uuid": "D1"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R2@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"}, + {"sample_types": [], "type": "copper/internal", "uuid": "5"}, + {"sample_types": [], "type": "copper/internal", "uuid": "6"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R3@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "6"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R4@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "5"}, + {"sample_types": [], "type": "copper/border", "uuid": "D4"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R5@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"}, + {"sample_types": [], "type": "copper/border", "uuid": "D3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R6@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"} + ]}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R1@D2/2==R2@D2/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D2"}}, "endpoint_uuid": {"uuid": "2"}}, + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R1@D2/6==R6@D2/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D2"}}, "endpoint_uuid": {"uuid": "6"}}, + {"device_id": {"device_uuid": {"uuid": "R6@D2"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R1@D2/5==R5@D2/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D2"}}, "endpoint_uuid": {"uuid": "5"}}, + {"device_id": {"device_uuid": {"uuid": "R5@D2"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D2/3==R3@D2/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D2"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D2/4==R4@D2/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "4"}}, + {"device_id": {"device_uuid": {"uuid": "R4@D2"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D2/5==R5@D2/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "5"}}, + {"device_id": {"device_uuid": {"uuid": "R5@D2"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D2/6==R6@D2/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "6"}}, + {"device_id": {"device_uuid": {"uuid": "R6@D2"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3@D2/6==R6@D2/3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3@D2"}}, "endpoint_uuid": {"uuid": "6"}}, + {"device_id": {"device_uuid": {"uuid": "R6@D2"}}, "endpoint_uuid": {"uuid": "3"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R4@D2/5==R5@D2/4"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4@D2"}}, "endpoint_uuid": {"uuid": "5"}}, + {"device_id": {"device_uuid": {"uuid": "R5@D2"}}, "endpoint_uuid": {"uuid": "4"}} + ] + } + ] +} diff --git a/src/tests/oeccpsc22/descriptors/domain3.json b/src/tests/oeccpsc22/descriptors/domain3.json new file mode 100644 index 000000000..3a8e47d30 --- /dev/null +++ b/src/tests/oeccpsc22/descriptors/domain3.json @@ -0,0 +1,110 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D3"}} + ], "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D3"}}, + "device_ids": [ + {"device_uuid": {"uuid": "R1@D3"}}, + {"device_uuid": {"uuid": "R2@D3"}}, + {"device_uuid": {"uuid": "R3@D3"}}, + {"device_uuid": {"uuid": "R4@D3"}} + ], "link_ids": [ + {"link_uuid": {"uuid": "R1@D3/2==R2@D3/1"}}, + {"link_uuid": {"uuid": "R2@D3/3==R3@D3/2"}}, + {"link_uuid": {"uuid": "R3@D3/4==R4@D3/3"}}, + {"link_uuid": {"uuid": "R4@D3/1==R1@D3/4"}}, + {"link_uuid": {"uuid": "R2@D3/4==R4@D3/2"}} + ] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "R1@D3"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"}, + {"sample_types": [], "type": "copper/border", "uuid": "D1"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R2@D3"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"}, + {"sample_types": [], "type": "copper/border", "uuid": "D2"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R3@D3"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "4"}, + {"sample_types": [], "type": "copper/border", "uuid": "D4"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R4@D3"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"} + ]}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R1@D3/2==R2@D3/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D3"}}, "endpoint_uuid": {"uuid": "2"}}, + {"device_id": {"device_uuid": {"uuid": "R2@D3"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D3/3==R3@D3/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D3"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D3"}}, "endpoint_uuid": {"uuid": "2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R3@D3/4==R4@D3/3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3@D3"}}, "endpoint_uuid": {"uuid": "4"}}, + {"device_id": {"device_uuid": {"uuid": "R4@D3"}}, "endpoint_uuid": {"uuid": "3"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R4@D3/1==R1@D3/4"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4@D3"}}, "endpoint_uuid": {"uuid": "1"}}, + {"device_id": {"device_uuid": {"uuid": "R1@D3"}}, "endpoint_uuid": {"uuid": "4"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D3/4==R4@D3/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D3"}}, "endpoint_uuid": {"uuid": "4"}}, + {"device_id": {"device_uuid": {"uuid": "R4@D3"}}, "endpoint_uuid": {"uuid": "2"}} + ] + } + ] +} diff --git a/src/tests/oeccpsc22/descriptors/domain4.json b/src/tests/oeccpsc22/descriptors/domain4.json new file mode 100644 index 000000000..d9e2d049a --- /dev/null +++ b/src/tests/oeccpsc22/descriptors/domain4.json @@ -0,0 +1,101 @@ +{ + "contexts": [ + { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "topology_ids": [ + {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D4"}} + ], "service_ids": [] + } + ], + "topologies": [ + { + "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D4"}}, + "device_ids": [ + {"device_uuid": {"uuid": "DC2"}}, + {"device_uuid": {"uuid": "R1@D4"}}, + {"device_uuid": {"uuid": "R2@D4"}}, + {"device_uuid": {"uuid": "R3@D4"}} + ], "link_ids": [ + {"link_uuid": {"uuid": "R3@D4/DC2==DC2/D4"}}, + {"link_uuid": {"uuid": "R1@D4/2==R2@D4/1"}}, + {"link_uuid": {"uuid": "R1@D4/3==R3@D4/1"}}, + {"link_uuid": {"uuid": "R2@D4/3==R3@D4/2"}} + ] + } + ], + "devices": [ + { + "device_id": {"device_uuid": {"uuid": "DC2"}}, "device_type": "emu-datacenter", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/border", "uuid": "D4"}, + {"sample_types": [], "type": "copper/internal", "uuid": "int"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R1@D4"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"}, + {"sample_types": [], "type": "copper/border", "uuid": "D3"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R2@D4"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "3"}, + {"sample_types": [], "type": "copper/border", "uuid": "D2"} + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "R3@D4"}}, "device_type": "emu-packet-router", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, + {"sample_types": [], "type": "copper/internal", "uuid": "2"}, + {"sample_types": [], "type": "copper/border", "uuid": "DC2"} + ]}}} + ]} + } + ], + "links": [ + { + "link_id": {"link_uuid": {"uuid": "R3@D4/DC2==DC2/D4"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "DC2"}}, "endpoint_uuid": {"uuid": "D4"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D4"}}, "endpoint_uuid": {"uuid": "DC2"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R1@D4/2==R2@D4/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D4"}}, "endpoint_uuid": {"uuid": "2"}}, + {"device_id": {"device_uuid": {"uuid": "R2@D4"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R1@D4/3==R3@D4/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D4"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D4"}}, "endpoint_uuid": {"uuid": "1"}} + ] + }, + { + "link_id": {"link_uuid": {"uuid": "R2@D4/3==R3@D4/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D4"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D4"}}, "endpoint_uuid": {"uuid": "2"}} + ] + } + ] +} diff --git a/src/tests/oeccpsc22/descriptors/inter-domain-service.json b/src/tests/oeccpsc22/descriptors/inter-domain-service.json new file mode 100644 index 000000000..40a1f0101 --- /dev/null +++ b/src/tests/oeccpsc22/descriptors/inter-domain-service.json @@ -0,0 +1,41 @@ +{ + "services": [ + { + "service_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, "service_uuid": {"uuid": "inter-dom-svc"} + }, + "service_type": 2, + "service_status": {"service_status": 1}, + "service_endpoint_ids": [ + {"device_id":{"device_uuid":{"uuid":"DC1"}},"endpoint_uuid":{"uuid":"int"}}, + {"device_id":{"device_uuid":{"uuid":"DC2"}},"endpoint_uuid":{"uuid":"int"}} + ], + "service_constraints": [ + {"sla_capacity": {"capacity_gbps": 10.0}}, + {"sla_latency": {"e2e_latency_ms": 15.2}} + ], + "service_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "/settings", "resource_value": { + "address_families": ["IPV4"], "bgp_as": 65000, "bgp_route_target": "65000:123", + "mtu": 1512, "vlan_id": 300 + }}}, + {"action": 1, "custom": {"resource_key": "/device[PE1]/endpoint[1/1]/settings", "resource_value": { + "route_distinguisher": "65000:123", "router_id": "10.0.0.1", + "address_ip": "3.3.1.1", "address_prefix": 24, "sub_interface_index": 1, "vlan_id": 300 + }}}, + {"action": 1, "custom": {"resource_key": "/device[PE2]/endpoint[1/1]/settings", "resource_value": { + "route_distinguisher": "65000:123", "router_id": "10.0.0.2", + "address_ip": "3.3.2.1", "address_prefix": 24, "sub_interface_index": 1, "vlan_id": 300 + }}}, + {"action": 1, "custom": {"resource_key": "/device[PE3]/endpoint[1/1]/settings", "resource_value": { + "route_distinguisher": "65000:123", "router_id": "10.0.0.3", + "address_ip": "3.3.3.1", "address_prefix": 24, "sub_interface_index": 1, "vlan_id": 300 + }}}, + {"action": 1, "custom": {"resource_key": "/device[PE4]/endpoint[1/1]/settings", "resource_value": { + "route_distinguisher": "65000:123", "router_id": "10.0.0.4", + "address_ip": "3.3.4.1", "address_prefix": 24, "sub_interface_index": 1, "vlan_id": 300 + }}} + ]} + } + ] +} diff --git a/src/tests/oeccpsc22/dump_logs.sh b/src/tests/oeccpsc22/dump_logs.sh index a2180f6df..3a2e51a56 100755 --- a/src/tests/oeccpsc22/dump_logs.sh +++ b/src/tests/oeccpsc22/dump_logs.sh @@ -5,7 +5,7 @@ # 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 +# 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, @@ -13,20 +13,33 @@ # See the License for the specific language governing permissions and # limitations under the License. -mkdir -p tmp/exec_logs/ -kubectl --namespace oeccpsc22-1 logs deployment/computeservice -c server > tmp/exec_logs/d1_compute.log -kubectl --namespace oeccpsc22-1 logs deployment/contextservice -c server > tmp/exec_logs/d1_context.log -kubectl --namespace oeccpsc22-1 logs deployment/deviceservice -c server > tmp/exec_logs/d1_device.log -kubectl --namespace oeccpsc22-1 logs deployment/interdomainservice -c server > tmp/exec_logs/d1_interdomain.log -kubectl --namespace oeccpsc22-1 logs deployment/monitoringservice -c server > tmp/exec_logs/d1_monitoring.log -kubectl --namespace oeccpsc22-1 logs deployment/serviceservice -c server > tmp/exec_logs/d1_service.log -kubectl --namespace oeccpsc22-1 logs deployment/sliceservice -c server > tmp/exec_logs/d1_slice.log +rm -rf tmp/exec -kubectl --namespace oeccpsc22-2 logs deployment/computeservice -c server > tmp/exec_logs/d2_compute.log -kubectl --namespace oeccpsc22-2 logs deployment/contextservice -c server > tmp/exec_logs/d2_context.log -kubectl --namespace oeccpsc22-2 logs deployment/deviceservice -c server > tmp/exec_logs/d2_device.log -kubectl --namespace oeccpsc22-2 logs deployment/interdomainservice -c server > tmp/exec_logs/d2_interdomain.log -kubectl --namespace oeccpsc22-2 logs deployment/monitoringservice -c server > tmp/exec_logs/d2_monitoring.log -kubectl --namespace oeccpsc22-2 logs deployment/serviceservice -c server > tmp/exec_logs/d2_service.log -kubectl --namespace oeccpsc22-2 logs deployment/sliceservice -c server > tmp/exec_logs/d2_slice.log +echo "Collecting logs for Domain 1..." +mkdir -p tmp/exec/dom1 +kubectl --namespace tfs-dom1 logs deployments/contextservice server > tmp/exec/dom1/context.log +kubectl --namespace tfs-dom1 logs deployments/deviceservice server > tmp/exec/dom1/device.log +kubectl --namespace tfs-dom1 logs deployments/serviceservice server > tmp/exec/dom1/service.log +kubectl --namespace tfs-dom1 logs deployments/pathcompservice frontend > tmp/exec/dom1/pathcomp-frontend.log +kubectl --namespace tfs-dom1 logs deployments/pathcompservice backend > tmp/exec/dom1/pathcomp-backend.log +kubectl --namespace tfs-dom1 logs deployments/sliceservice server > tmp/exec/dom1/slice.log +kubectl --namespace tfs-dom1 logs deployment/computeservice server > tmp/exec/dom1/compute.log +kubectl --namespace tfs-dom1 logs deployment/interdomainservice server > tmp/exec/dom1/interdomain.log +kubectl --namespace tfs-dom1 logs deployment/monitoringservice server > tmp/exec/dom1/monitoring.log +printf "\n" + +echo "Collecting logs for Domain 2..." +mkdir -p tmp/exec/dom2 +kubectl --namespace tfs-dom2 logs deployments/contextservice server > tmp/exec/dom2/context.log +kubectl --namespace tfs-dom2 logs deployments/deviceservice server > tmp/exec/dom2/device.log +kubectl --namespace tfs-dom2 logs deployments/serviceservice server > tmp/exec/dom2/service.log +kubectl --namespace tfs-dom2 logs deployments/pathcompservice frontend > tmp/exec/dom2/pathcomp-frontend.log +kubectl --namespace tfs-dom2 logs deployments/pathcompservice backend > tmp/exec/dom2/pathcomp-backend.log +kubectl --namespace tfs-dom2 logs deployments/sliceservice server > tmp/exec/dom2/slice.log +kubectl --namespace tfs-dom2 logs deployment/computeservice server > tmp/exec/dom2/compute.log +kubectl --namespace tfs-dom2 logs deployment/interdomainservice server > tmp/exec/dom2/interdomain.log +kubectl --namespace tfs-dom2 logs deployment/monitoringservice server > tmp/exec/dom2/monitoring.log +printf "\n" + +echo "Done!" diff --git a/src/tests/oeccpsc22/expose-services-dom1.yaml b/src/tests/oeccpsc22/expose-services-dom1.yaml new file mode 100644 index 000000000..ebfb38fc4 --- /dev/null +++ b/src/tests/oeccpsc22/expose-services-dom1.yaml @@ -0,0 +1,106 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +apiVersion: v1 +kind: Service +metadata: + name: remote-teraflow +spec: + type: ExternalName + externalName: interdomainservice.dom2.svc.cluster.local + ports: + - name: grpc + protocol: TCP + port: 10010 +#--- +#apiVersion: v1 +#kind: Service +#metadata: +# name: contextservice-public +# labels: +# app: contextservice +#spec: +# type: NodePort +# selector: +# app: contextservice +# ports: +# - name: grpc +# protocol: TCP +# port: 1010 +# targetPort: 1010 +# nodePort: 30111 +# - name: rest +# protocol: TCP +# port: 8080 +# targetPort: 8080 +# nodePort: 30001 +# - name: redis +# protocol: TCP +# port: 6379 +# targetPort: 6379 +# nodePort: 30631 +#--- +#apiVersion: v1 +#kind: Service +#metadata: +# name: deviceservice-public +# labels: +# app: deviceservice +#spec: +# type: NodePort +# selector: +# app: deviceservice +# ports: +# - name: grpc +# protocol: TCP +# port: 2020 +# targetPort: 2020 +# nodePort: 30221 +#--- +#apiVersion: v1 +#kind: Service +#metadata: +# name: computeservice-public +#spec: +# type: NodePort +# selector: +# app: computeservice +# ports: +# - name: http +# protocol: TCP +# port: 8080 +# targetPort: 8080 +# nodePort: 30881 +#--- +#apiVersion: v1 +#kind: Service +#metadata: +# name: webuiservice-public +# labels: +# app: webuiservice +#spec: +# type: NodePort +# selector: +# app: webuiservice +# ports: +# - name: http +# protocol: TCP +# port: 8004 +# targetPort: 8004 +# nodePort: 30801 +# - name: grafana +# protocol: TCP +# port: 3000 +# targetPort: 3000 +# nodePort: 30301 diff --git a/src/tests/oeccpsc22/expose-services-dom2.yaml b/src/tests/oeccpsc22/expose-services-dom2.yaml new file mode 100644 index 000000000..cf04f3f5e --- /dev/null +++ b/src/tests/oeccpsc22/expose-services-dom2.yaml @@ -0,0 +1,106 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +apiVersion: v1 +kind: Service +metadata: + name: remote-teraflow +spec: + type: ExternalName + externalName: interdomainservice.dom1.svc.cluster.local + ports: + - name: grpc + protocol: TCP + port: 10010 +#--- +#apiVersion: v1 +#kind: Service +#metadata: +# name: contextservice-public +# labels: +# app: contextservice +#spec: +# type: NodePort +# selector: +# app: contextservice +# ports: +# - name: grpc +# protocol: TCP +# port: 1010 +# targetPort: 1010 +# nodePort: 30112 +# - name: rest +# protocol: TCP +# port: 8080 +# targetPort: 8080 +# nodePort: 30002 +# - name: redis +# protocol: TCP +# port: 6379 +# targetPort: 6379 +# nodePort: 30632 +#--- +#apiVersion: v1 +#kind: Service +#metadata: +# name: deviceservice-public +# labels: +# app: deviceservice +#spec: +# type: NodePort +# selector: +# app: deviceservice +# ports: +# - name: grpc +# protocol: TCP +# port: 2020 +# targetPort: 2020 +# nodePort: 30222 +#--- +#apiVersion: v1 +#kind: Service +#metadata: +# name: computeservice-public +#spec: +# type: NodePort +# selector: +# app: computeservice +# ports: +# - name: http +# protocol: TCP +# port: 8080 +# targetPort: 8080 +# nodePort: 30882 +#--- +#apiVersion: v1 +#kind: Service +#metadata: +# name: webuiservice-public +# labels: +# app: webuiservice +#spec: +# type: NodePort +# selector: +# app: webuiservice +# ports: +# - name: http +# protocol: TCP +# port: 8004 +# targetPort: 8004 +# nodePort: 30802 +# - name: grafana +# protocol: TCP +# port: 3000 +# targetPort: 3000 +# nodePort: 30302 diff --git a/src/tests/oeccpsc22/expose_services_teraflow_1.yaml b/src/tests/oeccpsc22/expose_services_teraflow_1.yaml deleted file mode 100644 index d956db1a7..000000000 --- a/src/tests/oeccpsc22/expose_services_teraflow_1.yaml +++ /dev/null @@ -1,106 +0,0 @@ -# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) -# -# 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. - -apiVersion: v1 -kind: Service -metadata: - name: remote-teraflow -spec: - type: ExternalName - externalName: interdomainservice.oeccpsc22-2.svc.cluster.local - ports: - - name: grpc - protocol: TCP - port: 10010 ---- -apiVersion: v1 -kind: Service -metadata: - name: contextservice-public - labels: - app: contextservice -spec: - type: NodePort - selector: - app: contextservice - ports: - - name: grpc - protocol: TCP - port: 1010 - targetPort: 1010 - nodePort: 30111 - - name: rest - protocol: TCP - port: 8080 - targetPort: 8080 - nodePort: 30001 - - name: redis - protocol: TCP - port: 6379 - targetPort: 6379 - nodePort: 30631 ---- -apiVersion: v1 -kind: Service -metadata: - name: deviceservice-public - labels: - app: deviceservice -spec: - type: NodePort - selector: - app: deviceservice - ports: - - name: grpc - protocol: TCP - port: 2020 - targetPort: 2020 - nodePort: 30221 ---- -apiVersion: v1 -kind: Service -metadata: - name: computeservice-public -spec: - type: NodePort - selector: - app: computeservice - ports: - - name: http - protocol: TCP - port: 8080 - targetPort: 8080 - nodePort: 30881 ---- -apiVersion: v1 -kind: Service -metadata: - name: webuiservice-public - labels: - app: webuiservice -spec: - type: NodePort - selector: - app: webuiservice - ports: - - name: http - protocol: TCP - port: 8004 - targetPort: 8004 - nodePort: 30801 - - name: grafana - protocol: TCP - port: 3000 - targetPort: 3000 - nodePort: 30301 diff --git a/src/tests/oeccpsc22/expose_services_teraflow_2.yaml b/src/tests/oeccpsc22/expose_services_teraflow_2.yaml deleted file mode 100644 index d8acb9653..000000000 --- a/src/tests/oeccpsc22/expose_services_teraflow_2.yaml +++ /dev/null @@ -1,106 +0,0 @@ -# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) -# -# 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. - -apiVersion: v1 -kind: Service -metadata: - name: remote-teraflow -spec: - type: ExternalName - externalName: interdomainservice.oeccpsc22-1.svc.cluster.local - ports: - - name: grpc - protocol: TCP - port: 10010 ---- -apiVersion: v1 -kind: Service -metadata: - name: contextservice-public - labels: - app: contextservice -spec: - type: NodePort - selector: - app: contextservice - ports: - - name: grpc - protocol: TCP - port: 1010 - targetPort: 1010 - nodePort: 30112 - - name: rest - protocol: TCP - port: 8080 - targetPort: 8080 - nodePort: 30002 - - name: redis - protocol: TCP - port: 6379 - targetPort: 6379 - nodePort: 30632 ---- -apiVersion: v1 -kind: Service -metadata: - name: deviceservice-public - labels: - app: deviceservice -spec: - type: NodePort - selector: - app: deviceservice - ports: - - name: grpc - protocol: TCP - port: 2020 - targetPort: 2020 - nodePort: 30222 ---- -apiVersion: v1 -kind: Service -metadata: - name: computeservice-public -spec: - type: NodePort - selector: - app: computeservice - ports: - - name: http - protocol: TCP - port: 8080 - targetPort: 8080 - nodePort: 30882 ---- -apiVersion: v1 -kind: Service -metadata: - name: webuiservice-public - labels: - app: webuiservice -spec: - type: NodePort - selector: - app: webuiservice - ports: - - name: http - protocol: TCP - port: 8004 - targetPort: 8004 - nodePort: 30802 - - name: grafana - protocol: TCP - port: 3000 - targetPort: 3000 - nodePort: 30302 diff --git a/src/tests/oeccpsc22/fast_redeploy.sh b/src/tests/oeccpsc22/fast_redeploy.sh new file mode 100755 index 000000000..f4e909eef --- /dev/null +++ b/src/tests/oeccpsc22/fast_redeploy.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + + +kubectl delete namespace tfs-dom1 tfs-dom2 + +echo "Deploying tfs-dom1 ..." +kubectl delete -f oeccpsc22/nginx-ingress-controller-dom1.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl create namespace tfs-dom1 > ./tmp/logs/deploy-tfs-dom1.log +kubectl apply -f oeccpsc22/nginx-ingress-controller-dom1.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/contextservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/deviceservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/pathcompservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/serviceservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/sliceservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f ./tmp/manifests/webuiservice.yaml > ./tmp/logs/deploy-tfs-dom1.log +kubectl --namespace tfs-dom1 apply -f oeccpsc22/tfs-ingress-dom1.yaml > ./tmp/logs/deploy-tfs-dom1.log +printf "\n" + +echo "Deploying tfs-dom2 ..." +kubectl delete -f oeccpsc22/nginx-ingress-controller-dom2.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl create namespace tfs-dom2 > ./tmp/logs/deploy-tfs-dom2.log +kubectl apply -f oeccpsc22/nginx-ingress-controller-dom2.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/contextservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/deviceservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/pathcompservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/serviceservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/sliceservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f ./tmp/manifests/webuiservice.yaml > ./tmp/logs/deploy-tfs-dom2.log +kubectl --namespace tfs-dom2 apply -f oeccpsc22/tfs-ingress-dom2.yaml > ./tmp/logs/deploy-tfs-dom2.log +printf "\n" + +echo "Waiting tfs-dom1 ..." +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/contextservice +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/deviceservice +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/pathcompservice +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/serviceservice +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/sliceservice +kubectl wait --namespace tfs-dom1 --for='condition=available' --timeout=300s deployment/webuiservice +printf "\n" + +echo "Waiting tfs-dom2 ..." +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/contextservice +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/deviceservice +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/pathcompservice +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/serviceservice +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/sliceservice +kubectl wait --namespace tfs-dom2 --for='condition=available' --timeout=300s deployment/webuiservice +printf "\n" + +echo "Done!" diff --git a/src/tests/oeccpsc22/nginx-ingress-controller-dom1.yaml b/src/tests/oeccpsc22/nginx-ingress-controller-dom1.yaml new file mode 100644 index 000000000..1815bfbaa --- /dev/null +++ b/src/tests/oeccpsc22/nginx-ingress-controller-dom1.yaml @@ -0,0 +1,134 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-load-balancer-microk8s-conf-dom1 + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-udp-microk8s-conf-dom1 + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-tcp-microk8s-conf-dom1 + namespace: ingress +--- +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + name: tfs-ingress-class-dom1 + annotations: + ingressclass.kubernetes.io/is-default-class: "false" +spec: + controller: tfs.etsi.org/controller-class-dom1 +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: nginx-ingress-microk8s-controller-dom1 + namespace: ingress + labels: + microk8s-application: nginx-ingress-microk8s-dom1 +spec: + selector: + matchLabels: + name: nginx-ingress-microk8s-dom1 + updateStrategy: + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + name: nginx-ingress-microk8s-dom1 + spec: + terminationGracePeriodSeconds: 60 + restartPolicy: Always + serviceAccountName: nginx-ingress-microk8s-serviceaccount + containers: + - image: k8s.gcr.io/ingress-nginx/controller:v1.2.0 + imagePullPolicy: IfNotPresent + name: nginx-ingress-microk8s + livenessProbe: + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + timeoutSeconds: 5 + lifecycle: + preStop: + exec: + command: + - /wait-shutdown + securityContext: + capabilities: + add: + - NET_BIND_SERVICE + drop: + - ALL + runAsUser: 101 # www-data + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + ports: + - name: http + containerPort: 80 + hostPort: 8001 + protocol: TCP + - name: https + containerPort: 443 + hostPort: 4431 + protocol: TCP + - name: health + containerPort: 10254 + hostPort: 12541 + protocol: TCP + args: + - /nginx-ingress-controller + - --configmap=$(POD_NAMESPACE)/nginx-load-balancer-microk8s-conf-dom1 + - --tcp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-tcp-microk8s-conf-dom1 + - --udp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-udp-microk8s-conf-dom1 + - --election-id=ingress-controller-leader-dom1 + - --controller-class=tfs.etsi.org/controller-class-dom1 + - --ingress-class=tfs-ingress-class-dom1 + - ' ' + - --publish-status-address=127.0.0.1 diff --git a/src/tests/oeccpsc22/nginx-ingress-controller-dom2.yaml b/src/tests/oeccpsc22/nginx-ingress-controller-dom2.yaml new file mode 100644 index 000000000..dede03285 --- /dev/null +++ b/src/tests/oeccpsc22/nginx-ingress-controller-dom2.yaml @@ -0,0 +1,134 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-load-balancer-microk8s-conf-dom2 + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-udp-microk8s-conf-dom2 + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-tcp-microk8s-conf-dom2 + namespace: ingress +--- +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + name: tfs-ingress-class-dom2 + annotations: + ingressclass.kubernetes.io/is-default-class: "false" +spec: + controller: tfs.etsi.org/controller-class-dom2 +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: nginx-ingress-microk8s-controller-dom2 + namespace: ingress + labels: + microk8s-application: nginx-ingress-microk8s-dom2 +spec: + selector: + matchLabels: + name: nginx-ingress-microk8s-dom2 + updateStrategy: + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + name: nginx-ingress-microk8s-dom2 + spec: + terminationGracePeriodSeconds: 60 + restartPolicy: Always + serviceAccountName: nginx-ingress-microk8s-serviceaccount + containers: + - image: k8s.gcr.io/ingress-nginx/controller:v1.2.0 + imagePullPolicy: IfNotPresent + name: nginx-ingress-microk8s + livenessProbe: + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /healthz + port: 10254 + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + timeoutSeconds: 5 + lifecycle: + preStop: + exec: + command: + - /wait-shutdown + securityContext: + capabilities: + add: + - NET_BIND_SERVICE + drop: + - ALL + runAsUser: 101 # www-data + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + ports: + - name: http + containerPort: 80 + hostPort: 8002 + protocol: TCP + - name: https + containerPort: 443 + hostPort: 4432 + protocol: TCP + - name: health + containerPort: 10254 + hostPort: 12542 + protocol: TCP + args: + - /nginx-ingress-controller + - --configmap=$(POD_NAMESPACE)/nginx-load-balancer-microk8s-conf-dom2 + - --tcp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-tcp-microk8s-conf-dom2 + - --udp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-udp-microk8s-conf-dom2 + - --election-id=ingress-controller-leader-dom2 + - --controller-class=tfs.etsi.org/controller-class-dom2 + - --ingress-class=tfs-ingress-class-dom2 + - ' ' + - --publish-status-address=127.0.0.1 diff --git a/src/tests/oeccpsc22/nginx-ingress-http-dom1.yaml b/src/tests/oeccpsc22/nginx-ingress-http-dom1.yaml new file mode 100644 index 000000000..b03699946 --- /dev/null +++ b/src/tests/oeccpsc22/nginx-ingress-http-dom1.yaml @@ -0,0 +1,46 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: tfs-ingress-dom1 + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 +spec: + ingressClassName: tfs-ingress-class-dom1 + rules: + - http: + paths: + - path: /webui(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 8004 + - path: /grafana(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 3000 + - path: /()(restconf/.*) + pathType: Prefix + backend: + service: + name: computeservice + port: + number: 8080 diff --git a/src/tests/oeccpsc22/nginx-ingress-http-dom2.yaml b/src/tests/oeccpsc22/nginx-ingress-http-dom2.yaml new file mode 100644 index 000000000..d07b73ee2 --- /dev/null +++ b/src/tests/oeccpsc22/nginx-ingress-http-dom2.yaml @@ -0,0 +1,53 @@ +# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# +# 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. + +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: tfs-ingress-dom2 + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 +spec: + ingressClassName: tfs-ingress-class-dom2 + rules: + - http: + paths: + - path: /webui(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 8004 + - path: /grafana(/|$)(.*) + pathType: Prefix + backend: + service: + name: webuiservice + port: + number: 3000 + - path: /context(/|$)(.*) + pathType: Prefix + backend: + service: + name: contextservice + port: + number: 8080 + - path: /()(restconf/.*) + pathType: Prefix + backend: + service: + name: computeservice + port: + number: 8080 diff --git a/src/tests/oeccpsc22/deploy_in_kubernetes.sh b/src/tests/oeccpsc22/old/deploy_in_kubernetes.sh similarity index 100% rename from src/tests/oeccpsc22/deploy_in_kubernetes.sh rename to src/tests/oeccpsc22/old/deploy_in_kubernetes.sh diff --git a/src/tests/oeccpsc22/show_deploy.sh b/src/tests/oeccpsc22/show_deploy.sh index d5e9346e5..77a8b8781 100755 --- a/src/tests/oeccpsc22/show_deploy.sh +++ b/src/tests/oeccpsc22/show_deploy.sh @@ -13,14 +13,31 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Deploy TeraFlow instance 1 -printf "TeraFlow Instance 1:\n--------------------\n" -export K8S_NAMESPACE="oeccpsc22-1" -kubectl --namespace $K8S_NAMESPACE get all + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +# Deploy TeraFlow Domain 1 +printf "TeraFlow Domain 1:\n--------------------\n" + +echo "Deployment Resources:" +kubectl --namespace tfs-dom1 get all +printf "\n" + +echo "Deployment Ingress:" +kubectl --namespace tfs-dom1 get ingress +printf "\n" printf "\n\n" -# Deploy TeraFlow instance 2 -printf "TeraFlow Instance 2:\n--------------------\n" -export K8S_NAMESPACE="oeccpsc22-2" -kubectl --namespace $K8S_NAMESPACE get all +# Deploy TeraFlow Domain 2 +printf "TeraFlow Domain 2:\n--------------------\n" + +echo "Deployment Resources:" +kubectl --namespace tfs-dom2 get all +printf "\n" + +echo "Deployment Ingress:" +kubectl --namespace tfs-dom2 get ingress +printf "\n" -- GitLab From c2208b4db89c4ac9521227642cafe8f3d1759e9f Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 12 May 2023 14:16:29 +0000 Subject: [PATCH 03/20] Manifests: - Updated manifest files --- manifests/interdomainservice.yaml | 2 +- manifests/serviceservice.yaml | 2 +- manifests/sliceservice.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/interdomainservice.yaml b/manifests/interdomainservice.yaml index 79acf96de..40b4a5b6f 100644 --- a/manifests/interdomainservice.yaml +++ b/manifests/interdomainservice.yaml @@ -44,7 +44,7 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:10010"] resources: requests: - cpu: 50m + cpu: 100m memory: 64Mi limits: cpu: 500m diff --git a/manifests/serviceservice.yaml b/manifests/serviceservice.yaml index 7d7bdaa4e..a982de0ba 100644 --- a/manifests/serviceservice.yaml +++ b/manifests/serviceservice.yaml @@ -45,7 +45,7 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:3030"] resources: requests: - cpu: 250m + cpu: 100m memory: 128Mi limits: cpu: 1000m diff --git a/manifests/sliceservice.yaml b/manifests/sliceservice.yaml index e7e5c1604..9a26b2591 100644 --- a/manifests/sliceservice.yaml +++ b/manifests/sliceservice.yaml @@ -50,7 +50,7 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:4040"] resources: requests: - cpu: 250m + cpu: 100m memory: 128Mi limits: cpu: 1000m -- GitLab From 58b564ab70f64ebbb8f1306e834c99f7cd9c4c27 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 12 May 2023 14:16:55 +0000 Subject: [PATCH 04/20] Service component: - Updated wait loop time --- src/service/service/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service/service/__main__.py b/src/service/service/__main__.py index d755348ad..f2b6e38d6 100644 --- a/src/service/service/__main__.py +++ b/src/service/service/__main__.py @@ -62,7 +62,7 @@ def main(): grpc_service.start() # Wait for Ctrl+C or termination signal - while not terminate.wait(timeout=0.1): pass + while not terminate.wait(timeout=1.0): pass LOGGER.info('Terminating...') grpc_service.stop() -- GitLab From c2b030497ba5840a4fc3ae1926fc451ca89e9a27 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 12 May 2023 14:17:16 +0000 Subject: [PATCH 05/20] OECC/PSC'22 test: - Updated deploy specs --- src/tests/oeccpsc22/deploy_specs_dom1.sh | 4 ++-- src/tests/oeccpsc22/deploy_specs_dom2.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/oeccpsc22/deploy_specs_dom1.sh b/src/tests/oeccpsc22/deploy_specs_dom1.sh index 8bf7aaeb7..d9df93f52 100755 --- a/src/tests/oeccpsc22/deploy_specs_dom1.sh +++ b/src/tests/oeccpsc22/deploy_specs_dom1.sh @@ -20,8 +20,8 @@ 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 pathcomp service slice compute webui" +#export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui interdomain load_generator" +export TFS_COMPONENTS="context device pathcomp service slice interdomain webui" # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" diff --git a/src/tests/oeccpsc22/deploy_specs_dom2.sh b/src/tests/oeccpsc22/deploy_specs_dom2.sh index 41c382409..2c1ceb411 100755 --- a/src/tests/oeccpsc22/deploy_specs_dom2.sh +++ b/src/tests/oeccpsc22/deploy_specs_dom2.sh @@ -20,8 +20,8 @@ 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 pathcomp service slice compute webui" +#export TFS_COMPONENTS="context device automation monitoring pathcomp service slice compute webui interdomain load_generator" +export TFS_COMPONENTS="context device pathcomp service slice interdomain webui" # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" -- GitLab From 7259afed423184fbee620ee4cb934cf8cead0578 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Thu, 25 May 2023 17:21:38 +0000 Subject: [PATCH 06/20] Deploy scripts: - Added namespace as sub-folder for manifests and logs in all scripts - Added missing folder creation command in qdb --- deploy/crdb.sh | 2 +- deploy/qdb.sh | 3 ++- deploy/tfs.sh | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/deploy/crdb.sh b/deploy/crdb.sh index 414de523d..5d87adf60 100755 --- a/deploy/crdb.sh +++ b/deploy/crdb.sh @@ -70,7 +70,7 @@ TMP_FOLDER="./tmp" CRDB_MANIFESTS_PATH="manifests/cockroachdb" # Create a tmp folder for files modified during the deployment -TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +TMP_MANIFESTS_FOLDER="${TMP_FOLDER}/${CRDB_NAMESPACE}/manifests" mkdir -p $TMP_MANIFESTS_FOLDER function crdb_deploy_single() { diff --git a/deploy/qdb.sh b/deploy/qdb.sh index cba8a5c00..9e631cf25 100755 --- a/deploy/qdb.sh +++ b/deploy/qdb.sh @@ -64,7 +64,8 @@ TMP_FOLDER="./tmp" QDB_MANIFESTS_PATH="manifests/questdb" # Create a tmp folder for files modified during the deployment -TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +TMP_MANIFESTS_FOLDER="${TMP_FOLDER}/${QDB_NAMESPACE}/manifests" +mkdir -p $TMP_MANIFESTS_FOLDER function qdb_deploy() { echo "QuestDB Namespace" diff --git a/deploy/tfs.sh b/deploy/tfs.sh index 019fcfa9e..af7832685 100755 --- a/deploy/tfs.sh +++ b/deploy/tfs.sh @@ -124,9 +124,9 @@ GITLAB_REPO_URL="labs.etsi.org:5050/tfs/controller" TMP_FOLDER="./tmp" # Create a tmp folder for files modified during the deployment -TMP_MANIFESTS_FOLDER="$TMP_FOLDER/manifests" +TMP_MANIFESTS_FOLDER="${TMP_FOLDER}/${TFS_K8S_NAMESPACE}/manifests" mkdir -p $TMP_MANIFESTS_FOLDER -TMP_LOGS_FOLDER="$TMP_FOLDER/logs" +TMP_LOGS_FOLDER="${TMP_FOLDER}/${TFS_K8S_NAMESPACE}/logs" mkdir -p $TMP_LOGS_FOLDER echo "Deleting and Creating a new namespace..." -- GitLab From ec29378b6d2fe82aba645d867d9fdcabd08f5147 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Thu, 25 May 2023 17:22:04 +0000 Subject: [PATCH 07/20] Common - Message Broker - NATS: - Corrected URL format --- src/common/message_broker/backend/nats/NatsBackend.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/message_broker/backend/nats/NatsBackend.py b/src/common/message_broker/backend/nats/NatsBackend.py index 35de3acb3..bcbf2a721 100644 --- a/src/common/message_broker/backend/nats/NatsBackend.py +++ b/src/common/message_broker/backend/nats/NatsBackend.py @@ -19,8 +19,8 @@ from common.message_broker.Message import Message from .._Backend import _Backend from .NatsBackendThread import NatsBackendThread -NATS_URI_TEMPLATE_AUTH = 'nats://{:s}:{:s}@nats.{:s}.svc.cluster.local:{:s}' -NATS_URI_TEMPLATE_NOAUTH = 'nats://nats.{:s}.svc.cluster.local:{:s}' +NATS_URI_TEMPLATE_AUTH = 'nats://{:s}:{:s}@{:s}.{:s}.svc.cluster.local:{:s}' +NATS_URI_TEMPLATE_NOAUTH = 'nats://{:s}.{:s}.svc.cluster.local:{:s}' class NatsBackend(_Backend): def __init__(self, **settings) -> None: # pylint: disable=super-init-not-called @@ -32,10 +32,10 @@ class NatsBackend(_Backend): nats_password = get_setting('NATS_PASSWORD', settings=settings, default=None) if nats_username is None or nats_password is None: nats_uri = NATS_URI_TEMPLATE_NOAUTH.format( - nats_namespace, nats_client_port) + nats_namespace, nats_namespace, nats_client_port) else: nats_uri = NATS_URI_TEMPLATE_AUTH.format( - nats_username, nats_password, nats_namespace, nats_client_port) + nats_username, nats_password, nats_namespace, nats_namespace, nats_client_port) self._terminate = threading.Event() self._nats_backend_thread = NatsBackendThread(nats_uri) -- GitLab From e13b8eddb6db4ba6cec84604eeb79771133dcebb Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Thu, 25 May 2023 17:22:35 +0000 Subject: [PATCH 08/20] Common - Tools - Descriptor Loader: - Removed update context/topology as it is not needed --- src/common/tools/descriptor/Loader.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/common/tools/descriptor/Loader.py b/src/common/tools/descriptor/Loader.py index 1e238510c..916a73d30 100644 --- a/src/common/tools/descriptor/Loader.py +++ b/src/common/tools/descriptor/Loader.py @@ -85,6 +85,7 @@ class DescriptorLoader: service_client : Optional[ServiceClient] = None, slice_client : Optional[SliceClient] = None ) -> None: if (descriptors is None) == (descriptors_file is None): + # pylint: disable=broad-exception-raised raise Exception('Exactly one of "descriptors" or "descriptors_file" is required') if descriptors_file is not None: @@ -238,8 +239,13 @@ class DescriptorLoader: self._process_descr('service', 'add', self.__ctx_cli.SetService, Service, self.__services ) self._process_descr('slice', 'add', self.__ctx_cli.SetSlice, Slice, self.__slices ) self._process_descr('connection', 'add', self.__ctx_cli.SetConnection, Connection, self.__connections ) - self._process_descr('context', 'update', self.__ctx_cli.SetContext, Context, self.__contexts ) - self._process_descr('topology', 'update', self.__ctx_cli.SetTopology, Topology, self.__topologies ) + + # Update context and topology is useless: + # - devices and links are assigned to topologies automatically by Context component + # - topologies, services, and slices are assigned to contexts automatically by Context component + #self._process_descr('context', 'update', self.__ctx_cli.SetContext, Context, self.__contexts ) + #self._process_descr('topology', 'update', self.__ctx_cli.SetTopology, Topology, self.__topologies ) + #self.__ctx_cli.close() def _load_normal_mode(self) -> None: @@ -265,8 +271,12 @@ class DescriptorLoader: self._process_descr('service', 'update', self.__svc_cli.UpdateService, Service, self.__services ) self._process_descr('slice', 'add', self.__slc_cli.CreateSlice, Slice, self.__slices_add ) self._process_descr('slice', 'update', self.__slc_cli.UpdateSlice, Slice, self.__slices ) - self._process_descr('context', 'update', self.__ctx_cli.SetContext, Context, self.__contexts ) - self._process_descr('topology', 'update', self.__ctx_cli.SetTopology, Topology, self.__topologies ) + + # Update context and topology is useless: + # - devices and links are assigned to topologies automatically by Context component + # - topologies, services, and slices are assigned to contexts automatically by Context component + #self._process_descr('context', 'update', self.__ctx_cli.SetContext, Context, self.__contexts ) + #self._process_descr('topology', 'update', self.__ctx_cli.SetTopology, Topology, self.__topologies ) #self.__slc_cli.close() #self.__svc_cli.close() -- GitLab From 764c3d283106da03ca753c4afc3cdb58ba5ee974 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Thu, 25 May 2023 17:22:56 +0000 Subject: [PATCH 09/20] Common - Type Checkers: - Minor Type Hint corrections --- src/common/type_checkers/Checkers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/type_checkers/Checkers.py b/src/common/type_checkers/Checkers.py index 085ba572c..e61bd3ccd 100644 --- a/src/common/type_checkers/Checkers.py +++ b/src/common/type_checkers/Checkers.py @@ -30,7 +30,7 @@ def chk_attribute(name : str, container : Dict, container_name : str, **kwargs): if 'default' in kwargs: return kwargs['default'] raise AttributeError('Missing object({:s}) in container({:s})'.format(str(name), str(container_name))) -def chk_type(name : str, value : Any, type_or_types : Union[type, Set[type]] = set()) -> Any: +def chk_type(name : str, value : Any, type_or_types : Union[type, Set[type], Tuple[type]] = set()) -> Any: if isinstance(value, type_or_types): return value msg = '{}({}) is of a wrong type({}). Accepted type_or_types({}).' raise TypeError(msg.format(str(name), str(value), type(value).__name__, str(type_or_types))) -- GitLab From 24a4f276ff10ccee9279daaced18de34145a43b5 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Thu, 25 May 2023 17:23:26 +0000 Subject: [PATCH 10/20] Common - Settings: - Added helper method to find missing environment variables in microservices --- src/common/Settings.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/common/Settings.py b/src/common/Settings.py index ea161e555..1efe80db7 100644 --- a/src/common/Settings.py +++ b/src/common/Settings.py @@ -37,16 +37,25 @@ ENVVAR_SUFIX_SERVICE_HOST = 'SERVICE_HOST' ENVVAR_SUFIX_SERVICE_PORT_GRPC = 'SERVICE_PORT_GRPC' ENVVAR_SUFIX_SERVICE_PORT_HTTP = 'SERVICE_PORT_HTTP' +def find_missing_environment_variables( + required_environment_variables : List[str] = [] +) -> List[str]: + if ENVVAR_KUBERNETES_PORT in os.environ: + missing_variables = set(required_environment_variables).difference(set(os.environ.keys())) + else: + # We're not running in Kubernetes, nothing to wait for + missing_variables = required_environment_variables + return missing_variables + def wait_for_environment_variables( required_environment_variables : List[str] = [], wait_delay_seconds : float = DEFAULT_RESTART_DELAY ): - if ENVVAR_KUBERNETES_PORT not in os.environ: return # We're not running in Kubernetes, nothing to wait for - missing_variables = set(required_environment_variables).difference(set(os.environ.keys())) + missing_variables = find_missing_environment_variables(required_environment_variables) if len(missing_variables) == 0: return # We have all environment variables defined msg = 'Variables({:s}) are missing in Environment({:s}), restarting in {:f} seconds...' LOGGER.error(msg.format(str(missing_variables), str(os.environ), wait_delay_seconds)) time.sleep(wait_delay_seconds) - raise Exception('Restarting...') + raise Exception('Restarting...') # pylint: disable=broad-exception-raised def get_setting(name, **kwargs): value = os.environ.get(name) @@ -54,6 +63,7 @@ def get_setting(name, **kwargs): value = kwargs['settings'].pop(name, value) if value is not None: return value if 'default' in kwargs: return kwargs['default'] + # pylint: disable=broad-exception-raised raise Exception('Setting({:s}) not specified in environment or configuration'.format(str(name))) def get_env_var_name(service_name : ServiceNameEnum, env_var_group): -- GitLab From c4eca8da38222c2811ecb6dc5c37a69aa0494e7c Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Thu, 25 May 2023 17:24:04 +0000 Subject: [PATCH 11/20] Context component: - Updated link_set to add the link to admin/admin context/topology by default --- src/context/service/database/Link.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/context/service/database/Link.py b/src/context/service/database/Link.py index f5bfc9dea..76db07a9e 100644 --- a/src/context/service/database/Link.py +++ b/src/context/service/database/Link.py @@ -18,9 +18,10 @@ from sqlalchemy.engine import Engine from sqlalchemy.orm import Session, selectinload, sessionmaker from sqlalchemy_cockroachdb import run_transaction from typing import Dict, List, Optional, Set, Tuple -from common.proto.context_pb2 import Link, LinkId +from common.proto.context_pb2 import Link, LinkId, TopologyId from common.method_wrappers.ServiceExceptions import NotFoundException from common.tools.object_factory.Link import json_link_id +from context.service.database.uuids.Topology import topology_get_uuid from .models.LinkModel import LinkModel, LinkEndPointModel from .models.TopologyModel import TopologyLinkModel from .uuids.EndPoint import endpoint_get_uuid @@ -67,6 +68,15 @@ def link_set(db_engine : Engine, request : Link) -> Tuple[Dict, bool]: topology_uuids : Set[str] = set() related_topologies : List[Dict] = list() + + # By default, always add link to default Context/Topology + _,topology_uuid = topology_get_uuid(TopologyId(), allow_random=False, allow_default=True) + related_topologies.append({ + 'topology_uuid': topology_uuid, + 'link_uuid' : link_uuid, + }) + topology_uuids.add(topology_uuid) + link_endpoints_data : List[Dict] = list() for i,endpoint_id in enumerate(request.link_endpoint_ids): endpoint_topology_uuid, _, endpoint_uuid = endpoint_get_uuid( -- GitLab From b9287d37cca952d5dd366e0602e7b4d1c21186f7 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Thu, 25 May 2023 17:25:47 +0000 Subject: [PATCH 12/20] Device Component: - Added support for emulated devices to inform the context/topology their endpoints belong to. - Enhanced Emulated Driver EndPoint compositor --- src/device/service/Tools.py | 13 ++- src/device/service/drivers/emulated/Tools.py | 90 ++++++++++++++------ 2 files changed, 74 insertions(+), 29 deletions(-) diff --git a/src/device/service/Tools.py b/src/device/service/Tools.py index 6a62a75e7..8717254cb 100644 --- a/src/device/service/Tools.py +++ b/src/device/service/Tools.py @@ -174,7 +174,6 @@ def populate_endpoints( elif resource_key.startswith('/endpoints/endpoint'): endpoint_uuid = resource_value['uuid'] _device_uuid = resource_value.get('device_uuid') - endpoint_name = resource_value.get('name') if _device_uuid is None: # add endpoint to current device @@ -185,11 +184,17 @@ def populate_endpoints( device_endpoint = new_sub_devices[_device_uuid].device_endpoints.add() device_endpoint.endpoint_id.device_id.device_uuid.uuid = _device_uuid - device_endpoint.endpoint_id.topology_id.context_id.context_uuid.uuid = DEFAULT_CONTEXT_NAME - device_endpoint.endpoint_id.topology_id.topology_uuid.uuid = DEFAULT_TOPOLOGY_NAME - device_endpoint.endpoint_id.endpoint_uuid.uuid = endpoint_uuid + + endpoint_context_uuid = resource_value.get('context_uuid', DEFAULT_CONTEXT_NAME) + device_endpoint.endpoint_id.topology_id.context_id.context_uuid.uuid = endpoint_context_uuid + + endpoint_topology_uuid = resource_value.get('topology_uuid', DEFAULT_TOPOLOGY_NAME) + device_endpoint.endpoint_id.topology_id.topology_uuid.uuid = endpoint_topology_uuid + + endpoint_name = resource_value.get('name') if endpoint_name is not None: device_endpoint.name = endpoint_name + device_endpoint.endpoint_type = resource_value.get('type', '-') sample_types : Dict[int, str] = resource_value.get('sample_types', {}) diff --git a/src/device/service/drivers/emulated/Tools.py b/src/device/service/drivers/emulated/Tools.py index 4770cc6e6..0ac92bf56 100644 --- a/src/device/service/drivers/emulated/Tools.py +++ b/src/device/service/drivers/emulated/Tools.py @@ -13,34 +13,74 @@ # limitations under the License. import logging -from typing import Any, Dict, Tuple +from typing import Any, Dict, Optional, Tuple from common.proto.kpi_sample_types_pb2 import KpiSampleType +from common.type_checkers.Checkers import chk_attribute, chk_string, chk_type from device.service.driver_api._Driver import RESOURCE_ENDPOINTS from .Constants import SPECIAL_RESOURCE_MAPPINGS LOGGER = logging.getLogger(__name__) -def compose_resource_endpoint(endpoint_data : Dict[str, Any]) -> Tuple[str, Any]: - endpoint_uuid = endpoint_data.get('uuid') - if endpoint_uuid is None: return None - endpoint_resource_path = SPECIAL_RESOURCE_MAPPINGS.get(RESOURCE_ENDPOINTS) - endpoint_resource_key = '{:s}/endpoint[{:s}]'.format(endpoint_resource_path, endpoint_uuid) - - endpoint_type = endpoint_data.get('type') - if endpoint_type is None: return None - - endpoint_sample_types = endpoint_data.get('sample_types') - if endpoint_sample_types is None: return None - - sample_types = {} - for endpoint_sample_type in endpoint_sample_types: - try: - metric_name = KpiSampleType.Name(endpoint_sample_type).lower().replace('kpisampletype_', '') - except: # pylint: disable=bare-except - LOGGER.warning('Unsupported EndPointSampleType({:s})'.format(str(endpoint_sample_type))) - continue - monitoring_resource_key = '{:s}/state/{:s}'.format(endpoint_resource_key, metric_name) - sample_types[endpoint_sample_type] = monitoring_resource_key - - endpoint_resource_value = {'uuid': endpoint_uuid, 'type': endpoint_type, 'sample_types': sample_types} - return endpoint_resource_key, endpoint_resource_value +def process_optional_string_field( + endpoint_data : Dict[str, Any], field_name : str, endpoint_resource_value : Dict[str, Any] +) -> None: + field_value = chk_attribute(field_name, endpoint_data, 'endpoint_data', default=None) + if field_value is None: return + chk_string('endpoint_data.{:s}'.format(field_name), field_value) + if len(field_value) > 0: endpoint_resource_value[field_name] = field_value + +def compose_resource_endpoint(endpoint_data : Dict[str, Any]) -> Optional[Tuple[str, Dict]]: + try: + # Check type of endpoint_data + chk_type('endpoint_data', endpoint_data, dict) + + # Check endpoint UUID (mandatory) + endpoint_uuid = chk_attribute('uuid', endpoint_data, 'endpoint_data') + chk_string('endpoint_data.uuid', endpoint_uuid, min_length=1) + endpoint_resource_path = SPECIAL_RESOURCE_MAPPINGS.get(RESOURCE_ENDPOINTS) + endpoint_resource_key = '{:s}/endpoint[{:s}]'.format(endpoint_resource_path, endpoint_uuid) + endpoint_resource_value = {'uuid': endpoint_uuid} + + # Check endpoint optional string fields + process_optional_string_field(endpoint_data, 'name', endpoint_resource_value) + process_optional_string_field(endpoint_data, 'type', endpoint_resource_value) + process_optional_string_field(endpoint_data, 'context_uuid', endpoint_resource_value) + process_optional_string_field(endpoint_data, 'topology_uuid', endpoint_resource_value) + + # Check endpoint sample types (optional) + endpoint_sample_types = chk_attribute('sample_types', endpoint_data, 'endpoint_data', default=[]) + chk_type('endpoint_data.sample_types', endpoint_sample_types, list) + sample_types = {} + sample_type_errors = [] + for i,endpoint_sample_type in enumerate(endpoint_sample_types): + field_name = 'endpoint_data.sample_types[{:d}]'.format(i) + try: + chk_type(field_name, endpoint_sample_type, (int, str)) + if isinstance(endpoint_sample_type, int): + metric_name = KpiSampleType.Name(endpoint_sample_type) + metric_id = endpoint_sample_type + elif isinstance(endpoint_sample_type, str): + metric_id = KpiSampleType.Value(endpoint_sample_type) + metric_name = endpoint_sample_type + else: + str_type = str(type(endpoint_sample_type)) + raise Exception('Bad format: {:s}'.format(str_type)) # pylint: disable=broad-exception-raised + except Exception as e: # pylint: disable=broad-exception-caught + MSG = 'Unsupported {:s}({:s}) : {:s}' + sample_type_errors.append(MSG.format(field_name, str(endpoint_sample_type), str(e))) + + metric_name = metric_name.lower().replace('kpisampletype_', '') + monitoring_resource_key = '{:s}/state/{:s}'.format(endpoint_resource_key, metric_name) + sample_types[metric_id] = monitoring_resource_key + + if len(sample_type_errors) > 0: + # pylint: disable=broad-exception-raised + raise Exception('Malformed Sample Types:\n{:s}'.format('\n'.join(sample_type_errors))) + + if len(sample_types) > 0: + endpoint_resource_value['sample_types'] = sample_types + + return endpoint_resource_key, endpoint_resource_value + except: # pylint: disable=bare-except + LOGGER.exception('Problem composing endpoint({:s})'.format(str(endpoint_data))) + return None -- GitLab From e6dba8b7bae1fa0a4dbbc3c013930a9d34383a0b Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Thu, 25 May 2023 17:27:51 +0000 Subject: [PATCH 13/20] Service component - L2NM Emulated Service Handler: - Improved parameter gathering --- .../service_handlers/l2nm_emulated/ConfigRules.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/service/service/service_handlers/l2nm_emulated/ConfigRules.py b/src/service/service/service_handlers/l2nm_emulated/ConfigRules.py index ac44574ad..072696324 100644 --- a/src/service/service/service_handlers/l2nm_emulated/ConfigRules.py +++ b/src/service/service/service_handlers/l2nm_emulated/ConfigRules.py @@ -24,7 +24,7 @@ def setup_config_rules( if service_settings is None: return [] if endpoint_settings is None: return [] - #json_settings : Dict = service_settings.value + json_settings : Dict = service_settings.value json_endpoint_settings : Dict = endpoint_settings.value #mtu = json_settings.get('mtu', 1450 ) # 1512 @@ -35,11 +35,14 @@ def setup_config_rules( #router_id = json_endpoint_settings.get('router_id', '0.0.0.0') # '10.95.0.10' #route_distinguisher = json_endpoint_settings.get('route_distinguisher', '0:0' ) # '60001:801' sub_interface_index = json_endpoint_settings.get('sub_interface_index', 0 ) # 1 - vlan_id = json_endpoint_settings.get('vlan_id', 1 ) # 400 + vlan_id = json_endpoint_settings.get('vlan_id', None ) # 400 #address_ip = json_endpoint_settings.get('address_ip', '0.0.0.0') # '2.2.2.1' #address_prefix = json_endpoint_settings.get('address_prefix', 24 ) # 30 remote_router = json_endpoint_settings.get('remote_router', '0.0.0.0') # '5.5.5.5' - circuit_id = json_endpoint_settings.get('circuit_id', '000' ) # '111' + circuit_id = json_endpoint_settings.get('circuit_id', None ) # '111' + + if vlan_id is None: vlan_id = json_settings.get('vlan_id', 1) + if circuit_id is None: circuit_id = json_settings.get('circuit_id', '000') if_cirid_name = '{:s}.{:s}'.format(endpoint_name, str(circuit_id)) network_instance_name = 'ELAN-AC:{:s}'.format(str(circuit_id)) -- GitLab From a50407553f3c492390aace9c62dbb47beaaeaaaf Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Thu, 25 May 2023 17:28:16 +0000 Subject: [PATCH 14/20] OECC/PSC'22 test: - Updated descriptors --- src/tests/oeccpsc22/descriptors/domain1.json | 198 ++++++++++-------- src/tests/oeccpsc22/descriptors/domain2.json | 164 ++++----------- src/tests/oeccpsc22/descriptors/domain3.json | 110 ---------- src/tests/oeccpsc22/descriptors/domain4.json | 101 --------- .../descriptors/inter-domain-service.json | 37 ++-- 5 files changed, 163 insertions(+), 447 deletions(-) delete mode 100644 src/tests/oeccpsc22/descriptors/domain3.json delete mode 100644 src/tests/oeccpsc22/descriptors/domain4.json diff --git a/src/tests/oeccpsc22/descriptors/domain1.json b/src/tests/oeccpsc22/descriptors/domain1.json index 043b3955f..2db10b4d1 100644 --- a/src/tests/oeccpsc22/descriptors/domain1.json +++ b/src/tests/oeccpsc22/descriptors/domain1.json @@ -1,32 +1,10 @@ { "contexts": [ - { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_ids": [ - {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D1"}} - ], "service_ids": [] - } + {"context_id": {"context_uuid": {"uuid": "admin"}}} ], "topologies": [ - { - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D1"}}, - "device_ids": [ - {"device_uuid": {"uuid": "DC1"}}, - {"device_uuid": {"uuid": "R1@D1"}}, - {"device_uuid": {"uuid": "R2@D1"}}, - {"device_uuid": {"uuid": "R3@D1"}}, - {"device_uuid": {"uuid": "R4@D1"}}, - {"device_uuid": {"uuid": "R5@D1"}} - ], "link_ids": [ - {"link_uuid": {"uuid": "DC1/D1==R1@D1/DC1"}}, - {"link_uuid": {"uuid": "R1@D1/2==R2@D1/1"}}, - {"link_uuid": {"uuid": "R2@D1/3==R3@D1/2"}}, - {"link_uuid": {"uuid": "R2@D1/5==R5@D1/2"}}, - {"link_uuid": {"uuid": "R3@D1/4==R4@D1/3"}}, - {"link_uuid": {"uuid": "R4@D1/5==R5@D1/4"}}, - {"link_uuid": {"uuid": "R5@D1/1==R1@D1/5"}} - ] - } + {"topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}}}, + {"topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}} ], "devices": [ { @@ -35,8 +13,30 @@ {"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/border", "uuid": "D1"}, - {"sample_types": [], "type": "copper/internal", "uuid": "int"} + {"uuid": "int", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "D1", "context_uuid": "admin", "topology_uuid": "inter", "type": "copper/border" } + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "DC2"}}, "device_type": "emu-datacenter", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "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": [ + {"uuid": "int", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "D2", "context_uuid": "admin", "topology_uuid": "inter", "type": "copper/border" } + ]}}} + ]} + }, + { + "device_id": {"device_uuid": {"uuid": "D2"}}, "device_type": "network", "device_drivers": [0], + "device_endpoints": [], "device_operational_status": 2, "device_config": {"config_rules": [ + {"action": 1, "custom": {"resource_key": "_connect/address", "resource_value": "10.0.2.10"}}, + {"action": 1, "custom": {"resource_key": "_connect/port", "resource_value": "10010"}}, + {"action": 1, "custom": {"resource_key": "_connect/settings", "resource_value": {"endpoints": [ + {"uuid": "D1", "context_uuid": "admin", "topology_uuid": "inter", "type": "copper/border" }, + {"uuid": "DC2", "context_uuid": "admin", "topology_uuid": "inter", "type": "copper/border" } ]}}} ]} }, @@ -46,9 +46,9 @@ {"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/internal", "uuid": "2"}, - {"sample_types": [], "type": "copper/internal", "uuid": "5"}, - {"sample_types": [], "type": "copper/border", "uuid": "DC1"} + {"uuid": "2", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "5", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "DC1", "context_uuid": "admin", "topology_uuid": "inter", "type": "copper/border" } ]}}} ]} }, @@ -58,9 +58,9 @@ {"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/internal", "uuid": "1"}, - {"sample_types": [], "type": "copper/internal", "uuid": "3"}, - {"sample_types": [], "type": "copper/internal", "uuid": "5"} + {"uuid": "1", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "3", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "5", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"} ]}}} ]} }, @@ -70,8 +70,8 @@ {"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/internal", "uuid": "2"}, - {"sample_types": [], "type": "copper/internal", "uuid": "4"} + {"uuid": "2", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "4", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"} ]}}} ]} }, @@ -81,9 +81,9 @@ {"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/internal", "uuid": "3"}, - {"sample_types": [], "type": "copper/internal", "uuid": "5"}, - {"sample_types": [], "type": "copper/border", "uuid": "D2"} + {"uuid": "3", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "5", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "D2", "context_uuid": "admin", "topology_uuid": "inter", "type": "copper/border" } ]}}} ]} }, @@ -93,56 +93,86 @@ {"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/internal", "uuid": "1"}, - {"sample_types": [], "type": "copper/internal", "uuid": "2"}, - {"sample_types": [], "type": "copper/internal", "uuid": "4"}, - {"sample_types": [], "type": "copper/border", "uuid": "D3"} + {"uuid": "1", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "2", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "4", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"} ]}}} ]} } ], "links": [ - { - "link_id": {"link_uuid": {"uuid": "DC1/D1==R1@D1/DC1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "DC1"}}, "endpoint_uuid": {"uuid": "D1"}}, - {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "DC1"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R1@D1/2==R2@D1/1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "2"}}, - {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "1"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R2@D1/3==R3@D1/2"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "3"}}, - {"device_id": {"device_uuid": {"uuid": "R3@D1"}}, "endpoint_uuid": {"uuid": "2"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R2@D1/5==R5@D1/2"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "5"}}, - {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "2"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R3@D1/4==R4@D1/3"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R3@D1"}}, "endpoint_uuid": {"uuid": "4"}}, - {"device_id": {"device_uuid": {"uuid": "R4@D1"}}, "endpoint_uuid": {"uuid": "3"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R4@D1/5==R5@D1/4"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R4@D1"}}, "endpoint_uuid": {"uuid": "5"}}, - {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "4"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R5@D1/1==R1@D1/5"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "1"}}, - {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "5"}} - ] - } + {"link_id": {"link_uuid": {"uuid": "DC1/D1==R1@D1/DC1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "DC1"}}, "endpoint_uuid": {"uuid": "D1"}, "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}}, + {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "DC1"}, "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R1@D1/DC1==DC1/D1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "DC1"}, "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}}, + {"device_id": {"device_uuid": {"uuid": "DC1"}}, "endpoint_uuid": {"uuid": "D1"}, "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}} + ]}, + {"link_id": {"link_uuid": {"uuid": "DC2/D2==D2/DC2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "DC2"}}, "endpoint_uuid": {"uuid": "D2"}, "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}}, + {"device_id": {"device_uuid": {"uuid": "D2"}}, "endpoint_uuid": {"uuid": "DC2"}, "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}} + ]}, + {"link_id": {"link_uuid": {"uuid": "D2/DC2==DC2/D2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "D2"}}, "endpoint_uuid": {"uuid": "DC2"}, "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}}, + {"device_id": {"device_uuid": {"uuid": "DC2"}}, "endpoint_uuid": {"uuid": "D2"}, "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R4@D1/D2==D2/D1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4@D1"}}, "endpoint_uuid": {"uuid": "D2"}, "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}}, + {"device_id": {"device_uuid": {"uuid": "D2"}}, "endpoint_uuid": {"uuid": "D1"}, "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}} + ]}, + {"link_id": {"link_uuid": {"uuid": "D2/D1==R4@D1/D2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "D2"}}, "endpoint_uuid": {"uuid": "D1"}, "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}}, + {"device_id": {"device_uuid": {"uuid": "R4@D1"}}, "endpoint_uuid": {"uuid": "D2"}, "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}} + ]}, + + {"link_id": {"link_uuid": {"uuid": "R1@D1/2==R2@D1/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "2"}}, + {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "1"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R1@D1/5==R5@D1/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "5"}}, + {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "1"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R2@D1/1==R1@D1/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "1"}}, + {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "2"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R2@D1/3==R3@D1/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D1"}}, "endpoint_uuid": {"uuid": "2"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R2@D1/5==R5@D1/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "5"}}, + {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "2"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R3@D1/2==R2@D1/3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3@D1"}}, "endpoint_uuid": {"uuid": "2"}}, + {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "3"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R3@D1/4==R4@D1/3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3@D1"}}, "endpoint_uuid": {"uuid": "4"}}, + {"device_id": {"device_uuid": {"uuid": "R4@D1"}}, "endpoint_uuid": {"uuid": "3"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R4@D1/3==R3@D1/4"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4@D1"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D1"}}, "endpoint_uuid": {"uuid": "4"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R4@D1/5==R5@D1/4"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R4@D1"}}, "endpoint_uuid": {"uuid": "5"}}, + {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "4"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R5@D1/1==R1@D1/5"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "1"}}, + {"device_id": {"device_uuid": {"uuid": "R1@D1"}}, "endpoint_uuid": {"uuid": "5"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R5@D1/2==R2@D1/5"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "2"}}, + {"device_id": {"device_uuid": {"uuid": "R2@D1"}}, "endpoint_uuid": {"uuid": "5"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R5@D1/4==R4@D1/5"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R5@D1"}}, "endpoint_uuid": {"uuid": "4"}}, + {"device_id": {"device_uuid": {"uuid": "R4@D1"}}, "endpoint_uuid": {"uuid": "5"}} + ]} ] } diff --git a/src/tests/oeccpsc22/descriptors/domain2.json b/src/tests/oeccpsc22/descriptors/domain2.json index 81d397abf..e7a00f74e 100644 --- a/src/tests/oeccpsc22/descriptors/domain2.json +++ b/src/tests/oeccpsc22/descriptors/domain2.json @@ -1,34 +1,10 @@ { "contexts": [ - { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_ids": [ - {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D2"}} - ], "service_ids": [] - } + {"context_id": {"context_uuid": {"uuid": "admin"}}} ], "topologies": [ - { - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D2"}}, - "device_ids": [ - {"device_uuid": {"uuid": "R1@D2"}}, - {"device_uuid": {"uuid": "R2@D2"}}, - {"device_uuid": {"uuid": "R3@D2"}}, - {"device_uuid": {"uuid": "R4@D2"}}, - {"device_uuid": {"uuid": "R5@D2"}}, - {"device_uuid": {"uuid": "R6@D2"}} - ], "link_ids": [ - {"link_uuid": {"uuid": "R1@D2/2==R2@D2/1"}}, - {"link_uuid": {"uuid": "R1@D2/6==R6@D2/1"}}, - {"link_uuid": {"uuid": "R1@D2/5==R5@D2/1"}}, - {"link_uuid": {"uuid": "R2@D2/3==R3@D2/2"}}, - {"link_uuid": {"uuid": "R2@D2/4==R4@D2/2"}}, - {"link_uuid": {"uuid": "R2@D2/5==R5@D2/2"}}, - {"link_uuid": {"uuid": "R2@D2/6==R6@D2/2"}}, - {"link_uuid": {"uuid": "R3@D2/6==R6@D2/3"}}, - {"link_uuid": {"uuid": "R4@D2/5==R5@D2/4"}} - ] - } + {"topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "admin"}}}, + {"topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "inter"}}} ], "devices": [ { @@ -37,10 +13,8 @@ {"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/internal", "uuid": "2"}, - {"sample_types": [], "type": "copper/internal", "uuid": "5"}, - {"sample_types": [], "type": "copper/internal", "uuid": "6"}, - {"sample_types": [], "type": "copper/border", "uuid": "D1"} + {"uuid": "2", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "3", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"} ]}}} ]} }, @@ -50,11 +24,9 @@ {"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/internal", "uuid": "1"}, - {"sample_types": [], "type": "copper/internal", "uuid": "3"}, - {"sample_types": [], "type": "copper/internal", "uuid": "4"}, - {"sample_types": [], "type": "copper/internal", "uuid": "5"}, - {"sample_types": [], "type": "copper/internal", "uuid": "6"} + {"uuid": "1", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "3", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "D1", "context_uuid": "admin", "topology_uuid": "inter", "type": "copper/border" } ]}}} ]} }, @@ -64,103 +36,37 @@ {"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/internal", "uuid": "2"}, - {"sample_types": [], "type": "copper/internal", "uuid": "6"} - ]}}} - ]} - }, - { - "device_id": {"device_uuid": {"uuid": "R4@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], - "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "2"}, - {"sample_types": [], "type": "copper/internal", "uuid": "5"}, - {"sample_types": [], "type": "copper/border", "uuid": "D4"} - ]}}} - ]} - }, - { - "device_id": {"device_uuid": {"uuid": "R5@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], - "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, - {"sample_types": [], "type": "copper/internal", "uuid": "2"}, - {"sample_types": [], "type": "copper/internal", "uuid": "4"}, - {"sample_types": [], "type": "copper/border", "uuid": "D3"} - ]}}} - ]} - }, - { - "device_id": {"device_uuid": {"uuid": "R6@D2"}}, "device_type": "emu-packet-router", "device_drivers": [0], - "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, - {"sample_types": [], "type": "copper/internal", "uuid": "2"}, - {"sample_types": [], "type": "copper/internal", "uuid": "3"} + {"uuid": "1", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "2", "context_uuid": "admin", "topology_uuid": "admin", "type": "copper/internal"}, + {"uuid": "DC2", "context_uuid": "admin", "topology_uuid": "inter", "type": "copper/border" } ]}}} ]} } ], "links": [ - { - "link_id": {"link_uuid": {"uuid": "R1@D2/2==R2@D2/1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R1@D2"}}, "endpoint_uuid": {"uuid": "2"}}, - {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "1"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R1@D2/6==R6@D2/1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R1@D2"}}, "endpoint_uuid": {"uuid": "6"}}, - {"device_id": {"device_uuid": {"uuid": "R6@D2"}}, "endpoint_uuid": {"uuid": "1"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R1@D2/5==R5@D2/1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R1@D2"}}, "endpoint_uuid": {"uuid": "5"}}, - {"device_id": {"device_uuid": {"uuid": "R5@D2"}}, "endpoint_uuid": {"uuid": "1"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R2@D2/3==R3@D2/2"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "3"}}, - {"device_id": {"device_uuid": {"uuid": "R3@D2"}}, "endpoint_uuid": {"uuid": "2"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R2@D2/4==R4@D2/2"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "4"}}, - {"device_id": {"device_uuid": {"uuid": "R4@D2"}}, "endpoint_uuid": {"uuid": "2"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R2@D2/5==R5@D2/2"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "5"}}, - {"device_id": {"device_uuid": {"uuid": "R5@D2"}}, "endpoint_uuid": {"uuid": "2"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R2@D2/6==R6@D2/2"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "6"}}, - {"device_id": {"device_uuid": {"uuid": "R6@D2"}}, "endpoint_uuid": {"uuid": "2"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R3@D2/6==R6@D2/3"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R3@D2"}}, "endpoint_uuid": {"uuid": "6"}}, - {"device_id": {"device_uuid": {"uuid": "R6@D2"}}, "endpoint_uuid": {"uuid": "3"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R4@D2/5==R5@D2/4"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R4@D2"}}, "endpoint_uuid": {"uuid": "5"}}, - {"device_id": {"device_uuid": {"uuid": "R5@D2"}}, "endpoint_uuid": {"uuid": "4"}} - ] - } + {"link_id": {"link_uuid": {"uuid": "R1@D2/2==R2@D2/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D2"}}, "endpoint_uuid": {"uuid": "2"}}, + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "1"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R1@D2/3==R3@D2/1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R1@D2"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D2"}}, "endpoint_uuid": {"uuid": "1"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R2@D2/1==R1@D2/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "1"}}, + {"device_id": {"device_uuid": {"uuid": "R1@D2"}}, "endpoint_uuid": {"uuid": "2"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R2@D2/3==R3@D2/2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "3"}}, + {"device_id": {"device_uuid": {"uuid": "R3@D2"}}, "endpoint_uuid": {"uuid": "2"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R3@D2/1==R1@D2/3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3@D2"}}, "endpoint_uuid": {"uuid": "1"}}, + {"device_id": {"device_uuid": {"uuid": "R1@D2"}}, "endpoint_uuid": {"uuid": "3"}} + ]}, + {"link_id": {"link_uuid": {"uuid": "R3@D2/2==R2@D2/3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "R3@D2"}}, "endpoint_uuid": {"uuid": "2"}}, + {"device_id": {"device_uuid": {"uuid": "R2@D2"}}, "endpoint_uuid": {"uuid": "3"}} + ]} ] } diff --git a/src/tests/oeccpsc22/descriptors/domain3.json b/src/tests/oeccpsc22/descriptors/domain3.json deleted file mode 100644 index 3a8e47d30..000000000 --- a/src/tests/oeccpsc22/descriptors/domain3.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "contexts": [ - { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_ids": [ - {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D3"}} - ], "service_ids": [] - } - ], - "topologies": [ - { - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D3"}}, - "device_ids": [ - {"device_uuid": {"uuid": "R1@D3"}}, - {"device_uuid": {"uuid": "R2@D3"}}, - {"device_uuid": {"uuid": "R3@D3"}}, - {"device_uuid": {"uuid": "R4@D3"}} - ], "link_ids": [ - {"link_uuid": {"uuid": "R1@D3/2==R2@D3/1"}}, - {"link_uuid": {"uuid": "R2@D3/3==R3@D3/2"}}, - {"link_uuid": {"uuid": "R3@D3/4==R4@D3/3"}}, - {"link_uuid": {"uuid": "R4@D3/1==R1@D3/4"}}, - {"link_uuid": {"uuid": "R2@D3/4==R4@D3/2"}} - ] - } - ], - "devices": [ - { - "device_id": {"device_uuid": {"uuid": "R1@D3"}}, "device_type": "emu-packet-router", "device_drivers": [0], - "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "2"}, - {"sample_types": [], "type": "copper/internal", "uuid": "4"}, - {"sample_types": [], "type": "copper/border", "uuid": "D1"} - ]}}} - ]} - }, - { - "device_id": {"device_uuid": {"uuid": "R2@D3"}}, "device_type": "emu-packet-router", "device_drivers": [0], - "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, - {"sample_types": [], "type": "copper/internal", "uuid": "3"}, - {"sample_types": [], "type": "copper/internal", "uuid": "4"}, - {"sample_types": [], "type": "copper/border", "uuid": "D2"} - ]}}} - ]} - }, - { - "device_id": {"device_uuid": {"uuid": "R3@D3"}}, "device_type": "emu-packet-router", "device_drivers": [0], - "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "2"}, - {"sample_types": [], "type": "copper/internal", "uuid": "4"}, - {"sample_types": [], "type": "copper/border", "uuid": "D4"} - ]}}} - ]} - }, - { - "device_id": {"device_uuid": {"uuid": "R4@D3"}}, "device_type": "emu-packet-router", "device_drivers": [0], - "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, - {"sample_types": [], "type": "copper/internal", "uuid": "2"}, - {"sample_types": [], "type": "copper/internal", "uuid": "3"} - ]}}} - ]} - } - ], - "links": [ - { - "link_id": {"link_uuid": {"uuid": "R1@D3/2==R2@D3/1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R1@D3"}}, "endpoint_uuid": {"uuid": "2"}}, - {"device_id": {"device_uuid": {"uuid": "R2@D3"}}, "endpoint_uuid": {"uuid": "1"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R2@D3/3==R3@D3/2"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R2@D3"}}, "endpoint_uuid": {"uuid": "3"}}, - {"device_id": {"device_uuid": {"uuid": "R3@D3"}}, "endpoint_uuid": {"uuid": "2"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R3@D3/4==R4@D3/3"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R3@D3"}}, "endpoint_uuid": {"uuid": "4"}}, - {"device_id": {"device_uuid": {"uuid": "R4@D3"}}, "endpoint_uuid": {"uuid": "3"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R4@D3/1==R1@D3/4"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R4@D3"}}, "endpoint_uuid": {"uuid": "1"}}, - {"device_id": {"device_uuid": {"uuid": "R1@D3"}}, "endpoint_uuid": {"uuid": "4"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R2@D3/4==R4@D3/2"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R2@D3"}}, "endpoint_uuid": {"uuid": "4"}}, - {"device_id": {"device_uuid": {"uuid": "R4@D3"}}, "endpoint_uuid": {"uuid": "2"}} - ] - } - ] -} diff --git a/src/tests/oeccpsc22/descriptors/domain4.json b/src/tests/oeccpsc22/descriptors/domain4.json deleted file mode 100644 index d9e2d049a..000000000 --- a/src/tests/oeccpsc22/descriptors/domain4.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "contexts": [ - { - "context_id": {"context_uuid": {"uuid": "admin"}}, - "topology_ids": [ - {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D4"}} - ], "service_ids": [] - } - ], - "topologies": [ - { - "topology_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "topology_uuid": {"uuid": "D4"}}, - "device_ids": [ - {"device_uuid": {"uuid": "DC2"}}, - {"device_uuid": {"uuid": "R1@D4"}}, - {"device_uuid": {"uuid": "R2@D4"}}, - {"device_uuid": {"uuid": "R3@D4"}} - ], "link_ids": [ - {"link_uuid": {"uuid": "R3@D4/DC2==DC2/D4"}}, - {"link_uuid": {"uuid": "R1@D4/2==R2@D4/1"}}, - {"link_uuid": {"uuid": "R1@D4/3==R3@D4/1"}}, - {"link_uuid": {"uuid": "R2@D4/3==R3@D4/2"}} - ] - } - ], - "devices": [ - { - "device_id": {"device_uuid": {"uuid": "DC2"}}, "device_type": "emu-datacenter", "device_drivers": [0], - "device_endpoints": [], "device_operational_status": 2, "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/border", "uuid": "D4"}, - {"sample_types": [], "type": "copper/internal", "uuid": "int"} - ]}}} - ]} - }, - { - "device_id": {"device_uuid": {"uuid": "R1@D4"}}, "device_type": "emu-packet-router", "device_drivers": [0], - "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "2"}, - {"sample_types": [], "type": "copper/internal", "uuid": "3"}, - {"sample_types": [], "type": "copper/border", "uuid": "D3"} - ]}}} - ]} - }, - { - "device_id": {"device_uuid": {"uuid": "R2@D4"}}, "device_type": "emu-packet-router", "device_drivers": [0], - "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, - {"sample_types": [], "type": "copper/internal", "uuid": "3"}, - {"sample_types": [], "type": "copper/border", "uuid": "D2"} - ]}}} - ]} - }, - { - "device_id": {"device_uuid": {"uuid": "R3@D4"}}, "device_type": "emu-packet-router", "device_drivers": [0], - "device_endpoints": [], "device_operational_status": 2, "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/internal", "uuid": "1"}, - {"sample_types": [], "type": "copper/internal", "uuid": "2"}, - {"sample_types": [], "type": "copper/border", "uuid": "DC2"} - ]}}} - ]} - } - ], - "links": [ - { - "link_id": {"link_uuid": {"uuid": "R3@D4/DC2==DC2/D4"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "DC2"}}, "endpoint_uuid": {"uuid": "D4"}}, - {"device_id": {"device_uuid": {"uuid": "R3@D4"}}, "endpoint_uuid": {"uuid": "DC2"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R1@D4/2==R2@D4/1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R1@D4"}}, "endpoint_uuid": {"uuid": "2"}}, - {"device_id": {"device_uuid": {"uuid": "R2@D4"}}, "endpoint_uuid": {"uuid": "1"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R1@D4/3==R3@D4/1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R1@D4"}}, "endpoint_uuid": {"uuid": "3"}}, - {"device_id": {"device_uuid": {"uuid": "R3@D4"}}, "endpoint_uuid": {"uuid": "1"}} - ] - }, - { - "link_id": {"link_uuid": {"uuid": "R2@D4/3==R3@D4/2"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "R2@D4"}}, "endpoint_uuid": {"uuid": "3"}}, - {"device_id": {"device_uuid": {"uuid": "R3@D4"}}, "endpoint_uuid": {"uuid": "2"}} - ] - } - ] -} diff --git a/src/tests/oeccpsc22/descriptors/inter-domain-service.json b/src/tests/oeccpsc22/descriptors/inter-domain-service.json index 40a1f0101..4b53c433a 100644 --- a/src/tests/oeccpsc22/descriptors/inter-domain-service.json +++ b/src/tests/oeccpsc22/descriptors/inter-domain-service.json @@ -1,9 +1,7 @@ { "services": [ { - "service_id": { - "context_id": {"context_uuid": {"uuid": "admin"}}, "service_uuid": {"uuid": "inter-dom-svc"} - }, + "service_id": {"context_id": {"context_uuid": {"uuid": "admin"}}, "service_uuid": {"uuid": "idc-l2-svc"}}, "service_type": 2, "service_status": {"service_status": 1}, "service_endpoint_ids": [ @@ -15,26 +13,19 @@ {"sla_latency": {"e2e_latency_ms": 15.2}} ], "service_config": {"config_rules": [ - {"action": 1, "custom": {"resource_key": "/settings", "resource_value": { - "address_families": ["IPV4"], "bgp_as": 65000, "bgp_route_target": "65000:123", - "mtu": 1512, "vlan_id": 300 - }}}, - {"action": 1, "custom": {"resource_key": "/device[PE1]/endpoint[1/1]/settings", "resource_value": { - "route_distinguisher": "65000:123", "router_id": "10.0.0.1", - "address_ip": "3.3.1.1", "address_prefix": 24, "sub_interface_index": 1, "vlan_id": 300 - }}}, - {"action": 1, "custom": {"resource_key": "/device[PE2]/endpoint[1/1]/settings", "resource_value": { - "route_distinguisher": "65000:123", "router_id": "10.0.0.2", - "address_ip": "3.3.2.1", "address_prefix": 24, "sub_interface_index": 1, "vlan_id": 300 - }}}, - {"action": 1, "custom": {"resource_key": "/device[PE3]/endpoint[1/1]/settings", "resource_value": { - "route_distinguisher": "65000:123", "router_id": "10.0.0.3", - "address_ip": "3.3.3.1", "address_prefix": 24, "sub_interface_index": 1, "vlan_id": 300 - }}}, - {"action": 1, "custom": {"resource_key": "/device[PE4]/endpoint[1/1]/settings", "resource_value": { - "route_distinguisher": "65000:123", "router_id": "10.0.0.4", - "address_ip": "3.3.4.1", "address_prefix": 24, "sub_interface_index": 1, "vlan_id": 300 - }}} + {"action": 1, "custom": {"resource_key": "/settings", "resource_value": {"mtu": 1512, "vlan_id": 300}}}, + {"action": 1, "custom": {"resource_key": "/device[R1@D1]/endpoint[2]/settings", "resource_value": {"remote_router": "10.0.0.2"}}}, + {"action": 1, "custom": {"resource_key": "/device[R1@D1]/endpoint[5]/settings", "resource_value": {"remote_router": "10.0.0.5"}}}, + {"action": 1, "custom": {"resource_key": "/device[R2@D1]/endpoint[1]/settings", "resource_value": {"remote_router": "10.0.0.1"}}}, + {"action": 1, "custom": {"resource_key": "/device[R2@D1]/endpoint[3]/settings", "resource_value": {"remote_router": "10.0.0.3"}}}, + {"action": 1, "custom": {"resource_key": "/device[R2@D1]/endpoint[5]/settings", "resource_value": {"remote_router": "10.0.0.5"}}}, + {"action": 1, "custom": {"resource_key": "/device[R3@D1]/endpoint[2]/settings", "resource_value": {"remote_router": "10.0.0.2"}}}, + {"action": 1, "custom": {"resource_key": "/device[R3@D1]/endpoint[4]/settings", "resource_value": {"remote_router": "10.0.0.4"}}}, + {"action": 1, "custom": {"resource_key": "/device[R4@D1]/endpoint[3]/settings", "resource_value": {"remote_router": "10.0.0.3"}}}, + {"action": 1, "custom": {"resource_key": "/device[R4@D1]/endpoint[5]/settings", "resource_value": {"remote_router": "10.0.0.5"}}}, + {"action": 1, "custom": {"resource_key": "/device[R5@D1]/endpoint[1]/settings", "resource_value": {"remote_router": "10.0.0.1"}}}, + {"action": 1, "custom": {"resource_key": "/device[R5@D1]/endpoint[2]/settings", "resource_value": {"remote_router": "10.0.0.2"}}}, + {"action": 1, "custom": {"resource_key": "/device[R5@D1]/endpoint[4]/settings", "resource_value": {"remote_router": "10.0.0.4"}}} ]} } ] -- GitLab From e310be8b09be2a97dddcbbfbe281ba3997e5b15b Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Thu, 25 May 2023 17:31:34 +0000 Subject: [PATCH 15/20] WebUI component: - Corrected copyright footer --- src/webui/service/templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webui/service/templates/base.html b/src/webui/service/templates/base.html index 4c31b6193..e75461885 100644 --- a/src/webui/service/templates/base.html +++ b/src/webui/service/templates/base.html @@ -149,7 +149,7 @@
-

© 2021-2023

+

© 2022-2023 ETSI TeraFlowSDN (TFS) OSG

-- GitLab From 1fcc9f27c376f280975ad2b7349cd7a63c7b2625 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Thu, 25 May 2023 17:33:47 +0000 Subject: [PATCH 16/20] Interdomain component: - Made optional dependency on DLT - Moved old code to separate file - Implemented auto-detection of remote domains based on NETWORK-type devices onboarded to Context --- .../service/InterdomainServiceServicerImpl.py | 24 +++-- .../service/RemoteDomainClients.py | 95 +++++++++++++++---- src/interdomain/service/__main__.py | 8 +- .../service/_old_code/add_peer_manually.txt | 3 + .../topology_abstractor/DltRecordSender.py | 8 +- .../topology_abstractor/TopologyAbstractor.py | 20 +++- 6 files changed, 119 insertions(+), 39 deletions(-) create mode 100644 src/interdomain/service/_old_code/add_peer_manually.txt diff --git a/src/interdomain/service/InterdomainServiceServicerImpl.py b/src/interdomain/service/InterdomainServiceServicerImpl.py index b72fc1b31..51c8ee39a 100644 --- a/src/interdomain/service/InterdomainServiceServicerImpl.py +++ b/src/interdomain/service/InterdomainServiceServicerImpl.py @@ -13,7 +13,8 @@ # limitations under the License. import grpc, logging, uuid -from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME, ServiceNameEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, find_missing_environment_variables, get_env_var_name from common.proto.context_pb2 import AuthenticationResult, Slice, SliceId, SliceStatusEnum, TeraFlowController, TopologyId from common.proto.interdomain_pb2_grpc import InterdomainServiceServicer from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method @@ -35,8 +36,6 @@ LOGGER = logging.getLogger(__name__) METRICS_POOL = MetricsPool('Interdomain', 'RPC') -USE_DLT = True - class InterdomainServiceServicerImpl(InterdomainServiceServicer): def __init__(self, remote_domain_clients : RemoteDomainClients): LOGGER.debug('Creating Servicer...') @@ -48,7 +47,6 @@ class InterdomainServiceServicerImpl(InterdomainServiceServicer): context_client = ContextClient() pathcomp_client = PathCompClient() slice_client = SliceClient() - dlt_connector_client = DltConnectorClient() local_device_uuids = get_local_device_uuids(context_client) slice_owner_uuid = request.slice_owner.owner_uuid.uuid @@ -87,6 +85,17 @@ class InterdomainServiceServicerImpl(InterdomainServiceServicer): reply = Slice() reply.CopyFrom(request) + missing_env_vars = find_missing_environment_variables([ + get_env_var_name(ServiceNameEnum.DLT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.DLT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + if len(missing_env_vars) == 0: + # DLT available + dlt_connector_client = DltConnectorClient() + dlt_connector_client.connect() + else: + dlt_connector_client = None + dlt_record_sender = DltRecordSender(context_client, dlt_connector_client) for domain_uuid, is_local_domain, endpoint_ids in traversed_domains: @@ -119,7 +128,7 @@ class InterdomainServiceServicerImpl(InterdomainServiceServicer): LOGGER.info('[loop] [remote] sub_slice={:s}'.format(grpc_message_to_json_string(sub_slice))) sub_slice_id = context_client.SetSlice(sub_slice) - if USE_DLT: + if dlt_connector_client is not None: topology_id = TopologyId(**json_topology_id(domain_uuid)) dlt_record_sender.add_slice(topology_id, sub_slice) else: @@ -137,8 +146,9 @@ class InterdomainServiceServicerImpl(InterdomainServiceServicer): LOGGER.info('[loop] adding sub-slice') reply.slice_subslice_ids.add().CopyFrom(sub_slice_id) # pylint: disable=no-member - LOGGER.info('Recording Remote Slice requests to DLT') - dlt_record_sender.commit() + if dlt_connector_client is not None: + LOGGER.info('Recording Remote Slice requests to DLT') + dlt_record_sender.commit() LOGGER.info('Activating interdomain slice') reply.slice_status.slice_status = SliceStatusEnum.SLICESTATUS_ACTIVE # pylint: disable=no-member diff --git a/src/interdomain/service/RemoteDomainClients.py b/src/interdomain/service/RemoteDomainClients.py index 297c9a60d..e28176ef4 100644 --- a/src/interdomain/service/RemoteDomainClients.py +++ b/src/interdomain/service/RemoteDomainClients.py @@ -12,44 +12,101 @@ # See the License for the specific language governing permissions and # limitations under the License. -import logging, socket +import logging, threading +from typing import Optional, Tuple from common.Constants import DEFAULT_CONTEXT_NAME, ServiceNameEnum +from common.DeviceTypes import DeviceTypeEnum from common.Settings import get_service_host, get_service_port_grpc +from common.proto.context_pb2 import ConfigActionEnum, DeviceEvent from common.proto.context_pb2 import TeraFlowController +from common.tools.context_queries.Device import get_device +from common.tools.grpc.Tools import grpc_message_to_json_string +from context.client.ContextClient import ContextClient +from context.client.EventsCollector import EventsCollector from interdomain.client.InterdomainClient import InterdomainClient LOGGER = logging.getLogger(__name__) -class RemoteDomainClients: +def get_domain_data(context_client : ContextClient, event : DeviceEvent) -> Optional[Tuple[str, str, int]]: + device_uuid = event.device_id.device_uuid.uuid + device = get_device( + context_client, device_uuid, include_endpoints=False, + include_components=False, include_config_rules=True) + if device.device_type != DeviceTypeEnum.NETWORK.value: return None + idc_domain_name = device.name + idc_domain_address = None + idc_domain_port = None + for config_rule in device.device_config.config_rules: + if config_rule.action != ConfigActionEnum.CONFIGACTION_SET: continue + if config_rule.WhichOneof('config_rule') != 'custom': continue + if config_rule.custom.resource_key == '_connect/address': + idc_domain_address = config_rule.custom.resource_value + if config_rule.custom.resource_key == '_connect/port': + idc_domain_port = int(config_rule.custom.resource_value) + if idc_domain_address is None: return None + if idc_domain_port is None: return None + return idc_domain_name, idc_domain_address, idc_domain_port + +class RemoteDomainClients(threading.Thread): def __init__(self) -> None: - self.peer_domain = {} + super().__init__(daemon=True) + self.terminate = threading.Event() + self.lock = threading.Lock() + self.peer_domains = {} + self.context_client = ContextClient() + self.context_event_collector = EventsCollector(self.context_client) - def add_peer( - self, domain_name : str, host : str, port : int, context_uuid : str = DEFAULT_CONTEXT_NAME - ) -> None: - while True: + def stop(self): + self.terminate.set() + + def run(self) -> None: + self.context_client.connect() + self.context_event_collector.start() + + while not self.terminate.is_set(): + event = self.context_event_collector.get_event(timeout=0.1) + if event is None: continue + if not isinstance(event, DeviceEvent): continue + LOGGER.info('Processing Event({:s})...'.format(grpc_message_to_json_string(event))) + domain_data = get_domain_data(self.context_client, event) + domain_name, domain_address, domain_port = domain_data try: - remote_teraflow_ip = socket.gethostbyname(host) - if len(remote_teraflow_ip) > 0: break - except socket.gaierror as e: - if str(e) == '[Errno -2] Name or service not known': continue + self.add_peer(domain_name, domain_address, domain_port) + except: # pylint: disable=bare-except + MSG = 'Unable to connect to remote domain {:s} ({:s}:{:d})' + LOGGER.exception(MSG.format(domain_name, domain_address, domain_port)) - interdomain_client = InterdomainClient(host=host, port=port) + self.context_event_collector.stop() + self.context_client.close() + + def add_peer( + self, domain_name : str, domain_address : str, domain_port : int, context_uuid : str = DEFAULT_CONTEXT_NAME + ) -> None: request = TeraFlowController() - request.context_id.context_uuid.uuid = DEFAULT_CONTEXT_NAME # pylint: disable=no-member + request.context_id.context_uuid.uuid = context_uuid # pylint: disable=no-member request.ip_address = get_service_host(ServiceNameEnum.INTERDOMAIN) request.port = int(get_service_port_grpc(ServiceNameEnum.INTERDOMAIN)) + interdomain_client = InterdomainClient(host=domain_address, port=domain_port) + interdomain_client.connect() + reply = interdomain_client.Authenticate(request) + if not reply.authenticated: - msg = 'Authentication against {:s}:{:d} rejected' - raise Exception(msg.format(str(remote_teraflow_ip), port)) + MSG = 'Authentication against {:s}:{:d} with Context({:s}) rejected' + # pylint: disable=broad-exception-raised + raise Exception(MSG.format(domain_address, domain_port, domain_name)) - self.peer_domain[domain_name] = interdomain_client + with self.lock: + self.peer_domains[domain_name] = interdomain_client + LOGGER.info('Added peer domain {:s} ({:s}:{:d})'.format(domain_name, domain_address, domain_port)) def get_peer(self, domain_name : str) -> InterdomainClient: - LOGGER.warning('peers: {:s}'.format(str(self.peer_domain))) - return self.peer_domain.get(domain_name) + with self.lock: + LOGGER.warning('peers: {:s}'.format(str(self.peer_domains))) + return self.peer_domains.get(domain_name) def remove_peer(self, domain_name : str) -> None: - return self.peer_domain.pop(domain_name, None) + with self.lock: + self.peer_domains.pop(domain_name, None) + LOGGER.info('Removed peer domain {:s}'.format(domain_name)) diff --git a/src/interdomain/service/__main__.py b/src/interdomain/service/__main__.py index 73fa93539..f867dc378 100644 --- a/src/interdomain/service/__main__.py +++ b/src/interdomain/service/__main__.py @@ -43,8 +43,6 @@ def main(): get_env_var_name(ServiceNameEnum.PATHCOMP, ENVVAR_SUFIX_SERVICE_PORT_GRPC), get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_HOST ), get_env_var_name(ServiceNameEnum.SLICE, ENVVAR_SUFIX_SERVICE_PORT_GRPC), - get_env_var_name(ServiceNameEnum.DLT, ENVVAR_SUFIX_SERVICE_HOST ), - get_env_var_name(ServiceNameEnum.DLT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), ]) signal.signal(signal.SIGINT, signal_handler) @@ -58,6 +56,7 @@ def main(): # Define remote domain clients remote_domain_clients = RemoteDomainClients() + remote_domain_clients.start() # Starting Interdomain service grpc_service = InterdomainService(remote_domain_clients) @@ -67,16 +66,13 @@ def main(): topology_abstractor = TopologyAbstractor() topology_abstractor.start() - # TODO: improve with configuration the definition of the remote peers - #interdomain_service_port_grpc = get_service_port_grpc(ServiceNameEnum.INTERDOMAIN) - #remote_domain_clients.add_peer('remote-teraflow', 'remote-teraflow', interdomain_service_port_grpc) - # Wait for Ctrl+C or termination signal while not terminate.wait(timeout=1.0): pass LOGGER.info('Terminating...') topology_abstractor.stop() grpc_service.stop() + remote_domain_clients.stop() LOGGER.info('Bye') return 0 diff --git a/src/interdomain/service/_old_code/add_peer_manually.txt b/src/interdomain/service/_old_code/add_peer_manually.txt new file mode 100644 index 000000000..6582044b3 --- /dev/null +++ b/src/interdomain/service/_old_code/add_peer_manually.txt @@ -0,0 +1,3 @@ +# TODO: improve with configuration the definition of the remote peers +#interdomain_service_port_grpc = get_service_port_grpc(ServiceNameEnum.INTERDOMAIN) +#remote_domain_clients.add_peer('remote-teraflow', 'remote-teraflow', interdomain_service_port_grpc) diff --git a/src/interdomain/service/topology_abstractor/DltRecordSender.py b/src/interdomain/service/topology_abstractor/DltRecordSender.py index d6efbc809..c9a61ef69 100644 --- a/src/interdomain/service/topology_abstractor/DltRecordSender.py +++ b/src/interdomain/service/topology_abstractor/DltRecordSender.py @@ -13,7 +13,7 @@ # limitations under the License. import logging -from typing import Dict, List, Tuple +from typing import Dict, List, Optional, Tuple from common.proto.context_pb2 import Device, Link, Service, Slice, TopologyId from common.proto.dlt_connector_pb2 import DltDeviceId, DltLinkId, DltServiceId, DltSliceId from context.client.ContextClient import ContextClient @@ -23,7 +23,7 @@ from .Types import DltRecordTypes LOGGER = logging.getLogger(__name__) class DltRecordSender: - def __init__(self, context_client : ContextClient, dlt_connector_client : DltConnectorClient) -> None: + def __init__(self, context_client : ContextClient, dlt_connector_client : Optional[DltConnectorClient]) -> None: self.context_client = context_client self.dlt_connector_client = dlt_connector_client self.dlt_record_uuids : List[str] = list() @@ -65,24 +65,28 @@ class DltRecordSender: topology_id,dlt_record = self.dlt_record_uuid_to_data[dlt_record_uuid] if isinstance(dlt_record, Device): device_id = self.context_client.SetDevice(dlt_record) + if self.dlt_connector_client is None: continue dlt_device_id = DltDeviceId() dlt_device_id.topology_id.CopyFrom(topology_id) # pylint: disable=no-member dlt_device_id.device_id.CopyFrom(device_id) # pylint: disable=no-member self.dlt_connector_client.RecordDevice(dlt_device_id) elif isinstance(dlt_record, Link): link_id = self.context_client.SetLink(dlt_record) + if self.dlt_connector_client is None: continue dlt_link_id = DltLinkId() dlt_link_id.topology_id.CopyFrom(topology_id) # pylint: disable=no-member dlt_link_id.link_id.CopyFrom(link_id) # pylint: disable=no-member self.dlt_connector_client.RecordLink(dlt_link_id) elif isinstance(dlt_record, Service): service_id = self.context_client.SetService(dlt_record) + if self.dlt_connector_client is None: continue dlt_service_id = DltServiceId() dlt_service_id.topology_id.CopyFrom(topology_id) # pylint: disable=no-member dlt_service_id.service_id.CopyFrom(service_id) # pylint: disable=no-member self.dlt_connector_client.RecordService(dlt_service_id) elif isinstance(dlt_record, Slice): slice_id = self.context_client.SetSlice(dlt_record) + if self.dlt_connector_client is None: continue dlt_slice_id = DltSliceId() dlt_slice_id.topology_id.CopyFrom(topology_id) # pylint: disable=no-member dlt_slice_id.slice_id.CopyFrom(slice_id) # pylint: disable=no-member diff --git a/src/interdomain/service/topology_abstractor/TopologyAbstractor.py b/src/interdomain/service/topology_abstractor/TopologyAbstractor.py index bdbf016f8..20b186f30 100644 --- a/src/interdomain/service/topology_abstractor/TopologyAbstractor.py +++ b/src/interdomain/service/topology_abstractor/TopologyAbstractor.py @@ -14,8 +14,9 @@ import logging, threading from typing import Dict, Optional, Tuple -from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME, INTERDOMAIN_TOPOLOGY_NAME +from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME, INTERDOMAIN_TOPOLOGY_NAME, ServiceNameEnum from common.DeviceTypes import DeviceTypeEnum +from common.Settings import ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, find_missing_environment_variables, get_env_var_name from common.proto.context_pb2 import ( ContextEvent, ContextId, Device, DeviceEvent, DeviceId, EndPoint, EndPointId, Link, LinkEvent, TopologyId, TopologyEvent) @@ -48,7 +49,6 @@ class TopologyAbstractor(threading.Thread): self.terminate = threading.Event() self.context_client = ContextClient() - self.dlt_connector_client = DltConnectorClient() self.context_event_collector = EventsCollector(self.context_client) self.real_to_abstract_device_uuid : Dict[str, str] = dict() @@ -69,7 +69,6 @@ class TopologyAbstractor(threading.Thread): topology_uuids = [DEFAULT_TOPOLOGY_NAME, INTERDOMAIN_TOPOLOGY_NAME] create_missing_topologies(self.context_client, ADMIN_CONTEXT_ID, topology_uuids) - self.dlt_connector_client.connect() self.context_event_collector.start() while not self.terminate.is_set(): @@ -81,7 +80,6 @@ class TopologyAbstractor(threading.Thread): self.context_event_collector.stop() self.context_client.close() - self.dlt_connector_client.close() #def ignore_event(self, event : EventTypes) -> List[DltRecordIdTypes]: # # TODO: filter events resulting from abstraction computation @@ -226,7 +224,18 @@ class TopologyAbstractor(threading.Thread): if changed: dlt_record_sender.add_link(INTERDOMAIN_TOPOLOGY_ID, abstract_link.link) def update_abstraction(self, event : EventTypes) -> None: - dlt_record_sender = DltRecordSender(self.context_client, self.dlt_connector_client) + missing_env_vars = find_missing_environment_variables([ + get_env_var_name(ServiceNameEnum.DLT, ENVVAR_SUFIX_SERVICE_HOST ), + get_env_var_name(ServiceNameEnum.DLT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), + ]) + if len(missing_env_vars) == 0: + # DLT available + dlt_connector_client = DltConnectorClient() + dlt_connector_client.connect() + else: + dlt_connector_client = None + + dlt_record_sender = DltRecordSender(self.context_client, dlt_connector_client) if isinstance(event, ContextEvent): LOGGER.warning('Ignoring Event({:s})'.format(grpc_message_to_json_string(event))) @@ -286,3 +295,4 @@ class TopologyAbstractor(threading.Thread): LOGGER.warning('Unsupported Event({:s})'.format(grpc_message_to_json_string(event))) dlt_record_sender.commit() + dlt_connector_client.close() -- GitLab From 3bbbf9b69a361be9a4609156012f2efbac1fee47 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 26 May 2023 08:04:04 +0000 Subject: [PATCH 17/20] Load Generator component: - Updated VLAN Ids --- src/load_generator/load_gen/RequestGenerator.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/load_generator/load_gen/RequestGenerator.py b/src/load_generator/load_gen/RequestGenerator.py index fdd400a21..149c2568b 100644 --- a/src/load_generator/load_gen/RequestGenerator.py +++ b/src/load_generator/load_gen/RequestGenerator.py @@ -256,8 +256,8 @@ class RequestGenerator: json_constraint_sla_latency(e2e_latency_ms), ] - vlan_id = num_request % 1000 - circuit_id = '{:03d}'.format(vlan_id + 100) + vlan_id = 300 + num_request % 1000 + circuit_id = '{:03d}'.format(vlan_id) src_device_name = self._device_data[src_device_uuid]['name'] src_endpoint_name = self._device_endpoint_data[src_device_uuid][src_endpoint_uuid]['name'] @@ -307,7 +307,7 @@ class RequestGenerator: bgp_as = 65000 + (num_request % 10000) - vlan_id = num_request % 100 +100 + vlan_id = 300 + num_request % 1000 x = num_request % 255 y = num_request % 25 * num_request % 10 route_distinguisher = '{:5d}:{:03d}'.format(bgp_as, vlan_id) @@ -427,7 +427,7 @@ class RequestGenerator: ] if request_type == RequestType.SLICE_L2NM: - vlan_id = num_request % 1000 + vlan_id = 300 + num_request % 1000 circuit_id = '{:03d}'.format(vlan_id) src_device_name = self._device_data[src_device_uuid]['name'] @@ -459,7 +459,8 @@ class RequestGenerator: ] elif request_type == RequestType.SLICE_L3NM: - vlan_id = num_request % 1000 + vlan_id = 300 + num_request % 1000 + circuit_id = '{:03d}'.format(vlan_id) bgp_as = 60000 + (num_request % 10000) bgp_route_target = '{:5d}:{:03d}'.format(bgp_as, 333) route_distinguisher = '{:5d}:{:03d}'.format(bgp_as, vlan_id) -- GitLab From 24ed3623d60d0f8de56afc2cb463bdbba76d8551 Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 26 May 2023 08:25:32 +0000 Subject: [PATCH 18/20] Minor deploy improvements --- deploy/qdb.sh | 1 + deploy/tfs.sh | 1 + manifests/deviceservice.yaml | 3 +++ 3 files changed, 5 insertions(+) diff --git a/deploy/qdb.sh b/deploy/qdb.sh index 9e631cf25..e930b5a6c 100755 --- a/deploy/qdb.sh +++ b/deploy/qdb.sh @@ -71,6 +71,7 @@ function qdb_deploy() { echo "QuestDB Namespace" echo ">>> Create QuestDB Namespace (if missing)" kubectl create namespace ${QDB_NAMESPACE} + sleep 2 echo echo "QuestDB" diff --git a/deploy/tfs.sh b/deploy/tfs.sh index af7832685..a778d9b1f 100755 --- a/deploy/tfs.sh +++ b/deploy/tfs.sh @@ -132,6 +132,7 @@ mkdir -p $TMP_LOGS_FOLDER echo "Deleting and Creating a new namespace..." kubectl delete namespace $TFS_K8S_NAMESPACE --ignore-not-found kubectl create namespace $TFS_K8S_NAMESPACE +sleep 2 printf "\n" echo "Create secret with CockroachDB data" diff --git a/manifests/deviceservice.yaml b/manifests/deviceservice.yaml index f9a6d987d..22c0f5f9d 100644 --- a/manifests/deviceservice.yaml +++ b/manifests/deviceservice.yaml @@ -23,6 +23,9 @@ spec: replicas: 1 template: metadata: + annotations: + # Required for IETF L2VPN SBI when both parent and child run in same K8s cluster with Linkerd + config.linkerd.io/skip-outbound-ports: "8002" labels: app: deviceservice spec: -- GitLab From 90f70197f269446d88bbb4da031aa13f256635ab Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 26 May 2023 08:44:44 +0000 Subject: [PATCH 19/20] Manifests: - Corrected Resource limits in interdomain, service and slice components --- manifests/interdomainservice.yaml | 6 +++--- manifests/serviceservice.yaml | 2 +- manifests/sliceservice.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manifests/interdomainservice.yaml b/manifests/interdomainservice.yaml index 40b4a5b6f..067f94327 100644 --- a/manifests/interdomainservice.yaml +++ b/manifests/interdomainservice.yaml @@ -44,11 +44,11 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:10010"] resources: requests: - cpu: 100m + cpu: 250m memory: 64Mi limits: - cpu: 500m - memory: 512Mi + cpu: 1000m + memory: 1024Mi --- apiVersion: v1 kind: Service diff --git a/manifests/serviceservice.yaml b/manifests/serviceservice.yaml index a982de0ba..7d7bdaa4e 100644 --- a/manifests/serviceservice.yaml +++ b/manifests/serviceservice.yaml @@ -45,7 +45,7 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:3030"] resources: requests: - cpu: 100m + cpu: 250m memory: 128Mi limits: cpu: 1000m diff --git a/manifests/sliceservice.yaml b/manifests/sliceservice.yaml index 9a26b2591..e7e5c1604 100644 --- a/manifests/sliceservice.yaml +++ b/manifests/sliceservice.yaml @@ -50,7 +50,7 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:4040"] resources: requests: - cpu: 100m + cpu: 250m memory: 128Mi limits: cpu: 1000m -- GitLab From 4f22e477344656f7487eb4b3a3503ce017d9a4ec Mon Sep 17 00:00:00 2001 From: gifrerenom Date: Fri, 26 May 2023 08:56:06 +0000 Subject: [PATCH 20/20] OECC/PSC'22 test cleanup --- src/tests/oeccpsc22/TODO.txt | 3 --- src/tests/oeccpsc22/deploy_specs_dom1.sh | 4 ++-- src/tests/oeccpsc22/deploy_specs_dom2.sh | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 src/tests/oeccpsc22/TODO.txt diff --git a/src/tests/oeccpsc22/TODO.txt b/src/tests/oeccpsc22/TODO.txt deleted file mode 100644 index d786eee8b..000000000 --- a/src/tests/oeccpsc22/TODO.txt +++ /dev/null @@ -1,3 +0,0 @@ -- Update domain descriptors to 2 domains -- Test scenario deployment -- Test scenario operation diff --git a/src/tests/oeccpsc22/deploy_specs_dom1.sh b/src/tests/oeccpsc22/deploy_specs_dom1.sh index d9df93f52..b269236b0 100755 --- a/src/tests/oeccpsc22/deploy_specs_dom1.sh +++ b/src/tests/oeccpsc22/deploy_specs_dom1.sh @@ -64,7 +64,7 @@ export CRDB_DATABASE="tfs_dom1" export CRDB_DEPLOY_MODE="single" # Disable flag for dropping database, if it exists. -export CRDB_DROP_DATABASE_IF_EXISTS="YES" +export CRDB_DROP_DATABASE_IF_EXISTS="" # Disable flag for re-deploying CockroachDB from scratch. export CRDB_REDEPLOY="" @@ -112,7 +112,7 @@ export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" # Disable flag for dropping tables if they exist. -export QDB_DROP_TABLES_IF_EXIST="YES" +export QDB_DROP_TABLES_IF_EXIST="" # Disable flag for re-deploying QuestDB from scratch. export QDB_REDEPLOY="" diff --git a/src/tests/oeccpsc22/deploy_specs_dom2.sh b/src/tests/oeccpsc22/deploy_specs_dom2.sh index 2c1ceb411..112142437 100755 --- a/src/tests/oeccpsc22/deploy_specs_dom2.sh +++ b/src/tests/oeccpsc22/deploy_specs_dom2.sh @@ -64,7 +64,7 @@ export CRDB_DATABASE="tfs_dom2" export CRDB_DEPLOY_MODE="single" # Disable flag for dropping database, if it exists. -export CRDB_DROP_DATABASE_IF_EXISTS="YES" +export CRDB_DROP_DATABASE_IF_EXISTS="" # Disable flag for re-deploying CockroachDB from scratch. export CRDB_REDEPLOY="" @@ -112,7 +112,7 @@ export QDB_TABLE_MONITORING_KPIS="tfs_monitoring_kpis" export QDB_TABLE_SLICE_GROUPS="tfs_slice_groups" # Disable flag for dropping tables if they exist. -export QDB_DROP_TABLES_IF_EXIST="YES" +export QDB_DROP_TABLES_IF_EXIST="" # Disable flag for re-deploying QuestDB from scratch. export QDB_REDEPLOY="" -- GitLab