Commit 173af90f authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Load Generator component:

- Converted load_gen tool into a microservice
- Added simple WebUI page to manage it
- Created manifests, Dockerfile, etc.
- Created proto file to manage the load generator
parent ecc32069
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -43,3 +43,4 @@ include:
  #- local: '/src/interdomain/.gitlab-ci.yml'
  - local: '/src/pathcomp/.gitlab-ci.yml'
  #- local: '/src/dlt/.gitlab-ci.yml'
  - local: '/src/load_generator/.gitlab-ci.yml'
+67 −0
Original line number Diff line number Diff line
# Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
#
# 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: load-generatorservice
spec:
  selector:
    matchLabels:
      app: load-generatorservice
  replicas: 1
  template:
    metadata:
      labels:
        app: load-generatorservice
    spec:
      terminationGracePeriodSeconds: 5
      containers:
      - name: server
        image: registry.gitlab.com/teraflow-h2020/controller/load_generator:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 50052
        env:
        - name: LOG_LEVEL
          value: "INFO"
        readinessProbe:
          exec:
            command: ["/bin/grpc_health_probe", "-addr=:50052"]
        livenessProbe:
          exec:
            command: ["/bin/grpc_health_probe", "-addr=:50052"]
        resources:
          requests:
            cpu: 50m
            memory: 64Mi
          limits:
            cpu: 500m
            memory: 512Mi
---
apiVersion: v1
kind: Service
metadata:
  name: load-generatorservice
  labels:
    app: load-generatorservice
spec:
  type: ClusterIP
  selector:
    app: load-generatorservice
  ports:
  - name: grpc
    protocol: TCP
    port: 50052
    targetPort: 50052
+23 −0
Original line number Diff line number Diff line
// Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
//
// 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 load_generator;

import "context.proto";

service LoadGeneratorService {
  rpc Start(context.Empty) returns (context.Empty) {}
  rpc Stop (context.Empty) returns (context.Empty) {}
}
+4 −2
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ class ServiceNameEnum(Enum):

    # Used for test and debugging only
    DLT_GATEWAY    = 'dltgateway'
    LOAD_GENERATOR = 'load_generator'

# Default gRPC service ports
DEFAULT_SERVICE_GRPC_PORTS = {
@@ -73,6 +74,7 @@ DEFAULT_SERVICE_GRPC_PORTS = {

    # Used for test and debugging only
    ServiceNameEnum.DLT_GATEWAY   .value : 50051,
    ServiceNameEnum.LOAD_GENERATOR.value : 50052,
}

# Default HTTP/REST-API service ports
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ export TFS_REGISTRY_IMAGE="http://localhost:32000/tfs/"
#   interdomain slice pathcomp dlt
#   dbscanserving opticalattackmitigator opticalattackdetector
#   l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector
export TFS_COMPONENTS="context device pathcomp service slice webui" # automation monitoring compute
export TFS_COMPONENTS="context device pathcomp service slice webui load_generator" # automation monitoring compute

# Set the tag you want to use for your images.
export TFS_IMAGE_TAG="dev"
Loading