Skip to content
Snippets Groups Projects
Commit 974e5f74 authored by Carlos Manso's avatar Carlos Manso
Browse files

Bufixes

parent 6dc71a9a
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!225Resolve "Integrate Support for IP-E2E-Optical SDN controllers to manage hierarchical virtual topologies"
#!/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=""
#!/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!"
# 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
......@@ -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"
# 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
......@@ -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"]
......@@ -13,4 +13,4 @@
# limitations under the License.
networkx
websockets==12.0
\ No newline at end of file
websockets==12.0
......@@ -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]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment