Skip to content
Snippets Groups Projects
Commit 368cbf29 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Pre-merge Cosmetic changes

parent 08b15bed
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!261(CTTC) New Analytics Component
This commit is part of merge request !261. Comments created here will be created in the context of that merge request.
...@@ -178,4 +178,4 @@ libyang/ ...@@ -178,4 +178,4 @@ libyang/
**/logs/*.log.* **/logs/*.log.*
# PySpark checkpoints # PySpark checkpoints
src/analytics/.spark/* src/analytics/.spark/*
\ No newline at end of file
...@@ -13,4 +13,4 @@ ...@@ -13,4 +13,4 @@
# limitations under the License. # limitations under the License.
pyspark==3.5.2 pyspark==3.5.2
confluent-kafka==2.3.* confluent-kafka==2.3.*
\ No newline at end of file
# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
......
...@@ -65,4 +65,4 @@ class AnalyticsFrontendClient: ...@@ -65,4 +65,4 @@ class AnalyticsFrontendClient:
LOGGER.debug('SelectAnalyzers: {:s}'.format(grpc_message_to_json_string(request))) LOGGER.debug('SelectAnalyzers: {:s}'.format(grpc_message_to_json_string(request)))
response = self.stub.SelectAnalyzers(request) response = self.stub.SelectAnalyzers(request)
LOGGER.debug('SelectAnalyzers result: {:s}'.format(grpc_message_to_json_string(response))) LOGGER.debug('SelectAnalyzers result: {:s}'.format(grpc_message_to_json_string(response)))
return response return response
\ No newline at end of file
...@@ -17,4 +17,4 @@ confluent-kafka==2.3.* ...@@ -17,4 +17,4 @@ confluent-kafka==2.3.*
psycopg2-binary==2.9.* psycopg2-binary==2.9.*
SQLAlchemy==1.4.* SQLAlchemy==1.4.*
sqlalchemy-cockroachdb==1.4.* sqlalchemy-cockroachdb==1.4.*
SQLAlchemy-Utils==0.38.* SQLAlchemy-Utils==0.38.*
\ No newline at end of file
...@@ -25,4 +25,4 @@ class AnalyticsFrontendService(GenericGrpcService): ...@@ -25,4 +25,4 @@ class AnalyticsFrontendService(GenericGrpcService):
self.analytics_frontend_servicer = AnalyticsFrontendServiceServicerImpl() self.analytics_frontend_servicer = AnalyticsFrontendServiceServicerImpl()
def install_servicers(self): def install_servicers(self):
add_AnalyticsFrontendServiceServicer_to_server(self.analytics_frontend_servicer, self.server) add_AnalyticsFrontendServiceServicer_to_server(self.analytics_frontend_servicer, self.server)
\ No newline at end of file
# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/) # Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
......
# 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.
...@@ -18,4 +18,4 @@ confluent-kafka==2.3.* ...@@ -18,4 +18,4 @@ confluent-kafka==2.3.*
psycopg2-binary==2.9.* psycopg2-binary==2.9.*
SQLAlchemy==1.4.* SQLAlchemy==1.4.*
sqlalchemy-cockroachdb==1.4.* sqlalchemy-cockroachdb==1.4.*
SQLAlchemy-Utils==0.38.* SQLAlchemy-Utils==0.38.*
\ 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.
...@@ -16,8 +16,6 @@ import logging, sqlalchemy ...@@ -16,8 +16,6 @@ import logging, sqlalchemy
from common.Settings import get_setting from common.Settings import get_setting
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
# CRDB_URI_TEMPLATE = 'cockroachdb://{:s}:{:s}@127.0.0.1:{:s}/{:s}?sslmode={:s}'
CRDB_URI_TEMPLATE = 'cockroachdb://{:s}:{:s}@cockroachdb-public.{:s}.svc.cluster.local:{:s}/{:s}?sslmode={:s}' CRDB_URI_TEMPLATE = 'cockroachdb://{:s}:{:s}@cockroachdb-public.{:s}.svc.cluster.local:{:s}/{:s}?sslmode={:s}'
class KpiEngine: class KpiEngine:
...@@ -33,12 +31,10 @@ class KpiEngine: ...@@ -33,12 +31,10 @@ class KpiEngine:
CRDB_SSLMODE = get_setting('CRDB_SSLMODE') CRDB_SSLMODE = get_setting('CRDB_SSLMODE')
crdb_uri = CRDB_URI_TEMPLATE.format( crdb_uri = CRDB_URI_TEMPLATE.format(
CRDB_USERNAME, CRDB_PASSWORD, CRDB_NAMESPACE, CRDB_SQL_PORT, CRDB_DATABASE, CRDB_SSLMODE) CRDB_USERNAME, CRDB_PASSWORD, CRDB_NAMESPACE, CRDB_SQL_PORT, CRDB_DATABASE, CRDB_SSLMODE)
# crdb_uri = CRDB_URI_TEMPLATE.format(
# CRDB_USERNAME, CRDB_PASSWORD, CRDB_SQL_PORT, CRDB_DATABASE, CRDB_SSLMODE)
try: try:
engine = sqlalchemy.create_engine(crdb_uri, echo=False) engine = sqlalchemy.create_engine(crdb_uri, echo=False)
LOGGER.info(' KpiDBmanager initalized with DB URL: {:}'.format(crdb_uri)) LOGGER.info(' KpiDBmanager initalized with DB URL: {:}'.format(crdb_uri))
except: # pylint: disable=bare-except # pragma: no cover except: # pylint: disable=bare-except # pragma: no cover
LOGGER.exception('Failed to connect to database: {:s}'.format(str(crdb_uri))) LOGGER.exception('Failed to connect to database: {:s}'.format(str(crdb_uri)))
return None # type: ignore return None # type: ignore
return engine return engine
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