Resolve "(CTTC) Forecaster component"

Closes #1 (closed)

Merge request reports

Loading
+101 −0
Changes for manifests/forecasterservice.yaml: 101 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Copyright 2022-2023 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
#
# 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: forecasterservice
spec:
  selector:
    matchLabels:
      app: forecasterservice
  #replicas: 1
  template:
    metadata:
      labels:
        app: forecasterservice
    spec:
      terminationGracePeriodSeconds: 5
      containers:
      - name: server
        image: labs.etsi.org:5050/tfs/controller/forecaster:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 10040
        - containerPort: 9192
        env:
        - name: LOG_LEVEL
          value: "INFO"
        - name: FORECAST_TO_HISTORY_RATIO
          value: "10"
        startupProbe:
          exec:
            command: ["/bin/grpc_health_probe", "-addr=:10040"]
          failureThreshold: 30
          periodSeconds: 1
        readinessProbe:
          exec:
            command: ["/bin/grpc_health_probe", "-addr=:10040"]
        livenessProbe:
          exec:
            command: ["/bin/grpc_health_probe", "-addr=:10040"]
        resources:
          requests:
            cpu: 250m
            memory: 128Mi
          limits:
            cpu: 1000m
            memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
  name: forecasterservice
  labels:
    app: forecasterservice
spec:
  type: ClusterIP
  selector:
    app: forecasterservice
  ports:
  - name: grpc
    protocol: TCP
    port: 10040
    targetPort: 10040
  - name: metrics
    protocol: TCP
    port: 9192
    targetPort: 9192
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: forecasterservice-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: forecasterservice
  minReplicas: 1
  maxReplicas: 20
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 80
  #behavior:
  #  scaleDown:
  #    stabilizationWindowSeconds: 30
+2 −0
Changes for manifests/pathcompservice.yaml: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ spec:
        env:
        - name: LOG_LEVEL
          value: "INFO"
        - name: ENABLE_FORECASTER
          value: "YES"
        readinessProbe:
          exec:
            command: ["/bin/grpc_health_probe", "-addr=:10020"]
+6 −0
Changes for proto/context.proto: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -236,10 +236,16 @@ message LinkId {
  Uuid link_uuid = 1;
}

message LinkAttributes {
  float total_capacity_gbps = 1;
  float used_capacity_gbps  = 2;
}

message Link {
  LinkId link_id = 1;
  string name = 2;
  repeated EndPointId link_endpoint_ids = 3;
  LinkAttributes attributes = 4;
}

message LinkIdList {
+16 −17
Changes for proto/forecaster.proto: 16 added lines, 17 removed lines.
Original line number Diff line number Diff line
@@ -18,28 +18,27 @@ package forecaster;
import "context.proto";

service ForecasterService {
  rpc GetForecastOfTopology (context.TopologyId) returns (Forecast) {}
  rpc GetForecastOfLink(context.LinkId) returns (Forecast) {}
  rpc CheckService (context.ServiceId) returns (ForecastPrediction) {}
  rpc ForecastLinkCapacity    (ForecastLinkCapacityRequest    ) returns (ForecastLinkCapacityReply    ) {}
  rpc ForecastTopologyCapacity(ForecastTopologyCapacityRequest) returns (ForecastTopologyCapacityReply) {}
}

message SingleForecast {
  context.Timestamp timestamp= 1;
  double value = 2;    
message ForecastLinkCapacityRequest {
  context.LinkId link_id                 = 1;
  float          forecast_window_seconds = 2;
}

message Forecast {
    oneof uuid {
      context.TopologyId topologyId= 1;
      context.LinkId linkId = 2;
    }
    repeated SingleForecast forecast = 3;
message ForecastLinkCapacityReply {
  context.LinkId link_id                     = 1;
  float          total_capacity_gbps         = 2;
  float          current_used_capacity_gbps  = 3;
  float          forecast_used_capacity_gbps = 4;
}

enum AvailabilityPredictionEnum {
    FORECASTED_AVAILABILITY = 0;
    FORECASTED_UNAVAILABILITY = 1;
message ForecastTopologyCapacityRequest {
  context.TopologyId topology_id             = 1;
  float              forecast_window_seconds = 2;
}
message ForecastPrediction {
    AvailabilityPredictionEnum prediction = 1;

message ForecastTopologyCapacityReply {
  repeated ForecastLinkCapacityReply link_capacities = 1;
}
+8 −0
Changes for proto/kpi_sample_types.proto: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -17,18 +17,26 @@ package kpi_sample_types;

enum KpiSampleType {
    KPISAMPLETYPE_UNKNOWN                       = 0;

    KPISAMPLETYPE_PACKETS_TRANSMITTED           = 101;
    KPISAMPLETYPE_PACKETS_RECEIVED              = 102;
    KPISAMPLETYPE_PACKETS_DROPPED               = 103;
    KPISAMPLETYPE_BYTES_TRANSMITTED             = 201;
    KPISAMPLETYPE_BYTES_RECEIVED                = 202;
    KPISAMPLETYPE_BYTES_DROPPED                 = 203;

    KPISAMPLETYPE_LINK_TOTAL_CAPACITY_GBPS      = 301;
    KPISAMPLETYPE_LINK_USED_CAPACITY_GBPS       = 302;

    KPISAMPLETYPE_ML_CONFIDENCE                 = 401;  //. can be used by both optical and L3 without any issue

    KPISAMPLETYPE_OPTICAL_SECURITY_STATUS       = 501;  //. can be used by both optical and L3 without any issue

    KPISAMPLETYPE_L3_UNIQUE_ATTACK_CONNS        = 601;
    KPISAMPLETYPE_L3_TOTAL_DROPPED_PACKTS       = 602;
    KPISAMPLETYPE_L3_UNIQUE_ATTACKERS           = 603;
    KPISAMPLETYPE_L3_UNIQUE_COMPROMISED_CLIENTS = 604;
    KPISAMPLETYPE_L3_SECURITY_STATUS_CRYPTO     = 605;

    KPISAMPLETYPE_SERVICE_LATENCY_MS            = 701;
}
Loading
Loading