Loading deploy/all.sh +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"} # If not already set, set the list of components, separated by spaces, you want to build images for, and deploy. # By default, only basic components are deployed export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device pathcomp service slice nbi webui load_generator e2e_orchestrator"} export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device pathcomp service slice nbi webui load_generator"} # Uncomment to activate Monitoring (old) #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" Loading proto/e2eorchestrator.proto +0 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import "context.proto"; service E2EOrchestratorService { rpc Compute(E2EOrchestratorRequest) returns (E2EOrchestratorReply) {} rpc PushTopology(context.Topology) returns (context.Empty) {} rpc RunPathAlgorithm(E2EOrchestratorRequest) returns (E2EOrchestratorReply) {} } message E2EOrchestratorRequest { Loading src/e2e_orchestrator/client/E2EOrchestratorClient.py +0 −49 Original line number Diff line number Diff line Loading @@ -23,10 +23,6 @@ from common.Settings import get_service_host, get_service_port_grpc from common.tools.client.RetryDecorator import delay_exponential, retry from common.tools.grpc.Tools import grpc_message_to_json from common.proto.e2eorchestrator_pb2 import E2EOrchestratorRequest, E2EOrchestratorReply from common.proto.context_pb2 import Service from decimal import Decimal, ROUND_HALF_EVEN import json LOGGER = logging.getLogger(__name__) MAX_RETRIES = 15 Loading Loading @@ -71,48 +67,3 @@ class E2EOrchestratorClient: "Compute result: {:s}".format(str(grpc_message_to_json(response))) ) return response def RunPathAlgorithm(self, service: Service) -> dict: # Extraer appInsId appInsId = service.service_id.service_uuid.uuid # Extraer fixedAllocation bw = None for c in service.service_constraints: if c.WhichOneof('constraint') == 'sla_capacity': bw = str(Decimal(c.sla_capacity.capacity_gbps * 1.e9).quantize(Decimal('0.1'), rounding=ROUND_HALF_EVEN)) break # Extraer origen/destino origen = None destino = None for cr in service.service_config.config_rules: if cr.WhichOneof('config_rule') != 'custom': continue val = json.loads(cr.custom.resource_value) if "sessionFilter" in val: origen = val["sessionFilter"].get("sourceIp") destino = val["sessionFilter"].get("dstAddress") break LOGGER.info( "Llegó a RunPathAlgorithm con service_id=%s, origen=%s, destino=%s, bw=%s", appInsId, origen, destino, bw ) # Retorno simulado para pruebas reply = { "origen": origen, "destino": destino, "bw": bw, "appInsId": appInsId, "message": "Recibido correctamente" } return reply #request = E2EOrchestratorRequest(service=service) #LOGGER.info("PathAlgorithm request: %s", grpc_message_to_json(request)) #response = self.stub.RunPathAlgorithm(request) # si el proto define RunPathAlgorithm #LOGGER.info("PathAlgorithm result: %s", grpc_message_to_json(response)) #return response Loading
deploy/all.sh +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"} # If not already set, set the list of components, separated by spaces, you want to build images for, and deploy. # By default, only basic components are deployed export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device pathcomp service slice nbi webui load_generator e2e_orchestrator"} export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device pathcomp service slice nbi webui load_generator"} # Uncomment to activate Monitoring (old) #export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring" Loading
proto/e2eorchestrator.proto +0 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import "context.proto"; service E2EOrchestratorService { rpc Compute(E2EOrchestratorRequest) returns (E2EOrchestratorReply) {} rpc PushTopology(context.Topology) returns (context.Empty) {} rpc RunPathAlgorithm(E2EOrchestratorRequest) returns (E2EOrchestratorReply) {} } message E2EOrchestratorRequest { Loading
src/e2e_orchestrator/client/E2EOrchestratorClient.py +0 −49 Original line number Diff line number Diff line Loading @@ -23,10 +23,6 @@ from common.Settings import get_service_host, get_service_port_grpc from common.tools.client.RetryDecorator import delay_exponential, retry from common.tools.grpc.Tools import grpc_message_to_json from common.proto.e2eorchestrator_pb2 import E2EOrchestratorRequest, E2EOrchestratorReply from common.proto.context_pb2 import Service from decimal import Decimal, ROUND_HALF_EVEN import json LOGGER = logging.getLogger(__name__) MAX_RETRIES = 15 Loading Loading @@ -71,48 +67,3 @@ class E2EOrchestratorClient: "Compute result: {:s}".format(str(grpc_message_to_json(response))) ) return response def RunPathAlgorithm(self, service: Service) -> dict: # Extraer appInsId appInsId = service.service_id.service_uuid.uuid # Extraer fixedAllocation bw = None for c in service.service_constraints: if c.WhichOneof('constraint') == 'sla_capacity': bw = str(Decimal(c.sla_capacity.capacity_gbps * 1.e9).quantize(Decimal('0.1'), rounding=ROUND_HALF_EVEN)) break # Extraer origen/destino origen = None destino = None for cr in service.service_config.config_rules: if cr.WhichOneof('config_rule') != 'custom': continue val = json.loads(cr.custom.resource_value) if "sessionFilter" in val: origen = val["sessionFilter"].get("sourceIp") destino = val["sessionFilter"].get("dstAddress") break LOGGER.info( "Llegó a RunPathAlgorithm con service_id=%s, origen=%s, destino=%s, bw=%s", appInsId, origen, destino, bw ) # Retorno simulado para pruebas reply = { "origen": origen, "destino": destino, "bw": bw, "appInsId": appInsId, "message": "Recibido correctamente" } return reply #request = E2EOrchestratorRequest(service=service) #LOGGER.info("PathAlgorithm request: %s", grpc_message_to_json(request)) #response = self.stub.RunPathAlgorithm(request) # si el proto define RunPathAlgorithm #LOGGER.info("PathAlgorithm result: %s", grpc_message_to_json(response)) #return response