Skip to content
Snippets Groups Projects
Commit f28cab56 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

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

parents 6fd16a3e cfe69c57
No related branches found
No related tags found
1 merge request!54Release 2.0.0
Showing
with 576 additions and 160 deletions
# 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.
# stages of the cicd pipeline # stages of the cicd pipeline
stages: stages:
- dependencies - dependencies
...@@ -20,7 +34,10 @@ include: ...@@ -20,7 +34,10 @@ include:
- local: '/src/opticalattackmitigator/.gitlab-ci.yml' - local: '/src/opticalattackmitigator/.gitlab-ci.yml'
- local: '/src/opticalcentralizedattackdetector/.gitlab-ci.yml' - local: '/src/opticalcentralizedattackdetector/.gitlab-ci.yml'
- local: '/src/automation/.gitlab-ci.yml' - local: '/src/automation/.gitlab-ci.yml'
- local: '/src/webui/.gitlab-ci.yml' - local: '/src/policy/.gitlab-ci.yml'
- local: '/src/l3_distributedattackdetector/.gitlab-ci.yml' #- local: '/src/webui/.gitlab-ci.yml'
- local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml' #- local: '/src/l3_distributedattackdetector/.gitlab-ci.yml'
- local: '/src/l3_attackmitigator/.gitlab-ci.yml' #- local: '/src/l3_centralizedattackdetector/.gitlab-ci.yml'
#- local: '/src/l3_attackmitigator/.gitlab-ci.yml'
#- local: '/src/slice/.gitlab-ci.yml'
#- local: '/src/interdomain/.gitlab-ci.yml'
...@@ -131,9 +131,12 @@ for COMPONENT in $COMPONENTS; do ...@@ -131,9 +131,12 @@ for COMPONENT in $COMPONENTS; do
printf "\n" printf "\n"
done done
echo "Configuring DataStores and Dashboards..."
./configure_dashboards.sh if [[ "$COMPONENTS" == *"webui"* ]]; then
printf "\n\n" echo "Configuring WebUI DataStores and Dashboards..."
./configure_dashboards.sh
printf "\n\n"
fi
echo "Reporting Deployment..." echo "Reporting Deployment..."
kubectl --namespace $K8S_NAMESPACE get all kubectl --namespace $K8S_NAMESPACE get all
......
# 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: interdomainservice
spec:
selector:
matchLabels:
app: interdomainservice
template:
metadata:
labels:
app: interdomainservice
spec:
terminationGracePeriodSeconds: 5
containers:
- name: server
image: registry.gitlab.com/teraflow-h2020/controller/interdomain:latest
imagePullPolicy: Always
ports:
- containerPort: 10010
env:
- name: LOG_LEVEL
value: "DEBUG"
readinessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:10010"]
livenessProbe:
exec:
command: ["/bin/grpc_health_probe", "-addr=:10010"]
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: 700m
memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
name: interdomainservice
spec:
type: ClusterIP
selector:
app: interdomainservice
ports:
- name: grpc
protocol: TCP
port: 10010
targetPort: 10010
# 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: 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: 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
...@@ -71,14 +71,14 @@ spec: ...@@ -71,14 +71,14 @@ spec:
path: /robots.txt path: /robots.txt
port: 3000 port: 3000
scheme: HTTP scheme: HTTP
initialDelaySeconds: 5 initialDelaySeconds: 10
periodSeconds: 5 periodSeconds: 30
successThreshold: 1 successThreshold: 1
timeoutSeconds: 2 timeoutSeconds: 2
livenessProbe: livenessProbe:
failureThreshold: 3 failureThreshold: 3
initialDelaySeconds: 5 initialDelaySeconds: 30
periodSeconds: 5 periodSeconds: 10
successThreshold: 1 successThreshold: 1
tcpSocket: tcpSocket:
port: 3000 port: 3000
......
src/tests/oeccpsc22/
\ No newline at end of file
...@@ -53,6 +53,13 @@ service ContextService { ...@@ -53,6 +53,13 @@ service ContextService {
rpc RemoveService (ServiceId ) returns ( Empty ) {} rpc RemoveService (ServiceId ) returns ( Empty ) {}
rpc GetServiceEvents (Empty ) returns (stream ServiceEvent ) {} rpc GetServiceEvents (Empty ) returns (stream ServiceEvent ) {}
rpc ListSliceIds (ContextId ) returns ( SliceIdList ) {}
rpc ListSlices (ContextId ) returns ( SliceList ) {}
rpc GetSlice (SliceId ) returns ( Slice ) {}
rpc SetSlice (Slice ) returns ( SliceId ) {}
rpc RemoveSlice (SliceId ) returns ( Empty ) {}
rpc GetSliceEvents (Empty ) returns (stream SliceEvent ) {}
rpc ListConnectionIds (ServiceId ) returns ( ConnectionIdList) {} rpc ListConnectionIds (ServiceId ) returns ( ConnectionIdList) {}
rpc ListConnections (ServiceId ) returns ( ConnectionList ) {} rpc ListConnections (ServiceId ) returns ( ConnectionList ) {}
rpc GetConnection (ConnectionId) returns ( Connection ) {} rpc GetConnection (ConnectionId) returns ( Connection ) {}
...@@ -253,6 +260,45 @@ message ServiceEvent { ...@@ -253,6 +260,45 @@ message ServiceEvent {
ServiceId service_id = 2; ServiceId service_id = 2;
} }
// ----- Slice ---------------------------------------------------------------------------------------------------------
message SliceId {
ContextId context_id = 1;
Uuid slice_uuid = 2;
}
message Slice {
SliceId slice_id = 1;
repeated EndPointId slice_endpoint_ids = 2;
repeated Constraint slice_constraints = 3;
repeated ServiceId slice_service_ids = 4;
repeated SliceId slice_subslice_ids = 5;
SliceStatus slice_status = 6;
}
enum SliceStatusEnum {
SLICESTATUS_UNDEFINED = 0;
SLICESTATUS_PLANNED = 1;
SLICESTATUS_INIT = 2;
SLICESTATUS_ACTIVE = 3;
SLICESTATUS_DEINIT = 4;
}
message SliceStatus {
SliceStatusEnum slice_status = 1;
}
message SliceIdList {
repeated SliceId slice_ids = 1;
}
message SliceList {
repeated Slice slices = 1;
}
message SliceEvent {
Event event = 1;
SliceId slice_id = 2;
}
// ----- Connection ---------------------------------------------------------------------------------------------------- // ----- Connection ----------------------------------------------------------------------------------------------------
message ConnectionId { message ConnectionId {
......
...@@ -12,72 +12,86 @@ ...@@ -12,72 +12,86 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//Example of topology
syntax = "proto3"; syntax = "proto3";
package dlt; package dlt;
import "context.proto"; import "context.proto";
service DltService { service DltService {
rpc RecordToDlt ( DltRecord ) returns ( RecordStatus ) {} rpc RecordToDlt (DltRecord ) returns ( DltRecordStatus ) {}
rpc GetFromDlt ( DltRecordId ) returns ( DltRecord ) {} rpc GetFromDlt (DltRecordId ) returns ( DltRecord ) {}
rpc SubscribeToDlt ( DltRecordSubscription ) returns ( stream DltRecord ) {} rpc SubscribeToDlt(DltRecordSubscription ) returns (stream DltRecordEvent ) {}
rpc GetDltStatus ( context.Empty ) returns ( DltStatus ) {} rpc GetDltStatus (context.TeraFlowController) returns ( DltPeerStatus ) {} // NEC is checkig if it is possible
rpc GetDltPeers (context.Empty ) returns ( DltPeerStatusList) {} // NEC is checkig if it is possible
} }
message DltRecordSubscription { enum DltRecordTypeEnum {
DltRecordType type = 1; DLTRECORDTYPE_UNDEFINED = 0;
DltRecordOperation operation = 2; DLTRECORDTYPE_CONTEXT = 1;
DLTRECORDTYPE_TOPOLOGY = 2;
DLTRECORDTYPE_DEVICE = 3;
DLTRECORDTYPE_LINK = 4;
DLTRECORDTYPE_SERVICE = 5;
DLTRECORDTYPE_SLICE = 6;
} }
enum DltRecordType { enum DltRecordOperationEnum {
UNKNOWN = 0; DLTRECORDOPERATION_UNDEFINED = 0;
SERVICE = 1; DLTRECORDOPERATION_ADD = 1;
DEVICE = 2; DLTRECORDOPERATION_UPDATE = 2;
SLICE = 3; DLTRECORDOPERATION_DELETE = 3;
} }
enum DltRecordOperation { enum DltRecordStatusEnum {
ADD = 0; DLTRECORDSTATUS_UNDEFINED = 0;
UPDATE = 1; DLTRECORDSTATUS_SUCCEEDED = 1;
DELETE = 2; DLTRECORDSTATUS_FAILED = 2;
} }
message DltRecord { enum DltStatusEnum {
DltRecordId id = 1; DLTSTATUS_UNDEFINED = 0;
DltRecordType type = 2; DLTSTATUS_NOTAVAILABLE = 1;
DltRecordOperation operation = 3; DLTSTATUS_INITIALIZED = 2;
string json = 4; DLTSTATUS_AVAILABLE = 3;
DLTSTATUS_DEINIT = 4;
} }
message DltRecordId { message DltRecordId {
context.Uuid id = 1; context.Uuid domain_uuid = 1; // unique identifier of domain owning the record
DltRecordTypeEnum type = 2; // type of record
context.Uuid record_uuid = 3; // unique identifier of the record within the domain context_uuid/topology_uuid
} }
message RecordStatus { message DltRecord {
DltRecordId id = 1; DltRecordId record_id = 1; // record identifier
DltRecordStatusEnum status = 2; DltRecordOperationEnum operation = 2; // operation to be performed over the record
string data_json = 3; // record content: JSON-encoded record content
} }
enum DltRecordStatusEnum { message DltRecordSubscription {
REQUESTED = 0; // retrieved events have to match ALL conditions.
STORED = 1; // i.e., type in types requested, AND operation in operations requested
DISABLED = 2; // TODO: consider adding a more sophisticated filtering
repeated DltRecordTypeEnum type = 1; // selected event types, empty=all
repeated DltRecordOperationEnum operation = 2; // selected event operations, empty=all
} }
message DltRecordEvent {
message DltStatus { context.Event event = 1; // common event data (timestamp & event_type)
context.TeraFlowController ctl = 1; DltRecordId record_id = 2; // record identifier associated with this event
DltStatusEnum status = 2;
} }
enum DltStatusEnum { message DltRecordStatus {
NOT_AVAILABLE = 0; DltRecordId record_id = 1; // identifier of the associated record
INITIALIZED = 1; DltRecordStatusEnum status = 2; // status of the record
AVAILABLE = 2; string error_message = 3; // error message in case of failure, empty otherwise
DEINIT = 3;
} }
message DltPeerStatus {
context.TeraFlowController controller = 1; // Identifier of the TeraFlow controller instance
DltStatusEnum status = 2; // Status of the TeraFlow controller instance
}
message DltPeerStatusList {
repeated DltPeerStatus peers = 1; // List of peers and their status
}
...@@ -12,23 +12,15 @@ ...@@ -12,23 +12,15 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//Example of topology
syntax = "proto3"; syntax = "proto3";
package interdomain; package interdomain;
import "context.proto"; import "context.proto";
import "slice.proto";
service InterdomainService { service InterdomainService {
rpc Authenticate (context.TeraFlowController) returns (context.AuthenticationResult) {} rpc Authenticate (context.TeraFlowController) returns (context.AuthenticationResult) {}
rpc LookUpSlice(slice.TransportSlice) returns (slice.SliceId) {} //Slice component or from interdomain component rpc RequestSlice (context.Slice ) returns (context.SliceId ) {}
rpc OrderSliceFromCatalog(slice.TransportSlice) returns (slice.SliceStatus) {} rpc LookUpSlice (context.Slice ) returns (context.SliceId ) {}
rpc CreateSliceAndAddToCatalog(slice.TransportSlice) returns (slice.SliceStatus) {} rpc OrderSliceFromCatalog (context.Slice ) returns (context.Slice ) {}
rpc CreateSliceAndAddToCatalog(context.Slice ) returns (context.Slice ) {}
} }
// 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 policy;
// Action
message PolicyRuleAction {
PolicyRuleActionEnum action = 1;
repeated string parameters = 2;
}
enum PolicyRuleActionEnum {
POLICYRULE_ACTION_NO_ACTION = 0;
POLICYRULE_ACTION_SET_DEVICE_STATUS = 1;
POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE = 2;
POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT = 3;
}
// 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 policy;
import "monitoring.proto";
// Condition
message PolicyRuleCondition {
monitoring.KpiId kpiId = 1;
NumericalOperator numericalOperator = 2;
monitoring.KpiValue kpiValue = 3;
}
// Operator to be used when comparing Kpis with condition values
enum NumericalOperator {
POLICYRULE_CONDITION_NUMERICAL_UNDEFINED = 0; // Kpi numerical operator undefined
POLICYRULE_CONDITION_NUMERICAL_EQUAL = 1; // Kpi is equal with value
POLICYRULE_CONDITION_NUMERICAL_NOT_EQUAL = 2; // Kpi is not equal with value
POLICYRULE_CONDITION_NUMERICAL_LESS_THAN = 3; // Kpi is less than value
POLICYRULE_CONDITION_NUMERICAL_LESS_THAN_EQUAL = 4; // Kpi is less than or equal with value
POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN = 5; // Kpi is greater than value
POLICYRULE_CONDITION_NUMERICAL_GREATER_THAN_EQUAL = 6; // Kpi is less than or equal with value
}
// Operator to be used when evaluating each condition
enum BooleanOperator {
POLICYRULE_CONDITION_BOOLEAN_UNDEFINED = 0; // Boolean operator undefined
POLICYRULE_CONDITION_BOOLEAN_AND = 1; // Boolean AND operator
POLICYRULE_CONDITION_BOOLEAN_OR = 2; // Boolean OR operator
}
\ No newline at end of file
...@@ -16,25 +16,32 @@ syntax = "proto3"; ...@@ -16,25 +16,32 @@ syntax = "proto3";
package policy; package policy;
import "context.proto"; import "context.proto";
import "policy-condition.proto";
import "policy-action.proto";
service PolicyService { service PolicyService {
rpc PolicyAdd (PolicyRule) returns (PolicyRuleState) {} rpc PolicyAddService (PolicyRuleService) returns (PolicyRuleState) {}
rpc PolicyUpdate (PolicyRule) returns (PolicyRuleState) {} rpc PolicyAddDevice (PolicyRuleDevice) returns (PolicyRuleState) {}
rpc PolicyDelete (PolicyRule) returns (PolicyRuleState) {} rpc PolicyUpdateService (PolicyRuleService) returns (PolicyRuleState) {}
rpc GetPolicy (PolicyRuleId) returns (PolicyRule) {} rpc PolicyUpdateDevice (PolicyRuleDevice) returns (PolicyRuleState) {}
rpc GetPolicyByDeviceId (context.DeviceId) returns (PolicyRuleList) {} rpc PolicyDelete (PolicyRuleId) returns (PolicyRuleState) {}
rpc GetPolicyByServiceId (context.ServiceId) returns (PolicyRuleList) {} rpc GetPolicyService (PolicyRuleId) returns (PolicyRuleService) {}
rpc GetPolicyDevice (PolicyRuleId) returns (PolicyRuleDevice) {}
rpc GetPolicyByServiceId (context.ServiceId) returns (PolicyRuleServiceList) {}
} }
enum RuleState { enum RuleState {
POLICY_INACTIVE = 0; // Rule is currently inactive POLICY_UNDEFINED = 0; // Undefined rule state
POLICY_PLANNED = 1; // Rule installation planned POLICY_FAILED = 1; // Rule failed
POLICY_ACTIVE = 2; // Rule is currently active POLICY_INSERTED = 2; // Rule is just inserted
} POLICY_VALIDATED = 3; // Rule content is correct
POLICY_PROVISIONED = 4; // Rule subscribed to Monitoring
enum PolicyRuleType { POLICY_ACTIVE = 5; // Rule is currently active (alarm is just thrown by Monitoring)
POLICYTYPE_DEVICE = 0; // Device-level POLICY_ENFORCED = 6; // Rule action is successfully enforced
POLICYTYPE_NETWORK = 1; // Network-wide POLICY_INEFFECTIVE = 7; // The applied rule action did not work as expected
POLICY_EFFECTIVE = 8; // The applied rule action did work as expected
POLICY_UPDATED = 9; // Operator requires a policy to change
POLICY_REMOVED = 10; // Operator requires to remove a policy
} }
message PolicyRuleId { message PolicyRuleId {
...@@ -42,58 +49,51 @@ message PolicyRuleId { ...@@ -42,58 +49,51 @@ message PolicyRuleId {
} }
message PolicyRuleState { message PolicyRuleState {
context.Uuid policyRuleId = 1; RuleState policyRuleState = 1;
RuleState policyRuleState = 2;
}
message PolicyRuleVariable {
string policyRuleVariable = 1;
} }
message PolicyRuleValue { // Basic policy rule attributes
string policyRuleValue = 1; message PolicyRuleBasic {
} PolicyRuleId policyRuleId = 1;
optional PolicyRuleState policyRuleState = 2;
uint32 priority = 3;
// IETF draft: Framework for Use of ECA (Event Condition Action) in Network Self Management // Event-Condition-Action (ECA) model
// Source: https://datatracker.ietf.org/doc/draft-bwd-netmod-eca-framework/ repeated PolicyRuleCondition conditionList = 4; // When these policy conditions are met, an event is automatically thrown
// Event BooleanOperator booleanOperator = 5; // Evaluation operator to be used
message PolicyRuleEvent { repeated PolicyRuleAction actionList = 6; // One or more actions should be applied
context.Event event = 1;
} }
// Condition // Service-oriented policy rule
message PolicyRuleCondition { message PolicyRuleService {
PolicyRuleVariable polRuleConditionVar = 1; // Basic policy rule attributes
PolicyRuleValue polRuleConditionVal = 2; PolicyRuleBasic policyRuleBasic = 1;
}
// Action // Affected service and (some of) its device(s)
message PolicyRuleAction { context.ServiceId serviceId = 2;
PolicyRuleVariable polRuleActionVar = 1; repeated context.DeviceId deviceList = 3; // List of devices this service is traversing (not exhaustive)
PolicyRuleValue polRuleActionVal = 2;
} }
// Policy rule partially complies with IETF’s: // Device-oriented policy rule
// RFC 3060: https://datatracker.ietf.org/doc/html/rfc3060 message PolicyRuleDevice {
// RFC 3460: https://datatracker.ietf.org/doc/html/rfc3460
// Enhanced with a policy rule event according to the ECA model
message PolicyRule {
// Basic policy rule attributes // Basic policy rule attributes
PolicyRuleId policyRuleId = 1; PolicyRuleBasic policyRuleBasic = 1;
PolicyRuleType policyRuleType = 2;
uint32 PolicyRulePriority = 3;
// Event-Condition-Action model // Affected device(s)
PolicyRuleEvent event = 4; // A single event triggers the policy repeated context.DeviceId deviceList = 2;
repeated PolicyRuleCondition polRuleConditionList = 5; // One or more conditions must be met }
repeated PolicyRuleAction polRuleActionList = 6; // One or more actions should be applied
// A list of policy rule IDs
message PolicyRuleIdList {
repeated PolicyRuleId policyRuleIdList = 1;
}
// Affected services and devices // A list of service-oriented policy rules
repeated context.ServiceId serviceList = 7; message PolicyRuleServiceList {
repeated context.DeviceId deviceList = 8; repeated PolicyRuleService policyRuleServiceList = 1;
} }
// A list of policy rules // A list of device-oriented policy rules
message PolicyRuleList { message PolicyRuleDeviceList {
repeated PolicyRule policyRuleList = 1; repeated PolicyRuleDevice policyRuleDeviceList = 1;
} }
...@@ -12,43 +12,13 @@ ...@@ -12,43 +12,13 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//Example of topology
syntax = "proto3"; syntax = "proto3";
package slice; package slice;
import "context.proto"; import "context.proto";
service SliceService { service SliceService {
rpc CreateUpdateSlice (TransportSlice) returns (SliceStatus) {} rpc CreateSlice(context.Slice ) returns (context.SliceId) {}
rpc DeleteSlice (TransportSlice) returns (context.Empty) {} rpc UpdateSlice(context.Slice ) returns (context.SliceId) {}
} rpc DeleteSlice(context.SliceId) returns (context.Empty ) {}
message SliceEndpoint {
context.EndPoint port_id = 1;
}
message TransportSlice {
SliceId slice_id = 1;
repeated slice.SliceEndpoint endpoints = 2;
repeated context.Constraint constraints = 3;
repeated context.ServiceId services = 4;
repeated SliceId subSlicesId = 5;
SliceStatus status = 6;
}
message SliceId {
context.ContextId contextId = 1;
context.Uuid slice_id = 2;
}
message SliceStatus {
slice.SliceId slice_id = 1;
SliceStatusEnum status = 2;
}
enum SliceStatusEnum {
PLANNED = 0;
INIT = 1;
ACTIVE = 2;
DEINIT = 3;
} }
#!/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.
./report_coverage_all.sh | grep --color -E -i "^slice/.*$|$"
#!/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=device.log -o log_file_level=DEBUG
coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
device/tests/test_unitary_emulated.py
coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
device/tests/test_unitary_openconfig.py
coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
device/tests/test_unitary_tapi.py
coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
device/tests/test_unitary_p4.py
coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
device/tests/test_unitary_microwave.py
...@@ -14,11 +14,15 @@ ...@@ -14,11 +14,15 @@
# limitations under the License. # limitations under the License.
IMAGE_NAME='integration_tester' PROJECTDIR=`pwd`
IMAGE_TAG='latest'
CI_REGISTRY_IMAGE='registry.gitlab.com/teraflow-h2020/controller'
kubectl delete pod $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --wait=true --ignore-not-found=true cd $PROJECTDIR/src
kubectl get all RCFILE=$PROJECTDIR/coverage/.coveragerc
kubectl run $(echo $IMAGE_NAME | sed -r 's/[^a-zA-Z0-9\.\-]/-/g') --image "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$IMAGE_TAG" --restart=Never --rm -i
kubectl get all # Run unitary tests and analyze coverage of code at same time
# Useful flags for pytest:
#-o log_cli=true -o log_file=device.log -o log_file_level=DEBUG
coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
device/tests/test_unitary_emulated.py
#!/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=device.log -o log_file_level=DEBUG
coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
device/tests/test_unitary_microwave.py
#!/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=device.log -o log_file_level=DEBUG
coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
device/tests/test_unitary_openconfig.py
#!/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=device.log -o log_file_level=DEBUG
coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
device/tests/test_unitary_p4.py
#!/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=device.log -o log_file_level=DEBUG
coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO --verbose \
device/tests/test_unitary_tapi.py
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment