Loading manifests/contextservice.yaml +0 −4 Original line number Diff line number Diff line Loading @@ -81,10 +81,6 @@ spec: selector: app: contextservice ports: - name: grpc protocol: TCP port: 1010 targetPort: 1010 - name: http protocol: TCP port: 8080 Loading proto/device.proto +8 −8 Original line number Diff line number Diff line Loading @@ -2,19 +2,19 @@ syntax = "proto3"; package device; import "context.proto"; import "monitoring.proto"; //import "monitoring.proto"; service DeviceService { rpc AddDevice (context.Device ) returns (context.DeviceId ) {} rpc ConfigureDevice (context.Device ) returns (context.DeviceId ) {} rpc DeleteDevice (context.DeviceId ) returns (context.Empty ) {} rpc GetInitialConfig(context.DeviceId ) returns (context.DeviceConfig) {} rpc MonitorDeviceKpi(MonitoringSettings) returns (context.Empty ) {} //rpc MonitorDeviceKpi(MonitoringSettings) returns (context.Empty ) {} } message MonitoringSettings { monitoring.KpiId kpi_id = 1; monitoring.KpiDescriptor kpi_descriptor = 2; float sampling_duration_s = 3; float sampling_interval_s = 4; } //message MonitoringSettings { // monitoring.KpiId kpi_id = 1; // monitoring.KpiDescriptor kpi_descriptor = 2; // float sampling_duration_s = 3; // float sampling_interval_s = 4; //} proto/kpi_sample_types.proto +8 −8 Original line number Diff line number Diff line syntax = "proto3"; package kpi_sample_types; //package kpi_sample_types; enum KpiSampleType { UNKNOWN = 0; PACKETS_TRANSMITTED = 101; PACKETS_RECEIVED = 102; BYTES_TRANSMITTED = 201; BYTES_RECEIVED = 202; } //enum KpiSampleType { // UNKNOWN = 0; // PACKETS_TRANSMITTED = 101; // PACKETS_RECEIVED = 102; // BYTES_TRANSMITTED = 201; // BYTES_RECEIVED = 202; //} proto/monitoring.proto +74 −22 Original line number Diff line number Diff line Loading @@ -2,30 +2,68 @@ syntax = "proto3"; package monitoring; import "context.proto"; import "kpi_sample_types.proto"; //import "kpi_sample_types.proto"; service MonitoringService { rpc CreateKpi (KpiDescriptor ) returns (KpiId ) {} rpc GetKpiDescriptor(KpiId ) returns (KpiDescriptor) {} rpc IncludeKpi (Kpi ) returns (context.Empty) {} // Old RPCs: rpc CreateKpi (CreateKpiRequest) returns (KpiId) {} rpc IncludeKpi (IncludeKpiRequest) returns (context.Empty) {} rpc MonitorKpi (MonitorKpiRequest) returns (context.Empty) {} rpc MonitorDeviceKpi (MonitorDeviceKpiRequest) returns (context.Empty) {} rpc GetStreamKpi ( KpiId ) returns (stream Kpi) {} rpc GetInstantKpi ( KpiId ) returns (Kpi) {} // New RPCs: //rpc CreateKpi (KpiDescriptor ) returns (KpiId ) {} //rpc GetKpiDescriptor(KpiId ) returns (KpiDescriptor) {} //rpc IncludeKpi (Kpi ) returns (context.Empty) {} //rpc MonitorKpi (MonitorKpiRequest) returns (context.Empty) {} //rpc GetStreamKpi (KpiId ) returns (stream Kpi ) {} //rpc GetInstantKpi (KpiId ) returns (Kpi ) {} } message KpiDescriptor { string kpi_description = 1; kpi_sample_types.KpiSampleType kpi_sample_type = 2; context.DeviceId device_id = 3; context.EndPointId endpoint_id = 4; context.ServiceId service_id = 5; // context.SliceId slice_id = 6; message CreateKpiRequest /*New name: KpiDescriptor*/ { // Old fields: string kpiDescription = 1; context.DeviceId device_id = 2; KpiSampleType kpi_sample_type = 3; // context.EndpointId endpoint_id = 4; // others might be added // context.ServiceId service_id = 5; // for monitoring other // context.SliceId slice_id = 6; // entities // New fields: //string kpi_description = 1; //kpi_sample_types.KpiSampleType kpi_sample_type = 2; //context.DeviceId device_id = 3; //context.EndPointId endpoint_id = 4; //context.ServiceId service_id = 5; ////context.SliceId slice_id = 6; // to be used in future features } message MonitorKpiRequest{ KpiId kpi_id = 1; float sampling_duration_s = 2; float sampling_interval_s = 3; // Old fields: uint32 connexion_time_s = 2; uint32 sample_rate_ms = 3; // New fields: //float sampling_duration_s = 2; //float sampling_interval_s = 3; } // Message to be removed: message MonitorDeviceKpiRequest{ Kpi kpi = 1; uint32 connexion_time_s = 2; uint32 sample_rate_ms = 3; } // Message to be removed: message IncludeKpiRequest{ KpiId kpi_id = 1; string time_stamp = 2; KpiValue kpi_value= 3; } message KpiId { Loading @@ -35,18 +73,32 @@ message KpiId { message Kpi { KpiId kpi_id = 1; string timestamp = 2; KpiValue kpi_value = 4; string kpiDescription = 3; // field to be removed KpiValue kpi_value = 4; // field to be renumbered to 3 KpiSampleType kpi_sample_type = 5; // field to be removed context.DeviceId device_id = 6; // field to be removed // context.EndpointId endpoint_id = 7; // others might be added // field to be removed // context.ServiceId service_id = 8; // for monitoring other // field to be removed // context.SliceId slice_id = 9; // entities // field to be removed } message KpiValue { oneof value { uint32 intVal = 1; float floatVal = 2; string stringVal = 3; bool boolVal = 4; uint32 intVal = 1; // field to be renamed to int_val float floatVal = 2; // field to be renamed to float_val string stringVal = 3; // field to be renamed to str_val bool boolVal = 4; // field to be renamed to bool_val } } message KpiList { repeated Kpi kpi_list = 1; repeated Kpi kpiList = 1; // to be renamed to kpi_list } enum KpiSampleType { // to be moved to file "kpi_sample_types.proto" UNKNOWN = 0; PACKETS_TRANSMITTED = 101; // others might be added for PACKETS_RECEIVED = 102; // packet, optical, radio,... BYTES_TRANSMITTED = 201; BYTES_RECEIVED = 202; } run_tests_locally.sh +9 −2 Original line number Diff line number Diff line Loading @@ -11,9 +11,16 @@ cat $PROJECTDIR/coverage/.coveragerc.template | sed s+~/teraflow/controller+$PRO # Run unitary tests and analyze coverage of code at same time # Populate environment variables for context to use Redis # Populate environment variables for context to use Redis in a development machine running Kubernetes # Uncomment below lines to create a Redis instance within Context for testing purposes. #kubectl delete namespace tf-dev #kubectl create namespace tf-dev #kubectl --namespace tf-dev apply -f ../manifests/contextservice.yaml #kubectl --namespace tf-dev expose deployment contextservice --port=6379 --type=NodePort --name=redis-tests #echo "Waiting 10 seconds for Redis to start..." #sleep 10 export REDIS_SERVICE_HOST=$(kubectl get node kubernetes-master -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') export REDIS_SERVICE_PORT=$(kubectl get service contextservice-public --namespace cttc-dev -o 'jsonpath={.spec.ports[?(@.port==6379)].nodePort}') export REDIS_SERVICE_PORT=$(kubectl get service redis-tests --namespace tf-dev -o 'jsonpath={.spec.ports[?(@.port==6379)].nodePort}') # First destroy old coverage file rm -f $COVERAGEFILE Loading Loading
manifests/contextservice.yaml +0 −4 Original line number Diff line number Diff line Loading @@ -81,10 +81,6 @@ spec: selector: app: contextservice ports: - name: grpc protocol: TCP port: 1010 targetPort: 1010 - name: http protocol: TCP port: 8080 Loading
proto/device.proto +8 −8 Original line number Diff line number Diff line Loading @@ -2,19 +2,19 @@ syntax = "proto3"; package device; import "context.proto"; import "monitoring.proto"; //import "monitoring.proto"; service DeviceService { rpc AddDevice (context.Device ) returns (context.DeviceId ) {} rpc ConfigureDevice (context.Device ) returns (context.DeviceId ) {} rpc DeleteDevice (context.DeviceId ) returns (context.Empty ) {} rpc GetInitialConfig(context.DeviceId ) returns (context.DeviceConfig) {} rpc MonitorDeviceKpi(MonitoringSettings) returns (context.Empty ) {} //rpc MonitorDeviceKpi(MonitoringSettings) returns (context.Empty ) {} } message MonitoringSettings { monitoring.KpiId kpi_id = 1; monitoring.KpiDescriptor kpi_descriptor = 2; float sampling_duration_s = 3; float sampling_interval_s = 4; } //message MonitoringSettings { // monitoring.KpiId kpi_id = 1; // monitoring.KpiDescriptor kpi_descriptor = 2; // float sampling_duration_s = 3; // float sampling_interval_s = 4; //}
proto/kpi_sample_types.proto +8 −8 Original line number Diff line number Diff line syntax = "proto3"; package kpi_sample_types; //package kpi_sample_types; enum KpiSampleType { UNKNOWN = 0; PACKETS_TRANSMITTED = 101; PACKETS_RECEIVED = 102; BYTES_TRANSMITTED = 201; BYTES_RECEIVED = 202; } //enum KpiSampleType { // UNKNOWN = 0; // PACKETS_TRANSMITTED = 101; // PACKETS_RECEIVED = 102; // BYTES_TRANSMITTED = 201; // BYTES_RECEIVED = 202; //}
proto/monitoring.proto +74 −22 Original line number Diff line number Diff line Loading @@ -2,30 +2,68 @@ syntax = "proto3"; package monitoring; import "context.proto"; import "kpi_sample_types.proto"; //import "kpi_sample_types.proto"; service MonitoringService { rpc CreateKpi (KpiDescriptor ) returns (KpiId ) {} rpc GetKpiDescriptor(KpiId ) returns (KpiDescriptor) {} rpc IncludeKpi (Kpi ) returns (context.Empty) {} // Old RPCs: rpc CreateKpi (CreateKpiRequest) returns (KpiId) {} rpc IncludeKpi (IncludeKpiRequest) returns (context.Empty) {} rpc MonitorKpi (MonitorKpiRequest) returns (context.Empty) {} rpc MonitorDeviceKpi (MonitorDeviceKpiRequest) returns (context.Empty) {} rpc GetStreamKpi ( KpiId ) returns (stream Kpi) {} rpc GetInstantKpi ( KpiId ) returns (Kpi) {} // New RPCs: //rpc CreateKpi (KpiDescriptor ) returns (KpiId ) {} //rpc GetKpiDescriptor(KpiId ) returns (KpiDescriptor) {} //rpc IncludeKpi (Kpi ) returns (context.Empty) {} //rpc MonitorKpi (MonitorKpiRequest) returns (context.Empty) {} //rpc GetStreamKpi (KpiId ) returns (stream Kpi ) {} //rpc GetInstantKpi (KpiId ) returns (Kpi ) {} } message KpiDescriptor { string kpi_description = 1; kpi_sample_types.KpiSampleType kpi_sample_type = 2; context.DeviceId device_id = 3; context.EndPointId endpoint_id = 4; context.ServiceId service_id = 5; // context.SliceId slice_id = 6; message CreateKpiRequest /*New name: KpiDescriptor*/ { // Old fields: string kpiDescription = 1; context.DeviceId device_id = 2; KpiSampleType kpi_sample_type = 3; // context.EndpointId endpoint_id = 4; // others might be added // context.ServiceId service_id = 5; // for monitoring other // context.SliceId slice_id = 6; // entities // New fields: //string kpi_description = 1; //kpi_sample_types.KpiSampleType kpi_sample_type = 2; //context.DeviceId device_id = 3; //context.EndPointId endpoint_id = 4; //context.ServiceId service_id = 5; ////context.SliceId slice_id = 6; // to be used in future features } message MonitorKpiRequest{ KpiId kpi_id = 1; float sampling_duration_s = 2; float sampling_interval_s = 3; // Old fields: uint32 connexion_time_s = 2; uint32 sample_rate_ms = 3; // New fields: //float sampling_duration_s = 2; //float sampling_interval_s = 3; } // Message to be removed: message MonitorDeviceKpiRequest{ Kpi kpi = 1; uint32 connexion_time_s = 2; uint32 sample_rate_ms = 3; } // Message to be removed: message IncludeKpiRequest{ KpiId kpi_id = 1; string time_stamp = 2; KpiValue kpi_value= 3; } message KpiId { Loading @@ -35,18 +73,32 @@ message KpiId { message Kpi { KpiId kpi_id = 1; string timestamp = 2; KpiValue kpi_value = 4; string kpiDescription = 3; // field to be removed KpiValue kpi_value = 4; // field to be renumbered to 3 KpiSampleType kpi_sample_type = 5; // field to be removed context.DeviceId device_id = 6; // field to be removed // context.EndpointId endpoint_id = 7; // others might be added // field to be removed // context.ServiceId service_id = 8; // for monitoring other // field to be removed // context.SliceId slice_id = 9; // entities // field to be removed } message KpiValue { oneof value { uint32 intVal = 1; float floatVal = 2; string stringVal = 3; bool boolVal = 4; uint32 intVal = 1; // field to be renamed to int_val float floatVal = 2; // field to be renamed to float_val string stringVal = 3; // field to be renamed to str_val bool boolVal = 4; // field to be renamed to bool_val } } message KpiList { repeated Kpi kpi_list = 1; repeated Kpi kpiList = 1; // to be renamed to kpi_list } enum KpiSampleType { // to be moved to file "kpi_sample_types.proto" UNKNOWN = 0; PACKETS_TRANSMITTED = 101; // others might be added for PACKETS_RECEIVED = 102; // packet, optical, radio,... BYTES_TRANSMITTED = 201; BYTES_RECEIVED = 202; }
run_tests_locally.sh +9 −2 Original line number Diff line number Diff line Loading @@ -11,9 +11,16 @@ cat $PROJECTDIR/coverage/.coveragerc.template | sed s+~/teraflow/controller+$PRO # Run unitary tests and analyze coverage of code at same time # Populate environment variables for context to use Redis # Populate environment variables for context to use Redis in a development machine running Kubernetes # Uncomment below lines to create a Redis instance within Context for testing purposes. #kubectl delete namespace tf-dev #kubectl create namespace tf-dev #kubectl --namespace tf-dev apply -f ../manifests/contextservice.yaml #kubectl --namespace tf-dev expose deployment contextservice --port=6379 --type=NodePort --name=redis-tests #echo "Waiting 10 seconds for Redis to start..." #sleep 10 export REDIS_SERVICE_HOST=$(kubectl get node kubernetes-master -o 'jsonpath={.status.addresses[?(@.type=="InternalIP")].address}') export REDIS_SERVICE_PORT=$(kubectl get service contextservice-public --namespace cttc-dev -o 'jsonpath={.spec.ports[?(@.port==6379)].nodePort}') export REDIS_SERVICE_PORT=$(kubectl get service redis-tests --namespace tf-dev -o 'jsonpath={.spec.ports[?(@.port==6379)].nodePort}') # First destroy old coverage file rm -f $COVERAGEFILE Loading