Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • tfs/controller
1 result
Show changes
Showing
with 709 additions and 21 deletions
# 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.
apiVersion: apps/v1
kind: Deployment
metadata:
name: kpi-value-writerservice
spec:
selector:
matchLabels:
app: kpi-value-writerservice
#replicas: 1
template:
metadata:
annotations:
config.linkerd.io/skip-outbound-ports: "4222"
labels:
app: kpi-value-writerservice
spec:
terminationGracePeriodSeconds: 5
containers:
- name: server
image: labs.etsi.org:5050/tfs/controller/kpi_value_writer:latest
imagePullPolicy: Always
ports:
- containerPort: 30030
- containerPort: 9192
env:
- name: LOG_LEVEL
value: "INFO"
envFrom:
- secretRef:
name: kfk-kpi-data
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:30030"]
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:30030"]
resources:
requests:
cpu: 250m
memory: 128Mi
limits:
cpu: 1000m
memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
name: kpi-value-writerservice
labels:
app: kpi-value-writerservice
spec:
type: ClusterIP
selector:
app: kpi-value-writerservice
ports:
- name: grpc
protocol: TCP
port: 30030
targetPort: 30030
- name: metrics
protocol: TCP
port: 9192
targetPort: 9192
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: kpi-value-writerservice-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: kpi-value-writerservice
minReplicas: 1
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
#behavior:
# scaleDown:
# stabilizationWindowSeconds: 30
# 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.
container:
image:
tags: 2.9-alpine
env:
# different from k8s units, suffix must be B, KiB, MiB, GiB, or TiB
# should be ~90% of memory limit
GOMEMLIMIT: 400MiB
merge:
# recommended limit is at least 2 CPU cores and 8Gi Memory for production JetStream clusters
resources:
requests:
cpu: 1
memory: 500Mi
limits:
cpu: 1
memory: 1Gi
config:
cluster:
enabled: true
replicas: 3
jetstream:
enabled: true
fileStore:
pvc:
size: 4Gi
# Force one pod per node, if possible
podTemplate:
topologySpreadConstraints:
kubernetes.io/hostname:
maxSkew: 1
whenUnsatisfiable: ScheduleAnyway
......@@ -18,6 +18,11 @@ metadata:
name: tfs-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/limit-rps: "50"
nginx.ingress.kubernetes.io/limit-connections: "50"
nginx.ingress.kubernetes.io/proxy-connect-timeout: "50"
nginx.ingress.kubernetes.io/proxy-send-timeout: "50"
nginx.ingress.kubernetes.io/proxy-read-timeout: "50"
spec:
rules:
- http:
......
# 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.
apiVersion: apps/v1
kind: Deployment
metadata:
name: telemetryservice
spec:
selector:
matchLabels:
app: telemetryservice
#replicas: 1
template:
metadata:
labels:
app: telemetryservice
spec:
terminationGracePeriodSeconds: 5
containers:
- name: frontend
image: labs.etsi.org:5050/tfs/controller/telemetry-frontend:latest
imagePullPolicy: Always
ports:
- containerPort: 30050
- containerPort: 9192
env:
- name: LOG_LEVEL
value: "INFO"
envFrom:
- secretRef:
name: crdb-telemetry
- secretRef:
name: kfk-kpi-data
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:30050"]
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:30050"]
resources:
requests:
cpu: 250m
memory: 128Mi
limits:
cpu: 1000m
memory: 1024Mi
- name: backend
image: labs.etsi.org:5050/tfs/controller/telemetry-backend:latest
imagePullPolicy: Always
ports:
- containerPort: 30060
- containerPort: 9192
env:
- name: LOG_LEVEL
value: "INFO"
envFrom:
- secretRef:
name: kfk-kpi-data
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:30060"]
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:30060"]
resources:
requests:
cpu: 250m
memory: 128Mi
limits:
cpu: 1000m
memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
name: telemetryservice
labels:
app: telemetryservice
spec:
type: ClusterIP
selector:
app: telemetryservice
ports:
- name: frontend-grpc
protocol: TCP
port: 30050
targetPort: 30050
- name: backend-grpc
protocol: TCP
port: 30060
targetPort: 30060
- name: metrics
protocol: TCP
port: 9192
targetPort: 9192
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: telemetryservice-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: telemetryservice
minReplicas: 1
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
#behavior:
# scaleDown:
# stabilizationWindowSeconds: 30
......@@ -117,3 +117,25 @@ spec:
- name: grafana
port: 3000
targetPort: 3000
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: webuiservice-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: webuiservice
minReplicas: 1
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
#behavior:
# scaleDown:
# stabilizationWindowSeconds: 30
......@@ -22,9 +22,12 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/"
# Set the list of components, separated by spaces, you want to build images for, and deploy.
export TFS_COMPONENTS="context device pathcomp service slice nbi webui load_generator"
# Uncomment to activate Monitoring
# Uncomment to activate Monitoring (old)
#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
# Uncomment to activate Monitoring Framework (new)
#export TFS_COMPONENTS="${TFS_COMPONENTS} kpi_manager kpi_value_writer kpi_value_api"
# Uncomment to activate BGP-LS Speaker
#export TFS_COMPONENTS="${TFS_COMPONENTS} bgpls_speaker"
......@@ -69,7 +72,7 @@ export TFS_K8S_NAMESPACE="tfs"
export TFS_EXTRA_MANIFESTS="manifests/nginx_ingress_http.yaml"
# Uncomment to monitor performance of components
export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml"
#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/servicemonitors.yaml"
# Uncomment when deploying Optical CyberSecurity
#export TFS_EXTRA_MANIFESTS="${TFS_EXTRA_MANIFESTS} manifests/cachingservice.yaml"
......@@ -123,6 +126,10 @@ export NATS_EXT_PORT_CLIENT="4222"
# Set the external port NATS HTTP Mgmt GUI interface will be exposed to.
export NATS_EXT_PORT_HTTP="8222"
# Set NATS installation mode to 'single'. This option is convenient for development and testing.
# See ./deploy/all.sh or ./deploy/nats.sh for additional details
export NATS_DEPLOY_MODE="single"
# Disable flag for re-deploying NATS from scratch.
export NATS_REDEPLOY=""
......@@ -167,3 +174,15 @@ export PROM_EXT_PORT_HTTP="9090"
# Set the external port Grafana HTTP Dashboards will be exposed to.
export GRAF_EXT_PORT_HTTP="3000"
# ----- Apache Kafka -----------------------------------------------------------
# Set the namespace where Apache Kafka will be deployed.
export KFK_NAMESPACE="kafka"
# Set the port Apache Kafka server will be exposed to.
export KFK_SERVER_PORT="9092"
# Set the flag to YES for redeploying of Apache Kafka
export KFK_REDEPLOY=""
......@@ -46,6 +46,7 @@ message AclMatch {
uint32 dst_port = 6;
uint32 start_mpls_label = 7;
uint32 end_mpls_label = 8;
string tcp_flags = 9;
}
message AclAction {
......
// 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.
syntax = "proto3";
package analytics_frontend;
import "context.proto";
import "kpi_manager.proto";
//import "kpi_sample_types.proto";
service AnalyticsFrontendService {
rpc StartAnalyzer (Analyzer ) returns (AnalyzerId ) {}
rpc StopAnalyzer (AnalyzerId ) returns (context.Empty) {}
rpc SelectAnalyzers(AnalyzerFilter) returns (AnalyzerList ) {}
}
message AnalyzerId {
context.Uuid analyzer_id = 1;
}
enum AnalyzerOperationMode {
ANALYZEROPERATIONMODE_UNSPECIFIED = 0;
ANALYZEROPERATIONMODE_BATCH = 1;
ANALYZEROPERATIONMODE_STREAMING = 2;
}
// duration field may be added in analyzer...
message Analyzer {
AnalyzerId analyzer_id = 1;
string algorithm_name = 2; // The algorithm to be executed
float duration_s = 3; // Termiate the data analytics thread after duration (seconds); 0 = infinity time
repeated kpi_manager.KpiId input_kpi_ids = 4; // The KPI Ids to be processed by the analyzer
repeated kpi_manager.KpiId output_kpi_ids = 5; // The KPI Ids produced by the analyzer
AnalyzerOperationMode operation_mode = 6; // Operation mode of the analyzer
map<string, string> parameters = 7; // Add dictionary of (key, value) pairs such as (window_size, 10) etc.
// In batch mode...
float batch_min_duration_s = 8; // ..., min duration to collect before executing batch
float batch_max_duration_s = 9; // ..., max duration collected to execute the batch
uint64 batch_min_size = 10; // ..., min number of samples to collect before executing batch
uint64 batch_max_size = 11; // ..., max number of samples collected to execute the batch
}
message AnalyzerFilter {
// Analyzer that fulfill the filter are those that match ALL the following fields.
// An empty list means: any value is accepted.
// All fields empty means: list all Analyzers
repeated AnalyzerId analyzer_id = 1;
repeated string algorithm_names = 2;
repeated kpi_manager.KpiId input_kpi_ids = 3;
repeated kpi_manager.KpiId output_kpi_ids = 4;
//repeated kpi_sample_types.KpiSampleType kpi_sample_type = 5; // Not implemented
//repeated context.DeviceId device_id = 6; // Not implemented
//repeated context.EndPointId endpoint_id = 7; // Not implemented
//repeated context.ServiceId service_id = 8; // Not implemented
//repeated context.SliceId slice_id = 9; // Not implemented
//repeated context.ConnectionId connection_id = 10; // Not implemented
//repeated context.LinkId link_id = 11; // Not implemented
}
message AnalyzerList {
repeated Analyzer analyzer_list = 1;
}
......@@ -16,7 +16,7 @@ syntax = "proto3";
package device;
import "context.proto";
import "monitoring.proto";
import "monitoring.proto"; // to be migrated to: "kpi_manager.proto"
service DeviceService {
rpc AddDevice (context.Device ) returns (context.DeviceId ) {}
......@@ -27,8 +27,8 @@ service DeviceService {
}
message MonitoringSettings {
monitoring.KpiId kpi_id = 1;
monitoring.KpiDescriptor kpi_descriptor = 2;
float sampling_duration_s = 3;
float sampling_interval_s = 4;
monitoring.KpiId kpi_id = 1; // to be migrated to: "kpi_manager.KpiId"
monitoring.KpiDescriptor kpi_descriptor = 2; // to be migrated to: "kpi_manager.KpiDescriptor"
float sampling_duration_s = 3;
float sampling_interval_s = 4;
}
// 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.
syntax = "proto3";
package kpi_manager;
import "context.proto";
import "kpi_sample_types.proto";
service KpiManagerService {
rpc SetKpiDescriptor (KpiDescriptor ) returns (KpiId ) {}
rpc DeleteKpiDescriptor (KpiId ) returns (context.Empty ) {}
rpc GetKpiDescriptor (KpiId ) returns (KpiDescriptor ) {}
rpc SelectKpiDescriptor (KpiDescriptorFilter) returns (KpiDescriptorList ) {}
}
message KpiId {
context.Uuid kpi_id = 1;
}
message KpiDescriptor {
KpiId kpi_id = 1;
string kpi_description = 2;
kpi_sample_types.KpiSampleType kpi_sample_type = 3;
context.DeviceId device_id = 4;
context.EndPointId endpoint_id = 5;
context.ServiceId service_id = 6;
context.SliceId slice_id = 7;
context.ConnectionId connection_id = 8;
context.LinkId link_id = 9;
}
message KpiDescriptorFilter {
// KPI Descriptors that fulfill the filter are those that match ALL the following fields.
// An empty list means: any value is accepted.
// All fields empty means: list all KPI Descriptors
repeated KpiId kpi_id = 1;
repeated kpi_sample_types.KpiSampleType kpi_sample_type = 2;
repeated context.DeviceId device_id = 3;
repeated context.EndPointId endpoint_id = 4;
repeated context.ServiceId service_id = 5;
repeated context.SliceId slice_id = 6;
repeated context.ConnectionId connection_id = 7;
repeated context.LinkId link_id = 8;
}
message KpiDescriptorList {
repeated KpiDescriptor kpi_descriptor_list = 1;
}
// 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.
syntax = "proto3";
package kpi_value_api;
import "context.proto";
import "kpi_manager.proto";
service KpiValueAPIService {
rpc StoreKpiValues (KpiValueList) returns (context.Empty) {}
rpc SelectKpiValues (KpiValueFilter) returns (KpiValueList) {}
}
message KpiValue {
kpi_manager.KpiId kpi_id = 1;
context.Timestamp timestamp = 2;
KpiValueType kpi_value_type = 3;
}
message KpiValueList {
repeated KpiValue kpi_value_list = 1;
}
message KpiValueType {
oneof value {
int32 int32Val = 1;
uint32 uint32Val = 2;
int64 int64Val = 3;
uint64 uint64Val = 4;
float floatVal = 5;
string stringVal = 6;
bool boolVal = 7;
}
}
message KpiValueFilter {
repeated kpi_manager.KpiId kpi_id = 1;
repeated context.Timestamp start_timestamp = 2;
repeated context.Timestamp end_timestamp = 3;
}
......@@ -145,12 +145,12 @@ message SubsList {
}
message AlarmDescriptor {
AlarmID alarm_id = 1;
string alarm_description = 2;
string name = 3;
KpiId kpi_id = 4;
KpiValueRange kpi_value_range = 5;
context.Timestamp timestamp = 6;
AlarmID alarm_id = 1;
string alarm_description = 2;
string name = 3;
KpiId kpi_id = 4;
KpiValueRange kpi_value_range = 5;
context.Timestamp timestamp = 6;
}
message AlarmID{
......@@ -170,5 +170,5 @@ message AlarmResponse {
}
message AlarmList {
repeated AlarmDescriptor alarm_descriptor = 1;
repeated AlarmDescriptor alarm_descriptor = 1;
}
......@@ -12,12 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// protocol buffers documentation: https://developers.google.com/protocol-buffers/docs/proto3
syntax = "proto3";
package optical_attack_detector;
import "context.proto";
import "monitoring.proto";
import "monitoring.proto"; // to be migrated to: "kpi_manager.proto"
service OpticalAttackDetectorService {
......@@ -28,5 +27,5 @@ service OpticalAttackDetectorService {
message DetectionRequest {
context.ServiceId service_id = 1;
monitoring.KpiId kpi_id = 2;
monitoring.KpiId kpi_id = 2; // to be migrated to: "kpi_manager.KpiId"
}
......@@ -15,13 +15,13 @@
syntax = "proto3";
package policy;
import "monitoring.proto";
import "monitoring.proto"; // to be migrated to: "kpi_manager.proto"
// Condition
message PolicyRuleCondition {
monitoring.KpiId kpiId = 1;
NumericalOperator numericalOperator = 2;
monitoring.KpiValue kpiValue = 3;
monitoring.KpiId kpiId = 1; // to be migrated to: "kpi_manager.KpiId"
NumericalOperator numericalOperator = 2;
monitoring.KpiValue kpiValue = 3;
}
// Operator to be used when comparing Kpis with condition values
......
// 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.
syntax = "proto3";
package telemetry_frontend;
import "context.proto";
import "kpi_manager.proto";
service TelemetryFrontendService {
rpc StartCollector (Collector ) returns (CollectorId ) {}
rpc StopCollector (CollectorId ) returns (context.Empty) {}
rpc SelectCollectors (CollectorFilter) returns (CollectorList) {}
}
message CollectorId {
context.Uuid collector_id = 1;
}
message Collector {
CollectorId collector_id = 1; // The Collector ID
kpi_manager.KpiId kpi_id = 2; // The KPI Id to be associated to the collected samples
float duration_s = 3; // Terminate data collection after duration[seconds]; duration==0 means indefinitely
float interval_s = 4; // Interval between collected samples
context.Timestamp start_time = 5; // Timestamp when Collector start execution
context.Timestamp end_time = 6; // Timestamp when Collector stop execution
}
message CollectorFilter {
// Collector that fulfill the filter are those that match ALL the following fields.
// An empty list means: any value is accepted.
// All fields empty means: list all Collectors
repeated CollectorId collector_id = 1;
repeated kpi_manager.KpiId kpi_id = 2;
}
message CollectorList {
repeated Collector collector_list = 1;
}
#!/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/tests/test_analytics_db.py
#!/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/frontend/tests/test_frontend.py
#!/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
# coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
# kpi_manager/tests/test_unitary.py
# python3 kpi_manager/tests/test_unitary.py
RCFILE=$PROJECTDIR/coverage/.coveragerc
CRDB_SQL_ADDRESS=$(kubectl --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -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 \
kpi_manager/tests/test_kpi_db.py
#!/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
# coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
# kpi_manager/tests/test_unitary.py
# python3 kpi_manager/tests/test_unitary.py
RCFILE=$PROJECTDIR/coverage/.coveragerc
CRDB_SQL_ADDRESS=$(kubectl get service cockroachdb-public --namespace ${CRDB_NAMESPACE} -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 \
kpi_manager/tests/test_kpi_manager.py
#!/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 --namespace ${CRDB_NAMESPACE} get service cockroachdb-public -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 \
kpi_value_writer/tests/test_metric_writer_to_prom.py