Loading my_deploy.sh +10 −4 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ 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 app pathcomp service slice nbi webui load_generator" export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator" # Uncomment to activate Monitoring (old) #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" Loading @@ -29,7 +29,7 @@ export TFS_COMPONENTS="context device app pathcomp service slice nbi webui load_ #export TFS_COMPONENTS="${TFS_COMPONENTS} kpi_manager kpi_value_writer kpi_value_api" # Uncomment to activate BGP-LS Speaker export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker" #export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker" # Uncomment to activate Optical Controller # To manage optical connections, "service" requires "opticalcontroller" to be deployed Loading Loading @@ -71,7 +71,14 @@ export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker" #fi # Uncomment to activate QKD App #export TFS_COMPONENTS="${TFS_COMPONENTS} 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 # Set the tag you want to use for your images. Loading Loading @@ -115,7 +122,6 @@ export CRDB_PASSWORD="tfs123" # Set the database name to be used by Context. export CRDB_DATABASE="tfs" export CRDB_DATABASE_APP="tfs_app" # 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 Loading src/qkd_app/__main__.py +7 −7 Original line number Diff line number Diff line Loading @@ -14,15 +14,15 @@ import logging, signal, sys, threading from prometheus_client import start_http_server from common.Constants import ServiceNameEnum #from common.Constants import ServiceNameEnum from common.Settings import ( ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, wait_for_environment_variables) #ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, wait_for_environment_variables) from qkd_app.service.QKDAppService import AppService from qkd_app.service.rest_server.RestServer import RestServer from qkd_app.service.rest_server.qkd_app import register_qkd_app from common.message_broker.Factory import get_messagebroker_backend from common.message_broker.MessageBroker import MessageBroker #from common.message_broker.Factory import get_messagebroker_backend #from common.message_broker.MessageBroker import MessageBroker from qkd_app.service.database.Engine import Engine from qkd_app.service.database.models._Base import rebuild_database Loading @@ -41,8 +41,8 @@ def main(): LOGGER = logging.getLogger(__name__) wait_for_environment_variables([ get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), #get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), #get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), ]) signal.signal(signal.SIGINT, signal_handler) Loading src/qkd_app/service/QKDAppServiceServicerImpl.py +9 −9 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ # limitations under the License. import grpc, logging, sqlalchemy from typing import Iterator, Optional #from typing import Iterator, Optional from common.message_broker.MessageBroker import MessageBroker import grpc, json, logging #, deepdiff from common.proto.context_pb2 import ( Loading @@ -21,20 +21,20 @@ from common.proto.context_pb2 import ( from common.proto.qkd_app_pb2 import (App, AppId, AppList, QKDAppTypesEnum) from common.proto.qkd_app_pb2_grpc import AppServiceServicer from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method from common.tools.context_queries.InterDomain import is_inter_domain #, is_multi_domain from common.tools.grpc.ConfigRules import copy_config_rules from common.tools.grpc.Constraints import copy_constraints from common.tools.grpc.EndPointIds import copy_endpoint_ids from common.tools.grpc.ServiceIds import update_service_ids #from common.tools.context_queries.InterDomain import is_inter_domain #, is_multi_domain #from common.tools.grpc.ConfigRules import copy_config_rules #from common.tools.grpc.Constraints import copy_constraints #from common.tools.grpc.EndPointIds import copy_endpoint_ids #from common.tools.grpc.ServiceIds import update_service_ids #from common.tools.grpc.Tools import grpc_message_to_json_string from context.client.ContextClient import ContextClient from qkd_app.client.QKDAppClient import QKDAppClient #from context.client.ContextClient import ContextClient #from qkd_app.client.QKDAppClient import QKDAppClient from .database.QKDApp import app_set, app_list_objs, app_get, app_get_by_server from common.method_wrappers.ServiceExceptions import NotFoundException LOGGER = logging.getLogger(__name__) METRICS_POOL = MetricsPool('App', 'RPC') METRICS_POOL = MetricsPool('QkdApp', 'RPC') # Optare: This file must be edited based on app's logic Loading src/qkd_app/service/database/uuids/QKDApp.py +14 −0 Original line number Diff line number Diff line # 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. from common.proto.qkd_app_pb2 import AppId from common.method_wrappers.ServiceExceptions import InvalidArgumentsException from ._Builder import get_uuid_from_string, get_uuid_random Loading src/service/Dockerfile +2 −2 Original line number Diff line number Diff line Loading @@ -70,8 +70,8 @@ COPY src/pathcomp/frontend/__init__.py pathcomp/frontend/__init__.py COPY src/pathcomp/frontend/client/. pathcomp/frontend/client/ COPY src/e2e_orchestrator/__init__.py e2e_orchestrator/__init__.py COPY src/e2e_orchestrator/client/. e2e_orchestrator/client/ COPY src/app/__init__.py app/__init__.py COPY src/app/client/. app/client/ COPY src/qkd_app/__init__.py qkd_app/__init__.py COPY src/qkd_app/client/. qkd_app/client/ COPY src/service/. service/ # Start the service Loading Loading
my_deploy.sh +10 −4 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ 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 app pathcomp service slice nbi webui load_generator" export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator" # Uncomment to activate Monitoring (old) #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" Loading @@ -29,7 +29,7 @@ export TFS_COMPONENTS="context device app pathcomp service slice nbi webui load_ #export TFS_COMPONENTS="${TFS_COMPONENTS} kpi_manager kpi_value_writer kpi_value_api" # Uncomment to activate BGP-LS Speaker export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker" #export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker" # Uncomment to activate Optical Controller # To manage optical connections, "service" requires "opticalcontroller" to be deployed Loading Loading @@ -71,7 +71,14 @@ export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker" #fi # Uncomment to activate QKD App #export TFS_COMPONENTS="${TFS_COMPONENTS} 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 # Set the tag you want to use for your images. Loading Loading @@ -115,7 +122,6 @@ export CRDB_PASSWORD="tfs123" # Set the database name to be used by Context. export CRDB_DATABASE="tfs" export CRDB_DATABASE_APP="tfs_app" # 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 Loading
src/qkd_app/__main__.py +7 −7 Original line number Diff line number Diff line Loading @@ -14,15 +14,15 @@ import logging, signal, sys, threading from prometheus_client import start_http_server from common.Constants import ServiceNameEnum #from common.Constants import ServiceNameEnum from common.Settings import ( ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, wait_for_environment_variables) #ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port, wait_for_environment_variables) from qkd_app.service.QKDAppService import AppService from qkd_app.service.rest_server.RestServer import RestServer from qkd_app.service.rest_server.qkd_app import register_qkd_app from common.message_broker.Factory import get_messagebroker_backend from common.message_broker.MessageBroker import MessageBroker #from common.message_broker.Factory import get_messagebroker_backend #from common.message_broker.MessageBroker import MessageBroker from qkd_app.service.database.Engine import Engine from qkd_app.service.database.models._Base import rebuild_database Loading @@ -41,8 +41,8 @@ def main(): LOGGER = logging.getLogger(__name__) wait_for_environment_variables([ get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), #get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_HOST ), #get_env_var_name(ServiceNameEnum.CONTEXT, ENVVAR_SUFIX_SERVICE_PORT_GRPC), ]) signal.signal(signal.SIGINT, signal_handler) Loading
src/qkd_app/service/QKDAppServiceServicerImpl.py +9 −9 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ # limitations under the License. import grpc, logging, sqlalchemy from typing import Iterator, Optional #from typing import Iterator, Optional from common.message_broker.MessageBroker import MessageBroker import grpc, json, logging #, deepdiff from common.proto.context_pb2 import ( Loading @@ -21,20 +21,20 @@ from common.proto.context_pb2 import ( from common.proto.qkd_app_pb2 import (App, AppId, AppList, QKDAppTypesEnum) from common.proto.qkd_app_pb2_grpc import AppServiceServicer from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method from common.tools.context_queries.InterDomain import is_inter_domain #, is_multi_domain from common.tools.grpc.ConfigRules import copy_config_rules from common.tools.grpc.Constraints import copy_constraints from common.tools.grpc.EndPointIds import copy_endpoint_ids from common.tools.grpc.ServiceIds import update_service_ids #from common.tools.context_queries.InterDomain import is_inter_domain #, is_multi_domain #from common.tools.grpc.ConfigRules import copy_config_rules #from common.tools.grpc.Constraints import copy_constraints #from common.tools.grpc.EndPointIds import copy_endpoint_ids #from common.tools.grpc.ServiceIds import update_service_ids #from common.tools.grpc.Tools import grpc_message_to_json_string from context.client.ContextClient import ContextClient from qkd_app.client.QKDAppClient import QKDAppClient #from context.client.ContextClient import ContextClient #from qkd_app.client.QKDAppClient import QKDAppClient from .database.QKDApp import app_set, app_list_objs, app_get, app_get_by_server from common.method_wrappers.ServiceExceptions import NotFoundException LOGGER = logging.getLogger(__name__) METRICS_POOL = MetricsPool('App', 'RPC') METRICS_POOL = MetricsPool('QkdApp', 'RPC') # Optare: This file must be edited based on app's logic Loading
src/qkd_app/service/database/uuids/QKDApp.py +14 −0 Original line number Diff line number Diff line # 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. from common.proto.qkd_app_pb2 import AppId from common.method_wrappers.ServiceExceptions import InvalidArgumentsException from ._Builder import get_uuid_from_string, get_uuid_random Loading
src/service/Dockerfile +2 −2 Original line number Diff line number Diff line Loading @@ -70,8 +70,8 @@ COPY src/pathcomp/frontend/__init__.py pathcomp/frontend/__init__.py COPY src/pathcomp/frontend/client/. pathcomp/frontend/client/ COPY src/e2e_orchestrator/__init__.py e2e_orchestrator/__init__.py COPY src/e2e_orchestrator/client/. e2e_orchestrator/client/ COPY src/app/__init__.py app/__init__.py COPY src/app/client/. app/client/ COPY src/qkd_app/__init__.py qkd_app/__init__.py COPY src/qkd_app/client/. qkd_app/client/ COPY src/service/. service/ # Start the service Loading