Commit 16f38985 authored by Pablo Armingol's avatar Pablo Armingol
Browse files

Update PCEP service configuration and Dockerfiles for resource management

parent 89bcbb06
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ spec:
        #       value: "tfs_pcep"
        envFrom:
          - secretRef:
              name: crdb-lsp-data
              name: crdb-data
        readinessProbe:
          exec:
            command: ["/bin/grpc_health_probe", "-addr=:20050"]
+2 −2
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ export CRDB_PASSWORD="tfs123"
export CRDB_DEPLOY_MODE="single"

# Disable flag for dropping database, if it exists.
export CRDB_DROP_DATABASE_IF_EXISTS=""
export CRDB_DROP_DATABASE_IF_EXISTS="YES"

# Disable flag for re-deploying CockroachDB from scratch.
export CRDB_REDEPLOY=""
@@ -208,7 +208,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=""
export QDB_DROP_TABLES_IF_EXIST="YES"

# Disable flag for re-deploying QuestDB from scratch.
export QDB_REDEPLOY=""
+32 −33
Original line number Diff line number Diff line
@@ -21,9 +21,8 @@ from common.proto.pcep_pb2 import RequestRq, RequestRp, PceIpRq, PceIpRp, LSPdb_
from common.tools.client.RetryDecorator import retry, delay_exponential
from common.tools.grpc.Tools import grpc_message_to_json_string

from pcep.service.tools.protos.grpcService_pb2 import  Session_Request, commandRequest
from pcep.service.tools.protos.grpcService_pb2_grpc import pceServiceStub
from pcep.database.LSP_DB import LspDB
from common.proto.pcep_pb2 import  Session_Request, commandRequest
from common.proto.pcep_pb2_grpc import PcepServiceStub as pceServiceStub



@@ -100,17 +99,17 @@ class PcepClient:
    #     LOGGER.warning("IAM IN SHOWLSP: {:s}".format(str(responselsp)))
    #     return responselsp

    @RETRY_DECORATOR
    def showLSPDB(self):
        LOGGER.debug("Showing the LSP Paths from the database")
        # Llamamos a LspDB para obtener la lista de LSPs
        try:
            lsp_info = LspDB.show_lsp_db()
            LOGGER.info(f"Información de LSPs: {lsp_info}")
            return lsp_info
        except Exception as e:
            LOGGER.error(f"Error al obtener la información de LSP desde la base de datos: {str(e)}")
            return None
    # @RETRY_DECORATOR
    # def showLSPDB(self):
    #     LOGGER.debug("Showing the LSP Paths from the database")
    #     # Llamamos a LspDB para obtener la lista de LSPs
    #     try:
    #         lsp_info = LspDB.show_lsp_db()
    #         LOGGER.info(f"Información de LSPs: {lsp_info}")
    #         return lsp_info
    #     except Exception as e:
    #         LOGGER.error(f"Error al obtener la información de LSP desde la base de datos: {str(e)}")
    #         return None

    #EL BUENO
    # @RETRY_DECORATOR
+1 −1
Original line number Diff line number Diff line
# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
# Copyright 2022-2025 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.
+9 −9
Original line number Diff line number Diff line
# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
# 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
#      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,
@@ -15,7 +15,7 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
# import sys
# sys.path.append('/home/ubuntu/tfs-ctrl/src/')
# sys.path.append('.home.ubuntu.tfs-ctrl.src.')

import grpc

@@ -32,17 +32,17 @@ class pceServiceStub(object):
            channel: A grpc.Channel.
        """
        self.update = channel.unary_unary(
                '/src.main.proto.pceService/update',
                '.src.main.proto.pceService.update',
                request_serializer=grpcService__pb2.commandRequest.SerializeToString,
                response_deserializer=grpcService__pb2.commandResponse.FromString,
                )
        self.getLSPdb = channel.unary_unary(
                '/src.main.proto.pceService/getLSPdb',
                '.src.main.proto.pceService.getLSPdb',
                request_serializer=grpcService__pb2.LSPdb_Request.SerializeToString,
                response_deserializer=grpcService__pb2.LSPdb_Response.FromString,
                )
        self.getSessionsInfo = channel.unary_unary(
                '/src.main.proto.pceService/getSessionsInfo',
                '.src.main.proto.pceService.getSessionsInfo',
                request_serializer=grpcService__pb2.Session_Request.SerializeToString,
                response_deserializer=grpcService__pb2.Session_Response.FromString,
                )
@@ -105,7 +105,7 @@ class pceService(object):
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/src.main.proto.pceService/update',
        return grpc.experimental.unary_unary(request, target, '.src.main.proto.pceService.update',
            grpcService__pb2.commandRequest.SerializeToString,
            grpcService__pb2.commandResponse.FromString,
            options, channel_credentials,
@@ -122,7 +122,7 @@ class pceService(object):
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/src.main.proto.pceService/getLSPdb',
        return grpc.experimental.unary_unary(request, target, '.src.main.proto.pceService.getLSPdb',
            grpcService__pb2.LSPdb_Request.SerializeToString,
            grpcService__pb2.LSPdb_Response.FromString,
            options, channel_credentials,
@@ -139,7 +139,7 @@ class pceService(object):
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/src.main.proto.pceService/getSessionsInfo',
        return grpc.experimental.unary_unary(request, target, '.src.main.proto.pceService.getSessionsInfo',
            grpcService__pb2.Session_Request.SerializeToString,
            grpcService__pb2.Session_Response.FromString,
            options, channel_credentials,
Loading