diff --git a/manifests/kpi_value_apiservice.yaml b/manifests/kpi_value_apiservice.yaml index 1a5dfc2655a4e16ce9f426d3204242acfa5d0f04..74eb90f675794f1b451b04af55e191edff58fae5 100644 --- a/manifests/kpi_value_apiservice.yaml +++ b/manifests/kpi_value_apiservice.yaml @@ -39,9 +39,6 @@ spec: env: - name: LOG_LEVEL value: "INFO" - # envFrom: - # - secretRef: - # name: crdb-data readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:30020"] diff --git a/manifests/kpi_value_writerservice.yaml b/manifests/kpi_value_writerservice.yaml index 9bd5da943b1246ad6cd8e272f37fb8c9d86df5b0..8a8e44ec2a571f1290e30a08d1c896a6339cbe46 100644 --- a/manifests/kpi_value_writerservice.yaml +++ b/manifests/kpi_value_writerservice.yaml @@ -39,9 +39,6 @@ spec: env: - name: LOG_LEVEL value: "INFO" - envFrom: - - secretRef: - name: crdb-data readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:30030"] diff --git a/src/common/tools/kafka/Variables.py b/src/common/tools/kafka/Variables.py index bdb6708f3fa5496997240698ab126462c0776546..24ae2cff7b5e710e18999eb09029216a4a5d6c8a 100644 --- a/src/common/tools/kafka/Variables.py +++ b/src/common/tools/kafka/Variables.py @@ -22,7 +22,7 @@ LOGGER = logging.getLogger(__name__) class KafkaConfig(Enum): # SERVER_IP = "127.0.0.1:9092" - SERVER_IP = "kafka-service:9092" + SERVER_IP = "kafka-service.kafka.svc.cluster.local:9092" ADMIN_CLIENT = AdminClient({'bootstrap.servers': SERVER_IP}) class KafkaTopic(Enum): diff --git a/src/kpi_manager/client/KpiManagerClient.py b/src/kpi_manager/client/KpiManagerClient.py index 9e7079ae49c4a76757c3c979d322d23dce0fa92e..672d82f2d78ea8b477429c5ba03fbb4331bae7c7 100755 --- a/src/kpi_manager/client/KpiManagerClient.py +++ b/src/kpi_manager/client/KpiManagerClient.py @@ -33,7 +33,6 @@ class KpiManagerClient: if not port: port = get_service_port_grpc(ServiceNameEnum.KPIMANAGER) self.endpoint = '{:s}:{:s}'.format(str(host), str(port)) LOGGER.debug('Creating channel to {:s}...'.format(str(self.endpoint))) - print('Creating channel to {:s}...'.format(str(self.endpoint))) self.channel = None self.stub = None diff --git a/src/kpi_manager/requirements.in b/src/kpi_manager/requirements.in index a06ae4a6eeca3513e40b2f01b9b819449b788aac..3e98fef362277dbf60019902e115d1c733bea9e7 100644 --- a/src/kpi_manager/requirements.in +++ b/src/kpi_manager/requirements.in @@ -1,11 +1,18 @@ -SQLAlchemy==1.4.52 -sqlalchemy-cockroachdb==1.4.4 -SQLAlchemy-Utils==0.38.3 -psycopg2-binary==2.9.3 -confluent-kafka==2.3.0 -Jinja2==3.0.3 -ncclient==0.6.15 -pyang==2.6.0 -requests==2.27.1 -typing_extensions==4.12.0 -yattag==1.15.2 \ No newline at end of file +# 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. + +psycopg2-binary==2.9.* +SQLAlchemy==1.4.* +sqlalchemy-cockroachdb==1.4.* +SQLAlchemy-Utils==0.38.* diff --git a/src/kpi_manager/tests/test_kpi_manager.py b/src/kpi_manager/tests/test_kpi_manager.py index e5bf17a5faf61514a70a19b45efea34fff7d21e3..b41e5139db85cfc462cff1e9545fbc8476c67939 100755 --- a/src/kpi_manager/tests/test_kpi_manager.py +++ b/src/kpi_manager/tests/test_kpi_manager.py @@ -17,7 +17,7 @@ import os, pytest import logging from typing import Union -from common.proto.context_pb2 import Empty +#from common.proto.context_pb2 import Empty from common.Constants import ServiceNameEnum from common.Settings import ( ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_service_port_grpc) @@ -26,7 +26,7 @@ from common.proto.context_pb2_grpc import add_ContextServiceServicer_to_server from common.proto.kpi_manager_pb2 import KpiId, KpiDescriptor, KpiDescriptorFilter, KpiDescriptorList from common.tools.service.GenericGrpcService import GenericGrpcService -from context.client.ContextClient import ContextClient +#from context.client.ContextClient import ContextClient # from device.service.driver_api.DriverFactory import DriverFactory # from device.service.driver_api.DriverInstanceCache import DriverInstanceCache @@ -40,10 +40,10 @@ from kpi_manager.tests.test_messages import create_kpi_descriptor_request from kpi_value_writer.tests.test_messages import create_kpi_id_request -from monitoring.service.NameMapping import NameMapping +#from monitoring.service.NameMapping import NameMapping -os.environ['DEVICE_EMULATED_ONLY'] = 'TRUE' -from device.service.drivers import DRIVERS +#os.environ['DEVICE_EMULATED_ONLY'] = 'TRUE' +#from device.service.drivers import DRIVERS ########################### # Tests Setup @@ -145,9 +145,10 @@ class MockContextService(GenericGrpcService): @pytest.fixture(scope='session') def kpi_manager_service(): LOGGER.info('Initializing KpiManagerService...') - name_mapping = NameMapping() + #name_mapping = NameMapping() # _service = MonitoringService(name_mapping) - _service = KpiManagerService(name_mapping) + # _service = KpiManagerService(name_mapping) + _service = KpiManagerService() _service.start() # yield the server, when test finishes, execution will resume to stop it