Commit 9b4cc17b authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch 'feat/slice-service' of...

Merge branch 'feat/slice-service' of https://gitlab.com/teraflow-h2020/controller into feat/interdomain
parents 1d7e485e 514c1d5b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24,3 +24,4 @@ include:
  - local: '/src/l3_distributedattackdetector/.gitlab-ci.yml'
  - local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml'
  - local: '/src/l3_attackmitigator/.gitlab-ci.yml'
  #- local: '/src/slice/.gitlab-ci.yml'
+54 −0
Original line number Diff line number Diff line
apiVersion: apps/v1
kind: Deployment
metadata:
  name: sliceservice
spec:
  selector:
    matchLabels:
      app: sliceservice
  template:
    metadata:
      labels:
        app: sliceservice
    spec:
      terminationGracePeriodSeconds: 5
      containers:
      - name: server
        image: registry.gitlab.com/teraflow-h2020/controller/slice:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 4040
        env:
        - name: DB_ENGINE
          value: "redis"
        - name: REDIS_DATABASE_ID
          value: "0"
        - name: LOG_LEVEL
          value: "DEBUG"
        readinessProbe:
          exec:
            command: ["/bin/grpc_health_probe", "-addr=:4040"]
        livenessProbe:
          exec:
            command: ["/bin/grpc_health_probe", "-addr=:4040"]
        resources:
          requests:
            cpu: 250m
            memory: 512Mi
          limits:
            cpu: 700m
            memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
  name: sliceservice
spec:
  type: ClusterIP
  selector:
    app: sliceservice
  ports:
  - name: grpc
    protocol: TCP
    port: 4040
    targetPort: 4040
+3 −0
Original line number Diff line number Diff line
#!/bin/bash

./report_coverage_all.sh | grep --color -E -i "^slice/.*$|$"
+28 −0
Original line number Diff line number Diff line
#!/bin/bash
# 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.


PROJECTDIR=`pwd`

cd $PROJECTDIR/src
RCFILE=$PROJECTDIR/coverage/.coveragerc

# Run unitary tests and analyze coverage of code at same time

# Useful flags for pytest:
#-o log_cli=true -o log_file=service.log -o log_file_level=DEBUG

coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
    slice/tests/test_unitary.py
+3 −0
Original line number Diff line number Diff line
@@ -94,3 +94,6 @@ coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \

coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
    monitoring/tests/test_unitary.py

coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
    slice/tests/test_unitary.py
Loading