diff --git a/scripts/run_tests_locally-analytics-backend.sh b/scripts/run_tests_locally-analytics-backend.sh new file mode 100755 index 0000000000000000000000000000000000000000..99a789c9fda481942b904a2e805202642123835c --- /dev/null +++ b/scripts/run_tests_locally-analytics-backend.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# 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. + + +PROJECTDIR=`pwd` + +cd $PROJECTDIR/src +RCFILE=$PROJECTDIR/coverage/.coveragerc +CRDB_SQL_ADDRESS=$(kubectl get service cockroachdb-public --namespace crdb -o jsonpath='{.spec.clusterIP}') +export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs_kpi_mgmt?sslmode=require" +python3 -m pytest --log-level=DEBUG --log-cli-level=DEBUG --verbose \ + analytics/backend/tests/test_backend.py diff --git a/scripts/run_tests_locally-telemetry-backend.sh b/scripts/run_tests_locally-telemetry-backend.sh index 79db05fcf1259365e8a909ee99395eb59dfb9437..422574d0e8b926bc734c83a7bee1c5370f1c581a 100755 --- a/scripts/run_tests_locally-telemetry-backend.sh +++ b/scripts/run_tests_locally-telemetry-backend.sh @@ -22,7 +22,8 @@ cd $PROJECTDIR/src # kpi_manager/tests/test_unitary.py # python3 kpi_manager/tests/test_unitary.py - +CRDB_SQL_ADDRESS=$(kubectl get service cockroachdb-public --namespace crdb -o jsonpath='{.spec.clusterIP}') +export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs_kpi_mgmt?sslmode=require" RCFILE=$PROJECTDIR/coverage/.coveragerc python3 -m pytest --log-level=INFO --log-cli-level=debug --verbose \ telemetry/backend/tests/test_TelemetryBackend.py diff --git a/scripts/run_tests_locally-telemetry-frontend.sh b/scripts/run_tests_locally-telemetry-frontend.sh index a2a1de52340cac527d4d1c446c76740d38ce7783..0ed828310e2adbaf3a61e5d0e8a0a8e2283452d4 100755 --- a/scripts/run_tests_locally-telemetry-frontend.sh +++ b/scripts/run_tests_locally-telemetry-frontend.sh @@ -22,7 +22,8 @@ cd $PROJECTDIR/src # kpi_manager/tests/test_unitary.py # python3 kpi_manager/tests/test_unitary.py - +CRDB_SQL_ADDRESS=$(kubectl get service cockroachdb-public --namespace crdb -o jsonpath='{.spec.clusterIP}') +export CRDB_URI="cockroachdb://tfs:tfs123@${CRDB_SQL_ADDRESS}:26257/tfs_kpi_mgmt?sslmode=require" RCFILE=$PROJECTDIR/coverage/.coveragerc python3 -m pytest --log-level=DEBUG --log-cli-level=DEBUG --verbose \ telemetry/frontend/tests/test_frontend.py diff --git a/scripts/show_logs_telemetry-backend.sh b/scripts/show_logs_telemetry-backend.sh new file mode 100755 index 0000000000000000000000000000000000000000..c28083dcbf5c7056145d1a0696116da66b5e9828 --- /dev/null +++ b/scripts/show_logs_telemetry-backend.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# 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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/telemetryservice -c backend diff --git a/scripts/show_logs_telemetry-frontend.sh b/scripts/show_logs_telemetry-frontend.sh new file mode 100755 index 0000000000000000000000000000000000000000..821dc275b22ebf7ffc63d2e8c41dfab684407895 --- /dev/null +++ b/scripts/show_logs_telemetry-frontend.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# 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. + +######################################################################################################################## +# Define your deployment settings here +######################################################################################################################## + +# If not already set, set the name of the Kubernetes namespace to deploy to. +export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"} + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + +kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/telemetryservice -c frontend diff --git a/src/analytics/requirements.in b/src/analytics/requirements.in index 8ff30ddaad25c39713f2e6f68c8d9aebed74dad0..cb5febf0d3badabd4eac8774af8c2b73c2f6627c 100644 --- a/src/analytics/requirements.in +++ b/src/analytics/requirements.in @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -java==11.0.* pyspark==3.5.2 confluent-kafka==2.3.* psycopg2-binary==2.9.* diff --git a/src/kpi_value_api/.gitlab-ci.yml b/src/kpi_value_api/.gitlab-ci.yml index 1a6f821ba9e798bb4220d914109ab3a65f0f1792..fef96d5b5bb6d4b33ea83419cb15051fdbf1d5ff 100644 --- a/src/kpi_value_api/.gitlab-ci.yml +++ b/src/kpi_value_api/.gitlab-ci.yml @@ -61,7 +61,8 @@ unit_test kpi-value-api: docker run --name zookeeper -d --network=teraflowbridge -p 2181:2181 bitnami/zookeeper:latest - sleep 10 # Wait for Zookeeper to start - - docker run --name kafka -d --network=teraflowbridge -p 9092:9092 + - > + docker run --name kafka -d --network=teraflowbridge -p 9092:9092 --env KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 --env ALLOW_PLAINTEXT_LISTENER=yes bitnami/kafka:latest diff --git a/src/kpi_value_writer/.gitlab-ci.yml b/src/kpi_value_writer/.gitlab-ci.yml index 9a2f9fd47e435b26e2e3a335bd9b95da58a0517f..4b36165d02327332766197676d76da098a857045 100644 --- a/src/kpi_value_writer/.gitlab-ci.yml +++ b/src/kpi_value_writer/.gitlab-ci.yml @@ -61,7 +61,8 @@ unit_test kpi-value-writer: docker run --name zookeeper -d --network=teraflowbridge -p 2181:2181 bitnami/zookeeper:latest - sleep 10 # Wait for Zookeeper to start - - docker run --name kafka -d --network=teraflowbridge -p 9092:9092 + - > + docker run --name kafka -d --network=teraflowbridge -p 9092:9092 --env KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 --env ALLOW_PLAINTEXT_LISTENER=yes bitnami/kafka:latest diff --git a/src/telemetry/.gitlab-ci.yml b/src/telemetry/.gitlab-ci.yml index 110a6490d20558c6589550be45b6432e500ba9d6..48fd2f49384770acacbba551443c68e3e0950475 100644 --- a/src/telemetry/.gitlab-ci.yml +++ b/src/telemetry/.gitlab-ci.yml @@ -71,7 +71,8 @@ unit_test telemetry-backend: docker run --name zookeeper -d --network=teraflowbridge -p 2181:2181 bitnami/zookeeper:latest - sleep 10 # Wait for Zookeeper to start - - docker run --name kafka -d --network=teraflowbridge -p 9092:9092 + - > + docker run --name kafka -d --network=teraflowbridge -p 9092:9092 --env KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 --env ALLOW_PLAINTEXT_LISTENER=yes bitnami/kafka:latest