Commit 8a11726e authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch 'develop' of https://gitlab.com/teraflow-h2020/controller into...

Merge branch 'develop' of https://gitlab.com/teraflow-h2020/controller into feat/ecoc22-dc-interconnect-disjoint
parents fc145563 0ca57a98
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
# TeraFlow OS SDN Controller
# TeraFlowSDN Controller

[Teraflow H2020 project](https://teraflow-h2020.eu/) - Secured autonomic traffic management for a Tera of SDN Flows

@@ -7,13 +7,4 @@ Branch "master" : [![pipeline status](https://gitlab.com/teraflow-h2020/controll
Branch "develop" : [![pipeline status](https://gitlab.com/teraflow-h2020/controller/badges/develop/pipeline.svg)](https://gitlab.com/teraflow-h2020/controller/-/commits/develop) [![coverage report](https://gitlab.com/teraflow-h2020/controller/badges/develop/coverage.svg)](https://gitlab.com/teraflow-h2020/controller/-/commits/develop)

# Installation Instructions
To install TeraFlow OS SDN Controller in your local Kubernetes deployment, we assume you deployed Kubernetes following the instructions provided in [Wiki: Installing Kubernetes on your Linux machine](https://gitlab.com/teraflow-h2020/controller/-/wikis/Installing-Kubernetes-on-your-Linux-machine).

Then, follow the instructions in [Wiki: Deploying a TeraFlow OS test instance](https://gitlab.com/teraflow-h2020/controller/-/wikis/Deploying-a-TeraFlow-OS-test-instance) to deploy your instance of TeraFlow OS.

# Functional Tests
A functional test has been defined to enable experimentation with the TeraFlow OS:

__Important:__ The OpenConfigDriver, the P4Driver, and the TrandportApiDriver have to be considered as experimental. The configuration and monitoring capabilities they support are limited or partially implemented. Use them with care.

[Demo at OFC'22 (Bootstrap devices, Manage L3VPN services, Monitor Device Endpoints)](./src/tests/ofc22)
For devel and upcoming release 2.0, we have prepared the following tutorial: [TeraFlowSDN tutorial](https://gitlab.com/teraflow-h2020/controller/-/tree/develop/tutorial).
+18 −7
Original line number Diff line number Diff line
@@ -280,8 +280,9 @@ message Slice {
  repeated ServiceId slice_service_ids = 4;
  repeated SliceId slice_subslice_ids = 5;
  SliceStatus slice_status = 6;
  SliceOwner slice_owner = 7;
  Timestamp timestamp = 8;
  SliceConfig slice_config = 7;
  SliceOwner slice_owner = 8;
  Timestamp timestamp = 9;
}

message SliceOwner {
@@ -302,6 +303,10 @@ message SliceStatus {
  SliceStatusEnum slice_status = 1;
}

message SliceConfig {
  repeated ConfigRule config_rules = 1;
}

message SliceIdList {
  repeated SliceId slice_ids = 1;
}
@@ -446,6 +451,11 @@ message Constraint_EndPointLocation {
  Location location = 2;
}

message Constraint_EndPointPriority {
  EndPointId endpoint_id = 1;
  uint32 priority = 2;
}

message Constraint_SLA_Latency {
  float e2e_latency_ms = 1;
}
@@ -472,7 +482,7 @@ enum IsolationLevelEnum {
}

message Constraint_SLA_Isolation_level {
  IsolationLevelEnum isolation_level = 1;
  repeated IsolationLevelEnum isolation_level = 1;
}

message Constraint {
@@ -480,10 +490,11 @@ message Constraint {
    Constraint_Custom custom = 1;
    Constraint_Schedule schedule = 2;
    Constraint_EndPointLocation endpoint_location = 3;
    Constraint_SLA_Capacity sla_capacity = 4;
    Constraint_SLA_Latency sla_latency = 5;
    Constraint_SLA_Availability sla_availability = 6;
    Constraint_SLA_Isolation_level sla_isolation = 7;
    Constraint_EndPointPriority endpoint_priority = 4;
    Constraint_SLA_Capacity sla_capacity = 5;
    Constraint_SLA_Latency sla_latency = 6;
    Constraint_SLA_Availability sla_availability = 7;
    Constraint_SLA_Isolation_level sla_isolation = 8;
  }
}

+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ RCFILE=$PROJECTDIR/coverage/.coveragerc
K8S_NAMESPACE="tf-dev"
K8S_HOSTNAME="kubernetes-master"

kubectl --namespace $K8S_NAMESPACE expose deployment contextservice --port=6379 --name=redis-tests --type=NodePort
export REDIS_SERVICE_HOST=$(kubectl get node $K8S_HOSTNAME -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}')
export REDIS_SERVICE_PORT=$(kubectl get service redis-tests --namespace $K8S_NAMESPACE -o 'jsonpath={.spec.ports[?(@.port==6379)].nodePort}')

+9 −5
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package eu.teraflow.automation;

import eu.teraflow.automation.context.ContextService;
import eu.teraflow.automation.context.model.Event;
import eu.teraflow.automation.context.model.EventTypeEnum;
import io.quarkus.runtime.StartupEvent;
import java.time.Duration;
import javax.enterprise.context.ApplicationScoped;
@@ -75,11 +77,7 @@ public class ContextSubscriber {
                                case UPDATE:
                                case REMOVE:
                                case UNDEFINED:
                                    {
                                        LOGGER.warnf(
                                                "Received %s for device [%s]. [%s] event handling is not yet implemented, ignoring...",
                                                event, deviceId, eventType);
                                    }
                                    logWarningMessage(event, deviceId, eventType);
                                    break;
                            }
                        });
@@ -94,4 +92,10 @@ public class ContextSubscriber {
            LOGGER.info("Not subscribing to Context service for device events...");
        }
    }

    private void logWarningMessage(Event event, String deviceId, EventTypeEnum eventType) {
        LOGGER.warnf(
                "Received %s for device [%s]. [%s] event handling is not yet implemented, ignoring...",
                event, deviceId, eventType);
    }
}
+13 −4
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import context.ContextOuterClass.ConfigRule_Custom;
import context.ContextOuterClass.ContextId;
import context.ContextOuterClass.DeviceId;
import context.ContextOuterClass.DeviceOperationalStatusEnum;
import context.ContextOuterClass.Location.LocationCase;
import context.ContextOuterClass.Uuid;
import eu.teraflow.automation.acl.AclAction;
import eu.teraflow.automation.acl.AclEntry;
@@ -833,12 +834,14 @@ public class Serializer {
        final var serializedEndPointId = serialize(endPointId);
        final var serializedKpiSampleTypes =
                kpiSampleTypes.stream().map(this::serialize).collect(Collectors.toList());
        if (endPointLocation != null) {
            final var serializedEndPointLocation = serialize(endPointLocation);
            builder.setEndpointLocation(serializedEndPointLocation);
        }

        builder.setEndpointId(serializedEndPointId);
        builder.setEndpointType(endPointType);
        builder.addAllKpiSampleTypes(serializedKpiSampleTypes);
        builder.setEndpointLocation(serializedEndPointLocation);

        return builder.build();
    }
@@ -852,9 +855,15 @@ public class Serializer {
        final var endPointId = deserialize(serializedEndPointId);
        final var kpiSampleTypes =
                serializedKpiSampleTypes.stream().map(this::deserialize).collect(Collectors.toList());

        if (serializedEndPointLocation.getLocationCase() != LocationCase.LOCATION_NOT_SET) {
            final var endPointLocation = deserialize(serializedEndPointLocation);
            return new EndPoint.EndPointBuilder(endPointId, endPointType, kpiSampleTypes)
                    .location(endPointLocation)
                    .build();
        }

        return new EndPoint(endPointId, endPointType, kpiSampleTypes, endPointLocation);
        return new EndPoint.EndPointBuilder(endPointId, endPointType, kpiSampleTypes).build();
    }

    public ContextOuterClass.Device serialize(Device device) {
Loading