From 974e5f7444afdbc40b3bd615e1c6010ee738356f Mon Sep 17 00:00:00 2001 From: mansoca <carlos.manso@cttc.es> Date: Fri, 11 Oct 2024 14:12:12 +0000 Subject: [PATCH] Bufixes --- deploy/all.sh | 4 - manifests/e2e_orchestratorservice.yaml | 8 + manifests/nbiservice.yaml | 2 + manifests/vnt_managerservice.yaml | 14 +- my_deploy.sh | 4 +- proto/context.proto | 9 +- proto/vnt_manager.proto | 8 +- src/e2e_orchestrator/Dockerfile | 8 +- src/e2e_orchestrator/requirements.in | 2 +- .../E2EOrchestratorServiceServicerImpl.py | 12 +- src/nbi/service/__main__.py | 3 - .../service/context_subscription/__init__.py | 11 +- .../nbi_plugins/tfs_api/Resources.py | 32 +-- .../nbi_plugins/tfs_api/__init__.py | 4 - src/tests/.gitlab-ci.yml | 2 + src/tests/ecoc24/deploy_e2e.sh | 4 + src/tests/ecoc24/deploy_ip.sh | 4 + src/tests/ecoc24/deploy_opt.sh | 29 +++ src/tests/ecoc24/deploy_specs_e2e.sh | 75 +++++- src/tests/ecoc24/deploy_specs_ip.sh | 75 +++++- src/tests/ecoc24/deploy_specs_opt.sh | 216 ++++++++++++++++++ src/tests/ecoc24/fast_redeploy.sh | 67 ------ .../ecoc24/nginx-ingress-controller-opt.yaml | 138 +++++++++++ src/tests/ecoc24/show_deploy.sh | 16 +- src/tests/ecoc24/tfs-ingress-opt.yaml | 60 +++++ src/vnt_manager/Dockerfile | 10 +- src/vnt_manager/requirements.in | 2 +- .../service/VNTManagerServiceServicerImpl.py | 12 - 28 files changed, 671 insertions(+), 160 deletions(-) create mode 100755 src/tests/ecoc24/deploy_opt.sh create mode 100755 src/tests/ecoc24/deploy_specs_opt.sh delete mode 100755 src/tests/ecoc24/fast_redeploy.sh create mode 100644 src/tests/ecoc24/nginx-ingress-controller-opt.yaml create mode 100644 src/tests/ecoc24/tfs-ingress-opt.yaml diff --git a/deploy/all.sh b/deploy/all.sh index 01d7ac2e6..06b8ee701 100755 --- a/deploy/all.sh +++ b/deploy/all.sh @@ -224,10 +224,6 @@ export GRAF_EXT_PORT_HTTP=${GRAF_EXT_PORT_HTTP:-"3000"} # Deploy TeraFlowSDN ./deploy/tfs.sh -#Configure Subscription WS -./deploy/subscription_ws_ip.sh -./deploy/subscription_ws_e2e.sh - # Show deploy summary ./deploy/show.sh diff --git a/manifests/e2e_orchestratorservice.yaml b/manifests/e2e_orchestratorservice.yaml index 1161615da..ca7bc98e0 100644 --- a/manifests/e2e_orchestratorservice.yaml +++ b/manifests/e2e_orchestratorservice.yaml @@ -43,6 +43,14 @@ spec: env: - name: LOG_LEVEL value: "INFO" + - name: WS_IP_HOST + value: "nbiservice.tfs-ip.svc.cluster.local" + - name: WS_IP_PORT + value: 8761 + - name: WS_E2E_HOST + value: "e2e-orchestratorservice.tfs-e2e.svc.cluster.local" + - name: WS_E2E_PORT + value: 8762 readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:10050"] diff --git a/manifests/nbiservice.yaml b/manifests/nbiservice.yaml index 09ba41e79..a514736c1 100644 --- a/manifests/nbiservice.yaml +++ b/manifests/nbiservice.yaml @@ -44,6 +44,8 @@ spec: value: "INFO" - name: IETF_NETWORK_RENDERER value: "LIBYANG" + - name: WS_E2E_PORT + value: 8762 readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:9090"] diff --git a/manifests/vnt_managerservice.yaml b/manifests/vnt_managerservice.yaml index f7a6213fe..cf042a7ae 100644 --- a/manifests/vnt_managerservice.yaml +++ b/manifests/vnt_managerservice.yaml @@ -35,17 +35,21 @@ spec: image: labs.etsi.org:5050/tfs/controller/vnt_manager:latest imagePullPolicy: Always ports: - - containerPort: 10070 + - containerPort: 10080 - containerPort: 9192 env: - name: LOG_LEVEL value: "INFO" + - name: WS_IP_PORT + value: 8761 + - name: WS_E2E_PORT + value: 8762 readinessProbe: exec: - command: ["/bin/grpc_health_probe", "-addr=:10070"] + command: ["/bin/grpc_health_probe", "-addr=:10080"] livenessProbe: exec: - command: ["/bin/grpc_health_probe", "-addr=:10070"] + command: ["/bin/grpc_health_probe", "-addr=:10080"] resources: requests: cpu: 200m @@ -66,8 +70,8 @@ spec: app: vnt-managerservice ports: - name: grpc - port: 10070 - targetPort: 10070 + port: 10080 + targetPort: 10080 - name: metrics port: 9192 targetPort: 9192 diff --git a/my_deploy.sh b/my_deploy.sh index 1d757bfaa..3afa1ccce 100755 --- a/my_deploy.sh +++ b/my_deploy.sh @@ -63,10 +63,10 @@ export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_gene #export TFS_COMPONENTS="${TFS_COMPONENTS} forecaster" # Uncomment to activate E2E Orchestrator -export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator" +# export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator" # Uncomment to activate VNT Manager -export TFS_COMPONENTS="${TFS_COMPONENTS} vnt_manager" +# export TFS_COMPONENTS="${TFS_COMPONENTS} vnt_manager" # Uncomment to activate DLT and Interdomain #export TFS_COMPONENTS="${TFS_COMPONENTS} interdomain dlt" diff --git a/proto/context.proto b/proto/context.proto index ff36eb711..d3888e77b 100644 --- a/proto/context.proto +++ b/proto/context.proto @@ -260,7 +260,7 @@ message Link { string name = 2; repeated EndPointId link_endpoint_ids = 3; LinkAttributes attributes = 4; - bool virtual = 5; + LinkTypeEnum link_type = 5; } message LinkIdList { @@ -276,6 +276,13 @@ message LinkEvent { LinkId link_id = 2; } +enum LinkTypeEnum { + LINKTYPE_UNKNOWN = 0; + LINKTYPE_COPPER = 1; + LINKTYPE_VIRTUAL_COPPER = 2; + LINKTYPE_OPTICAL = 3; + LINKTYPE_VIRTUAL_OPTICAL = 4; +} // ----- Service ------------------------------------------------------------------------------------------------------- message ServiceId { diff --git a/proto/vnt_manager.proto b/proto/vnt_manager.proto index 39a52c405..ce7cf6102 100644 --- a/proto/vnt_manager.proto +++ b/proto/vnt_manager.proto @@ -20,11 +20,11 @@ import "context.proto"; service VNTManagerService { rpc VNTSubscript (VNTSubscriptionRequest) returns (VNTSubscriptionReply) {} - rpc ListVirtualLinkIds (context.Empty) returns (context.LinkIdList) {} - rpc ListVirtualLinks (context.Empty) returns (context.LinkList) {} + rpc ListVirtualLinkIds (context.Empty) returns (context.LinkIdList) {} + rpc ListVirtualLinks (context.Empty) returns (context.LinkList) {} rpc GetVirtualLink (context.LinkId) returns (context.Link) {} - rpc SetVirtualLink (context.Link) returns (context.LinkId) {} - rpc RemoveVirtualLink (context.LinkId) returns (context.Empty) {} + rpc SetVirtualLink (context.Link) returns (context.LinkId) {} + rpc RemoveVirtualLink (context.LinkId) returns (context.Empty) {} } message VNTSubscriptionRequest { diff --git a/src/e2e_orchestrator/Dockerfile b/src/e2e_orchestrator/Dockerfile index f1355fd9c..132d6ba47 100644 --- a/src/e2e_orchestrator/Dockerfile +++ b/src/e2e_orchestrator/Dockerfile @@ -77,9 +77,11 @@ RUN pip-compile --quiet --output-file=e2e_orchestrator/requirements.txt e2e_orch RUN python3 -m pip install -r e2e_orchestrator/requirements.txt # Add component files into working directory -COPY --chown=teraflow:teraflow ./src/context/. context -COPY --chown=teraflow:teraflow ./src/e2e_orchestrator/. e2e_orchestrator -COPY --chown=teraflow:teraflow ./src/service/. service +COPY src/context/__init__.py context/__init__.py +COPY src/context/client/. context/client/ +COPY src/service/__init__.py service/__init__.py +COPY src/service/client/. service/client/ +COPY src/e2e_orchestrator/. e2e_orchestrator/ # Start the service ENTRYPOINT ["python", "-m", "e2e_orchestrator.service"] diff --git a/src/e2e_orchestrator/requirements.in b/src/e2e_orchestrator/requirements.in index 8b5c877e7..5732b1bf0 100644 --- a/src/e2e_orchestrator/requirements.in +++ b/src/e2e_orchestrator/requirements.in @@ -13,4 +13,4 @@ # limitations under the License. networkx -websockets==12.0 \ No newline at end of file +websockets==12.0 diff --git a/src/e2e_orchestrator/service/E2EOrchestratorServiceServicerImpl.py b/src/e2e_orchestrator/service/E2EOrchestratorServiceServicerImpl.py index 42ccb43e2..bb8e66aa6 100644 --- a/src/e2e_orchestrator/service/E2EOrchestratorServiceServicerImpl.py +++ b/src/e2e_orchestrator/service/E2EOrchestratorServiceServicerImpl.py @@ -19,6 +19,7 @@ from common.proto.context_pb2 import ( Empty, Connection, EndPointId, Link, LinkId, TopologyDetails, Topology, Context, Service, ServiceId, ServiceTypeEnum, ServiceStatusEnum) from common.proto.e2eorchestrator_pb2_grpc import E2EOrchestratorServiceServicer +from common.Settings import get_setting from context.client.ContextClient import ContextClient from service.client.ServiceClient import ServiceClient from context.service.database.uuids.EndPoint import endpoint_get_uuid @@ -44,11 +45,12 @@ METRICS_POOL = MetricsPool("E2EOrchestrator", "RPC") context_client: ContextClient = ContextClient() service_client: ServiceClient = ServiceClient() -EXT_HOST = "nbiservice.tfs-ip.svc.cluster.local" -EXT_PORT = "8762" +EXT_HOST = str(get_setting('WS_IP_HOST')) +EXT_PORT = str(get_setting('WS_IP_PORT')) + +OWN_HOST = str(get_setting('WS_E2E_HOST')) +OWN_PORT = str(get_setting('WS_E2E_PORT')) -OWN_HOST = "e2e-orchestratorservice.tfs-e2e.svc.cluster.local" -OWN_PORT = "8761" ALL_HOSTS = "0.0.0.0" @@ -76,7 +78,7 @@ class SubscriptionServer(Thread): message = websocket.recv() LOGGER.debug("Received message from WebSocket: {}".format(message)) except Exception as ex: - LOGGER.info('Exception receiving from WebSocket: {}'.format(ex)) + LOGGER.error('Exception receiving from WebSocket: {}'.format(ex)) self._events_server() diff --git a/src/nbi/service/__main__.py b/src/nbi/service/__main__.py index da3699114..70917e788 100644 --- a/src/nbi/service/__main__.py +++ b/src/nbi/service/__main__.py @@ -81,9 +81,7 @@ def main(): register_tfs_api(rest_server) rest_server.start() -<<<<<<< HEAD register_context_subscription() -======= LOGGER.debug('Configured Resources:') for resource in rest_server.api.resources: LOGGER.debug(' - {:s}'.format(str(resource))) @@ -91,7 +89,6 @@ def main(): LOGGER.debug('Configured Rules:') for rule in rest_server.app.url_map.iter_rules(): LOGGER.debug(' - {:s}'.format(str(rule))) ->>>>>>> 07b8adea97ad03b872754bc695f5b1251ca68187 LOGGER.debug('Configured Resources:') for resource in rest_server.api.resources: diff --git a/src/nbi/service/context_subscription/__init__.py b/src/nbi/service/context_subscription/__init__.py index a69e14e72..e0dd90005 100644 --- a/src/nbi/service/context_subscription/__init__.py +++ b/src/nbi/service/context_subscription/__init__.py @@ -16,8 +16,7 @@ import logging from websockets.sync.server import serve from common.proto.vnt_manager_pb2 import VNTSubscriptionRequest -from common.proto.context_pb2 import Empty - +from common.Settings import get_setting from context.client.ContextClient import ContextClient from common.Constants import DEFAULT_CONTEXT_NAME, DEFAULT_TOPOLOGY_NAME from common.tools.object_factory.Topology import json_topology_id @@ -34,15 +33,15 @@ ADMIN_TOPOLOGY_ID = TopologyId(**json_topology_id(DEFAULT_TOPOLOGY_NAME, context vnt_manager_client: VNTManagerClient = VNTManagerClient() context_client: ContextClient = ContextClient() -HOST = "0.0.0.0" -PORT = 8762 +ALL_HOSTS = "0.0.0.0" +WS_E2E_PORT = str(get_setting('WS_E2E_PORT')) LOGGER = logging.getLogger(__name__) def register_context_subscription(): - with serve(subcript_to_vnt_manager, HOST, PORT, logger=LOGGER) as server: - LOGGER.info("Running subscription server...: {}:{}".format(HOST, str(PORT))) + with serve(subcript_to_vnt_manager, ALL_HOSTS, WS_E2E_PORT, logger=LOGGER) as server: + LOGGER.info("Running subscription server...: {}:{}".format(ALL_HOSTS, str(WS_E2E_PORT))) server.serve_forever() LOGGER.info("Exiting subscription server...") diff --git a/src/nbi/service/rest_server/nbi_plugins/tfs_api/Resources.py b/src/nbi/service/rest_server/nbi_plugins/tfs_api/Resources.py index 3392fe94d..d2bf2f889 100644 --- a/src/nbi/service/rest_server/nbi_plugins/tfs_api/Resources.py +++ b/src/nbi/service/rest_server/nbi_plugins/tfs_api/Resources.py @@ -22,9 +22,9 @@ from context.client.ContextClient import ContextClient from device.client.DeviceClient import DeviceClient from service.client.ServiceClient import ServiceClient from slice.client.SliceClient import SliceClient -<<<<<<< HEAD from vnt_manager.client.VNTManagerClient import VNTManagerClient import logging +from common.proto.context_pb2 import LinkTypeEnum from .Tools import ( format_grpc_to_json, grpc_connection_id, grpc_context, grpc_context_id, grpc_device, @@ -300,35 +300,19 @@ class Link(_Resource): return format_grpc_to_json(self.context_client.GetLink(grpc_link_id(link_uuid))) def put(self, link_uuid : str): - link = request.get_json() - if link_uuid != link['link_id']['link_uuid']['uuid']: + link_json = request.get_json() + link = grpc_link(link_json) + virtual_types = {LinkTypeEnum.LINKTYPE_VIRTUAL_COPPER, LinkTypeEnum.LINKTYPE_VIRTUAL_OPTICAL} + if link_uuid != link.link_id.link_uuid.uuid: raise BadRequest('Mismatching link_uuid') + elif link.link_type in virtual_types: + link = grpc_link(link_json) + return format_grpc_to_json(self.vntmanager_client.SetVirtualLink(link)) return format_grpc_to_json(self.context_client.SetLink(grpc_link(link))) def delete(self, link_uuid : str): return format_grpc_to_json(self.context_client.RemoveLink(grpc_link_id(link_uuid))) -class VirtualLinkIds(_Resource): - def get(self): - return format_grpc_to_json(self.vntmanager_client.ListVirtualLinkIds(Empty())) - -class VirtualLinks(_Resource): - def get(self): - return format_grpc_to_json(self.vntmanager_client.ListVirtualLinks(Empty())) - -class VirtualLink(_Resource): - def get(self, virtual_link_uuid : str): - return format_grpc_to_json(self.vntmanager_client.GetVirtualLink(grpc_link_id(virtual_link_uuid))) - def post(self, virtual_link_uuid : str): # pylint: disable=unused-argument - link_json = request.get_json() - link = grpc_link(link_json) - return format_grpc_to_json(self.vntmanager_client.SetVirtualLink(link)) - def put(self, virtual_link_uuid : str): # pylint: disable=unused-argument - link = request.get_json() - return format_grpc_to_json(self.vntmanager_client.SetVirtualLink(grpc_link(link))) - def delete(self, virtual_link_uuid : str): - return format_grpc_to_json(self.vntmanager_client.RemoveVirtualLink(grpc_link_id(virtual_link_uuid))) - class ConnectionIds(_Resource): def get(self, context_uuid : str, service_uuid : str): return format_grpc_to_json(self.context_client.ListConnectionIds(grpc_service_id(context_uuid, service_uuid))) diff --git a/src/nbi/service/rest_server/nbi_plugins/tfs_api/__init__.py b/src/nbi/service/rest_server/nbi_plugins/tfs_api/__init__.py index 5a57c7cee..22bc52dc0 100644 --- a/src/nbi/service/rest_server/nbi_plugins/tfs_api/__init__.py +++ b/src/nbi/service/rest_server/nbi_plugins/tfs_api/__init__.py @@ -56,10 +56,6 @@ RESOURCES = [ ('api.links', Links, '/links'), ('api.link', Link, '/link/<path:link_uuid>'), - ('api.virtual_link_ids', VirtualLinkIds, '/virtual_link_ids'), - ('api.virtual_links', VirtualLinks, '/virtual_links'), - ('api.virtual_link', VirtualLink, '/virtual_link/<path:virtual_link_uuid>'), - ('api.connection_ids', ConnectionIds, '/context/<path:context_uuid>/service/<path:service_uuid>/connection_ids'), ('api.connections', Connections, '/context/<path:context_uuid>/service/<path:service_uuid>/connections'), ('api.connection', Connection, '/connection/<path:connection_uuid>'), diff --git a/src/tests/.gitlab-ci.yml b/src/tests/.gitlab-ci.yml index c64db5d8f..09f5ba12e 100644 --- a/src/tests/.gitlab-ci.yml +++ b/src/tests/.gitlab-ci.yml @@ -20,3 +20,5 @@ include: #- local: '/src/tests/nfvsdn22/.gitlab-ci.yml' #- local: '/src/tests/ofc23/.gitlab-ci.yml' - local: '/src/tests/ofc24/.gitlab-ci.yml' + - local: '/src/tests/ofc24/.gitlab-ci.yml' + \ No newline at end of file diff --git a/src/tests/ecoc24/deploy_e2e.sh b/src/tests/ecoc24/deploy_e2e.sh index 01800e043..0e69bcdca 100755 --- a/src/tests/ecoc24/deploy_e2e.sh +++ b/src/tests/ecoc24/deploy_e2e.sh @@ -26,4 +26,8 @@ kubectl apply -f src/tests/ecoc24/nginx-ingress-controller-e2e.yaml # Deploy TFS for E2E source src/tests/ecoc24/deploy_specs_e2e.sh ./deploy/all.sh + +#Configure Subscription WS +./deploy/subscription_ws_e2e.sh + mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_e2e.sh diff --git a/src/tests/ecoc24/deploy_ip.sh b/src/tests/ecoc24/deploy_ip.sh index 34e4e894e..e0af5721e 100755 --- a/src/tests/ecoc24/deploy_ip.sh +++ b/src/tests/ecoc24/deploy_ip.sh @@ -26,4 +26,8 @@ kubectl apply -f src/tests/ecoc24/nginx-ingress-controller-ip.yaml # Deploy TFS for IP source src/tests/ecoc24/deploy_specs_ip.sh ./deploy/all.sh + +#Configure Subscription WS +./deploy/subscription_ws_ip.sh + mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_ip.sh diff --git a/src/tests/ecoc24/deploy_opt.sh b/src/tests/ecoc24/deploy_opt.sh new file mode 100755 index 000000000..e90fab0e2 --- /dev/null +++ b/src/tests/ecoc24/deploy_opt.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Copyright 2022-2024 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-opt + +# Delete secondary ingress controllers +kubectl delete -f src/tests/ecoc24/nginx-ingress-controller-opt.yaml + +# Create secondary ingress controllers +kubectl apply -f src/tests/ecoc24/nginx-ingress-controller-opt.yaml + +# Deploy TFS for OPT +source src/tests/ecoc24/deploy_specs_opt.sh +./deploy/all.sh +mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_opt.sh diff --git a/src/tests/ecoc24/deploy_specs_e2e.sh b/src/tests/ecoc24/deploy_specs_e2e.sh index f50bc28db..e1e358cfc 100755 --- a/src/tests/ecoc24/deploy_specs_e2e.sh +++ b/src/tests/ecoc24/deploy_specs_e2e.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (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. @@ -20,14 +20,35 @@ 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 pathcomp service slice nbi webui load_generator" export TFS_COMPONENTS="context device pathcomp service slice nbi webui" -# Uncomment to activate Monitoring +# Uncomment to activate Monitoring (old) #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate ZTP and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" +# Uncomment to activate Monitoring Framework (new) +#export TFS_COMPONENTS="${TFS_COMPONENTS} kpi_manager kpi_value_writer kpi_value_api telemetry analytics automation" + +# Uncomment to activate QoS Profiles +#export TFS_COMPONENTS="${TFS_COMPONENTS} qos_profile" + +# Uncomment to activate BGP-LS Speaker +#export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker" + +# Uncomment to activate Optical Controller +# To manage optical connections, "service" requires "opticalcontroller" to be deployed +# before "service", thus we "hack" the TFS_COMPONENTS environment variable prepending the +# "opticalcontroller" only if "service" is already in TFS_COMPONENTS, and re-export it. +#if [[ "$TFS_COMPONENTS" == *"service"* ]]; then +# BEFORE="${TFS_COMPONENTS% service*}" +# AFTER="${TFS_COMPONENTS#* service}" +# export TFS_COMPONENTS="${BEFORE} opticalcontroller service ${AFTER}" +#fi + +# Uncomment to activate ZTP +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp" + +# Uncomment to activate Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" @@ -38,9 +59,37 @@ export TFS_COMPONENTS="context device pathcomp service slice nbi webui" # Uncomment to activate TE #export TFS_COMPONENTS="${TFS_COMPONENTS} te" +# Uncomment to activate Forecaster +#export TFS_COMPONENTS="${TFS_COMPONENTS} forecaster" + # Uncomment to activate E2E Orchestrator export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator" +# Uncomment to activate VNT Manager +# export TFS_COMPONENTS="${TFS_COMPONENTS} vnt_manager" + +# Uncomment to activate DLT and Interdomain +#export TFS_COMPONENTS="${TFS_COMPONENTS} interdomain dlt" +#if [[ "$TFS_COMPONENTS" == *"dlt"* ]]; then +# export KEY_DIRECTORY_PATH="src/dlt/gateway/keys/priv_sk" +# export CERT_DIRECTORY_PATH="src/dlt/gateway/keys/cert.pem" +# export TLS_CERT_PATH="src/dlt/gateway/keys/ca.crt" +#fi + +# Uncomment to activate QKD App +# To manage QKD Apps, "service" requires "qkd_app" to be deployed +# before "service", thus we "hack" the TFS_COMPONENTS environment variable prepending the +# "qkd_app" only if "service" is already in TFS_COMPONENTS, and re-export it. +#if [[ "$TFS_COMPONENTS" == *"service"* ]]; then +# BEFORE="${TFS_COMPONENTS% service*}" +# AFTER="${TFS_COMPONENTS#* service}" +# export TFS_COMPONENTS="${BEFORE} qkd_app service ${AFTER}" +#fi + +# Uncomment to activate Load Generator +#export TFS_COMPONENTS="${TFS_COMPONENTS} load_generator" + + # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" @@ -105,6 +154,10 @@ 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" +# Set NATS installation mode to 'single'. This option is convenient for development and testing. +# See ./deploy/all.sh or ./deploy/nats.sh for additional details +export NATS_DEPLOY_MODE="single" + # Disable flag for re-deploying NATS from scratch. export NATS_REDEPLOY="" @@ -149,3 +202,15 @@ export PROM_EXT_PORT_HTTP="9090" # Set the external port Grafana HTTP Dashboards will be exposed to. export GRAF_EXT_PORT_HTTP="3000" + + +# ----- Apache Kafka ----------------------------------------------------------- + +# Set the namespace where Apache Kafka will be deployed. +export KFK_NAMESPACE="kafka" + +# Set the port Apache Kafka server will be exposed to. +export KFK_SERVER_PORT="9092" + +# Set the flag to YES for redeploying of Apache Kafka +export KFK_REDEPLOY="" diff --git a/src/tests/ecoc24/deploy_specs_ip.sh b/src/tests/ecoc24/deploy_specs_ip.sh index 65e8db4ab..7542a0fb5 100755 --- a/src/tests/ecoc24/deploy_specs_ip.sh +++ b/src/tests/ecoc24/deploy_specs_ip.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (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. @@ -20,14 +20,35 @@ 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 pathcomp service slice nbi webui load_generator" export TFS_COMPONENTS="context device pathcomp service slice nbi webui" -# Uncomment to activate Monitoring +# Uncomment to activate Monitoring (old) #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" -# Uncomment to activate ZTP and Policy Manager -#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp policy" +# Uncomment to activate Monitoring Framework (new) +#export TFS_COMPONENTS="${TFS_COMPONENTS} kpi_manager kpi_value_writer kpi_value_api telemetry analytics automation" + +# Uncomment to activate QoS Profiles +#export TFS_COMPONENTS="${TFS_COMPONENTS} qos_profile" + +# Uncomment to activate BGP-LS Speaker +#export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker" + +# Uncomment to activate Optical Controller +# To manage optical connections, "service" requires "opticalcontroller" to be deployed +# before "service", thus we "hack" the TFS_COMPONENTS environment variable prepending the +# "opticalcontroller" only if "service" is already in TFS_COMPONENTS, and re-export it. +#if [[ "$TFS_COMPONENTS" == *"service"* ]]; then +# BEFORE="${TFS_COMPONENTS% service*}" +# AFTER="${TFS_COMPONENTS#* service}" +# export TFS_COMPONENTS="${BEFORE} opticalcontroller service ${AFTER}" +#fi + +# Uncomment to activate ZTP +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp" + +# Uncomment to activate Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} policy" # Uncomment to activate Optical CyberSecurity #export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" @@ -38,9 +59,37 @@ export TFS_COMPONENTS="context device pathcomp service slice nbi webui" # Uncomment to activate TE #export TFS_COMPONENTS="${TFS_COMPONENTS} te" +# Uncomment to activate Forecaster +#export TFS_COMPONENTS="${TFS_COMPONENTS} forecaster" + +# Uncomment to activate E2E Orchestrator +# export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator" + # Uncomment to activate VNT Manager export TFS_COMPONENTS="${TFS_COMPONENTS} vnt_manager" +# Uncomment to activate DLT and Interdomain +#export TFS_COMPONENTS="${TFS_COMPONENTS} interdomain dlt" +#if [[ "$TFS_COMPONENTS" == *"dlt"* ]]; then +# export KEY_DIRECTORY_PATH="src/dlt/gateway/keys/priv_sk" +# export CERT_DIRECTORY_PATH="src/dlt/gateway/keys/cert.pem" +# export TLS_CERT_PATH="src/dlt/gateway/keys/ca.crt" +#fi + +# Uncomment to activate QKD App +# To manage QKD Apps, "service" requires "qkd_app" to be deployed +# before "service", thus we "hack" the TFS_COMPONENTS environment variable prepending the +# "qkd_app" only if "service" is already in TFS_COMPONENTS, and re-export it. +#if [[ "$TFS_COMPONENTS" == *"service"* ]]; then +# BEFORE="${TFS_COMPONENTS% service*}" +# AFTER="${TFS_COMPONENTS#* service}" +# export TFS_COMPONENTS="${BEFORE} qkd_app service ${AFTER}" +#fi + +# Uncomment to activate Load Generator +#export TFS_COMPONENTS="${TFS_COMPONENTS} load_generator" + + # Set the tag you want to use for your images. export TFS_IMAGE_TAG="dev" @@ -105,6 +154,10 @@ 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" +# Set NATS installation mode to 'single'. This option is convenient for development and testing. +# See ./deploy/all.sh or ./deploy/nats.sh for additional details +export NATS_DEPLOY_MODE="single" + # Disable flag for re-deploying NATS from scratch. export NATS_REDEPLOY="" @@ -149,3 +202,15 @@ export PROM_EXT_PORT_HTTP="9090" # Set the external port Grafana HTTP Dashboards will be exposed to. export GRAF_EXT_PORT_HTTP="3000" + + +# ----- Apache Kafka ----------------------------------------------------------- + +# Set the namespace where Apache Kafka will be deployed. +export KFK_NAMESPACE="kafka" + +# Set the port Apache Kafka server will be exposed to. +export KFK_SERVER_PORT="9092" + +# Set the flag to YES for redeploying of Apache Kafka +export KFK_REDEPLOY="" diff --git a/src/tests/ecoc24/deploy_specs_opt.sh b/src/tests/ecoc24/deploy_specs_opt.sh new file mode 100755 index 000000000..5d258e60f --- /dev/null +++ b/src/tests/ecoc24/deploy_specs_opt.sh @@ -0,0 +1,216 @@ +#!/bin/bash +# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (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 pathcomp service slice nbi webui" + +# Uncomment to activate Monitoring (old) +#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" + +# Uncomment to activate Monitoring Framework (new) +#export TFS_COMPONENTS="${TFS_COMPONENTS} kpi_manager kpi_value_writer kpi_value_api telemetry analytics automation" + +# Uncomment to activate QoS Profiles +#export TFS_COMPONENTS="${TFS_COMPONENTS} qos_profile" + +# Uncomment to activate BGP-LS Speaker +#export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker" + +# Uncomment to activate Optical Controller +# To manage optical connections, "service" requires "opticalcontroller" to be deployed +# before "service", thus we "hack" the TFS_COMPONENTS environment variable prepending the +# "opticalcontroller" only if "service" is already in TFS_COMPONENTS, and re-export it. +#if [[ "$TFS_COMPONENTS" == *"service"* ]]; then +# BEFORE="${TFS_COMPONENTS% service*}" +# AFTER="${TFS_COMPONENTS#* service}" +# export TFS_COMPONENTS="${BEFORE} opticalcontroller service ${AFTER}" +#fi + +# Uncomment to activate ZTP +#export TFS_COMPONENTS="${TFS_COMPONENTS} ztp" + +# Uncomment to activate Policy Manager +#export TFS_COMPONENTS="${TFS_COMPONENTS} policy" + +# Uncomment to activate Optical CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} dbscanserving opticalattackmitigator opticalattackdetector opticalattackmanager" + +# Uncomment to activate L3 CyberSecurity +#export TFS_COMPONENTS="${TFS_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector" + +# Uncomment to activate TE +#export TFS_COMPONENTS="${TFS_COMPONENTS} te" + +# Uncomment to activate Forecaster +#export TFS_COMPONENTS="${TFS_COMPONENTS} forecaster" + +# Uncomment to activate E2E Orchestrator +# export TFS_COMPONENTS="${TFS_COMPONENTS} e2e_orchestrator" + +# Uncomment to activate VNT Manager +# export TFS_COMPONENTS="${TFS_COMPONENTS} vnt_manager" + +# Uncomment to activate DLT and Interdomain +#export TFS_COMPONENTS="${TFS_COMPONENTS} interdomain dlt" +#if [[ "$TFS_COMPONENTS" == *"dlt"* ]]; then +# export KEY_DIRECTORY_PATH="src/dlt/gateway/keys/priv_sk" +# export CERT_DIRECTORY_PATH="src/dlt/gateway/keys/cert.pem" +# export TLS_CERT_PATH="src/dlt/gateway/keys/ca.crt" +#fi + +# Uncomment to activate QKD App +# To manage QKD Apps, "service" requires "qkd_app" to be deployed +# before "service", thus we "hack" the TFS_COMPONENTS environment variable prepending the +# "qkd_app" only if "service" is already in TFS_COMPONENTS, and re-export it. +#if [[ "$TFS_COMPONENTS" == *"service"* ]]; then +# BEFORE="${TFS_COMPONENTS% service*}" +# AFTER="${TFS_COMPONENTS#* service}" +# export TFS_COMPONENTS="${BEFORE} qkd_app service ${AFTER}" +#fi + +# Uncomment to activate Load Generator +#export TFS_COMPONENTS="${TFS_COMPONENTS} load_generator" + + +# 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-opt" + +# Set additional manifest files to be applied after the deployment +export TFS_EXTRA_MANIFESTS="src/tests/ecoc24/tfs-ingress-opt.yaml" + +# Uncomment to monitor performance of components +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml" + +# Uncomment when deploying Optical CyberSecurity +#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.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_ip" + +# 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-opt" + +# 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" + +# Set NATS installation mode to 'single'. This option is convenient for development and testing. +# See ./deploy/all.sh or ./deploy/nats.sh for additional details +export NATS_DEPLOY_MODE="single" + +# Disable flag for re-deploying NATS from scratch. +export NATS_REDEPLOY="" + + +# ----- QuestDB ---------------------------------------------------------------- + +# Set the namespace where QuestDB will be deployed. +export QDB_NAMESPACE="qdb-opt" + +# 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" + + +# ----- Apache Kafka ----------------------------------------------------------- + +# Set the namespace where Apache Kafka will be deployed. +export KFK_NAMESPACE="kafka" + +# Set the port Apache Kafka server will be exposed to. +export KFK_SERVER_PORT="9092" + +# Set the flag to YES for redeploying of Apache Kafka +export KFK_REDEPLOY="" diff --git a/src/tests/ecoc24/fast_redeploy.sh b/src/tests/ecoc24/fast_redeploy.sh deleted file mode 100755 index 51f0a1a16..000000000 --- a/src/tests/ecoc24/fast_redeploy.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# Copyright 2022-2024 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-e2e tfs-ip - -echo "Deploying tfs-e2e ..." -kubectl delete -f src/tests/ecoc24/nginx-ingress-controller-e2e.yaml > ./tmp/tfs-e2e/logs/deploy-tfs-e2e.log -kubectl create namespace tfs-e2e > ./tmp/tfs-e2e/logs/deploy-tfs-e2e.log -kubectl apply -f src/tests/ecoc24/nginx-ingress-controller-e2e.yaml > ./tmp/tfs-e2e/logs/deploy-tfs-e2e.log -kubectl --namespace tfs-e2e apply -f ./tmp/tfs-e2e/manifests/contextservice.yaml > ./tmp/tfs-e2e/logs/deploy-tfs-e2e.log -kubectl --namespace tfs-e2e apply -f ./tmp/tfs-e2e/manifests/deviceservice.yaml > ./tmp/tfs-e2e/logs/deploy-tfs-e2e.log -kubectl --namespace tfs-e2e apply -f ./tmp/tfs-e2e/manifests/e2e_orchestratorservice.yaml > ./tmp/tfs-e2e/logs/deploy-tfs-e2e.log -kubectl --namespace tfs-e2e apply -f ./tmp/tfs-e2e/manifests/pathcompservice.yaml > ./tmp/tfs-e2e/logs/deploy-tfs-e2e.log -kubectl --namespace tfs-e2e apply -f ./tmp/tfs-e2e/manifests/serviceservice.yaml > ./tmp/tfs-e2e/logs/deploy-tfs-e2e.log -kubectl --namespace tfs-e2e apply -f ./tmp/tfs-e2e/manifests/sliceservice.yaml > ./tmp/tfs-e2e/logs/deploy-tfs-e2e.log -kubectl --namespace tfs-e2e apply -f ./tmp/tfs-e2e/manifests/webuiservice.yaml > ./tmp/tfs-e2e/logs/deploy-tfs-e2e.log -kubectl --namespace tfs-e2e apply -f src/tests/ecoc24/tfs-ingress-e2e.yaml > ./tmp/tfs-e2e/logs/deploy-tfs-e2e.log -printf "\n" - -echo "Deploying tfs-ip ..." -kubectl delete -f src/tests/ecoc24/nginx-ingress-controller-ip.yaml > ./tmp/logs/deploy-tfs-ip.log -kubectl create namespace tfs-ip > ./tmp/logs/deploy-tfs-ip.log -kubectl apply -f src/tests/ecoc24/nginx-ingress-controller-ip.yaml > ./tmp/logs/deploy-tfs-ip.log -kubectl --namespace tfs-ip apply -f ./tmp/tfs-ip/manifests/contextservice.yaml > ./tmp/logs/deploy-tfs-ip.log -kubectl --namespace tfs-ip apply -f ./tmp/tfs-ip/manifests/deviceservice.yaml > ./tmp/logs/deploy-tfs-ip.log -kubectl --namespace tfs-ip apply -f ./tmp/tfs-ip/manifests/pathcompservice.yaml > ./tmp/logs/deploy-tfs-ip.log -kubectl --namespace tfs-ip apply -f ./tmp/tfs-ip/manifests/serviceservice.yaml > ./tmp/logs/deploy-tfs-ip.log -kubectl --namespace tfs-ip apply -f ./tmp/tfs-ip/manifests/sliceservice.yaml > ./tmp/logs/deploy-tfs-ip.log -kubectl --namespace tfs-ip apply -f ./tmp/tfs-ip/manifests/vnt_managerservice.yaml > ./tmp/logs/deploy-tfs-ip.log -kubectl --namespace tfs-ip apply -f ./tmp/tfs-ip/manifests/webuiservice.yaml > ./tmp/logs/deploy-tfs-ip.log -kubectl --namespace tfs-ip apply -f src/tests/ecoc24/tfs-ingress-ip.yaml > ./tmp/logs/deploy-tfs-ip.log -printf "\n" - -echo "Waiting tfs-e2e ..." -kubectl wait --namespace tfs-e2e --for='condition=available' --timeout=300s deployment/contextservice -kubectl wait --namespace tfs-e2e --for='condition=available' --timeout=300s deployment/deviceservice -kubectl wait --namespace tfs-e2e --for='condition=available' --timeout=300s deployment/e2e-orchestratorservice -kubectl wait --namespace tfs-e2e --for='condition=available' --timeout=300s deployment/pathcompservice -kubectl wait --namespace tfs-e2e --for='condition=available' --timeout=300s deployment/serviceservice -kubectl wait --namespace tfs-e2e --for='condition=available' --timeout=300s deployment/sliceservice -kubectl wait --namespace tfs-e2e --for='condition=available' --timeout=300s deployment/webuiservice -printf "\n" - -echo "Waiting tfs-ip ..." -kubectl wait --namespace tfs-ip --for='condition=available' --timeout=300s deployment/contextservice -kubectl wait --namespace tfs-ip --for='condition=available' --timeout=300s deployment/deviceservice -kubectl wait --namespace tfs-ip --for='condition=available' --timeout=300s deployment/pathcompservice -kubectl wait --namespace tfs-ip --for='condition=available' --timeout=300s deployment/serviceservice -kubectl wait --namespace tfs-ip --for='condition=available' --timeout=300s deployment/sliceservice -kubectl wait --namespace tfs-ip --for='condition=available' --timeout=300s deployment/vnt-managerservice -kubectl wait --namespace tfs-ip --for='condition=available' --timeout=300s deployment/webuiservice -printf "\n" - -echo "Done!" diff --git a/src/tests/ecoc24/nginx-ingress-controller-opt.yaml b/src/tests/ecoc24/nginx-ingress-controller-opt.yaml new file mode 100644 index 000000000..9793b00cb --- /dev/null +++ b/src/tests/ecoc24/nginx-ingress-controller-opt.yaml @@ -0,0 +1,138 @@ +# Copyright 2022-2024 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-opt + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-udp-microk8s-conf-opt + namespace: ingress +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-ingress-tcp-microk8s-conf-opt + namespace: ingress +--- +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + name: tfs-ingress-class-opt + annotations: + ingressclass.kubernetes.io/is-default-class: "false" +spec: + controller: tfs.etsi.org/controller-class-opt +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: nginx-ingress-microk8s-controller-opt + namespace: ingress + labels: + microk8s-application: nginx-ingress-microk8s-opt +spec: + selector: + matchLabels: + name: nginx-ingress-microk8s-opt + updateStrategy: + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + name: nginx-ingress-microk8s-opt + 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: 8003 + protocol: TCP + - name: https + containerPort: 443 + hostPort: 4433 + protocol: TCP + - name: health + containerPort: 10254 + hostPort: 12543 + protocol: TCP + - name: ws + containerPort: 8763 + hostPort: 8763 + protocol: TCP + args: + - /nginx-ingress-controller + - --configmap=$(POD_NAMESPACE)/nginx-load-balancer-microk8s-conf-opt + - --tcp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-tcp-microk8s-conf-opt + - --udp-services-configmap=$(POD_NAMESPACE)/nginx-ingress-udp-microk8s-conf-opt + - --election-id=ingress-controller-leader-opt + - --controller-class=tfs.etsi.org/controller-class-opt + - --ingress-class=tfs-ingress-class-opt + - ' ' + - --publish-status-address=127.0.0.1 diff --git a/src/tests/ecoc24/show_deploy.sh b/src/tests/ecoc24/show_deploy.sh index 975047774..84c887bf4 100755 --- a/src/tests/ecoc24/show_deploy.sh +++ b/src/tests/ecoc24/show_deploy.sh @@ -17,18 +17,26 @@ # Automated steps start here ######################################################################################################################## -echo "Deployment Resources:" +echo "E2E Deployment Resources:" kubectl --namespace tfs-e2e get all printf "\n" -echo "Deployment Ingress:" +echo "E2E Deployment Ingress:" kubectl --namespace tfs-e2e get ingress printf "\n" -echo "Deployment Resources:" +echo "IP Deployment Resources:" kubectl --namespace tfs-ip get all printf "\n" -echo "Deployment Ingress:" +echo "IP Deployment Ingress:" kubectl --namespace tfs-ip get ingress printf "\n" + +echo "Optical Deployment Resources:" +kubectl --namespace tfs-opt get all +printf "\n" + +echo "Optical Deployment Ingress:" +kubectl --namespace tfs-opt get ingress +printf "\n" diff --git a/src/tests/ecoc24/tfs-ingress-opt.yaml b/src/tests/ecoc24/tfs-ingress-opt.yaml new file mode 100644 index 000000000..39969500b --- /dev/null +++ b/src/tests/ecoc24/tfs-ingress-opt.yaml @@ -0,0 +1,60 @@ +# Copyright 2022-2024 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-opt + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 +spec: + ingressClassName: tfs-ingress-class-opt + 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: nbiservice + port: + number: 8080 + - path: /()(tfs-api/.*) + pathType: Prefix + backend: + service: + name: nbiservice + port: + number: 8080 \ No newline at end of file diff --git a/src/vnt_manager/Dockerfile b/src/vnt_manager/Dockerfile index 29a3c953b..53d9393bd 100644 --- a/src/vnt_manager/Dockerfile +++ b/src/vnt_manager/Dockerfile @@ -77,10 +77,12 @@ RUN pip-compile --quiet --output-file=vnt_manager/requirements.txt vnt_manager/r RUN python3 -m pip install -r vnt_manager/requirements.txt # Add component files into working directory -COPY --chown=teraflow:teraflow ./src/context/. context -COPY --chown=teraflow:teraflow ./src/vnt_manager/. vnt_manager -COPY --chown=teraflow:teraflow ./src/device/. device - +COPY src/context/__init__.py context/__init__.py +COPY src/context/client/. context/client/ +COPY src/device/__init__.py device/__init__.py +COPY src/device/client/. device/client/ +COPY src/vnt_manager/__init__.py vnt_manager/__init__.py +COPY src/vnt_manager/client/. vnt_manager/client/ # Start the service ENTRYPOINT ["python", "-m", "vnt_manager.service"] diff --git a/src/vnt_manager/requirements.in b/src/vnt_manager/requirements.in index 95d80d85c..ba3b221be 100644 --- a/src/vnt_manager/requirements.in +++ b/src/vnt_manager/requirements.in @@ -13,4 +13,4 @@ # limitations under the License. networkx -websockets==12.0 \ No newline at end of file +websockets==12.0 diff --git a/src/vnt_manager/service/VNTManagerServiceServicerImpl.py b/src/vnt_manager/service/VNTManagerServiceServicerImpl.py index c2a570a9d..364001147 100644 --- a/src/vnt_manager/service/VNTManagerServiceServicerImpl.py +++ b/src/vnt_manager/service/VNTManagerServiceServicerImpl.py @@ -57,13 +57,6 @@ ADMIN_TOPOLOGY_ID = TopologyId(**json_topology_id(DEFAULT_TOPOLOGY_NAME, context GET_EVENT_TIMEOUT = 0.5 - -HOST = "10.1.1.83" -PORT = str(8765) - - - - class VNTMEventDispatcher(threading.Thread): def __init__(self, host, port) -> None: LOGGER.debug('Creating VTNM connector...') @@ -162,12 +155,7 @@ class VNTManagerServiceServicerImpl(VNTManagerServiceServicer): return reply - """ @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) - def ListVirtualLinkIds(self, request : Empty, context : grpc.ServicerContext) -> LinkIdList: - return [link for link in context_client.ListLinks(Empty()) if link.virtual] - return LinkIdList(link_ids=[link.link_id for link in self.links]) - """ @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def ListVirtualLinks(self, request : Empty, context : grpc.ServicerContext) -> LinkList: return [link for link in context_client.ListLinks(Empty()).links if link.virtual] -- GitLab