Skip to content

Commit

Permalink
Merge branch 'release-1.130.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
niksv committed Mar 23, 2023
2 parents 6d43fc0 + ecc787f commit fdeeec9
Show file tree
Hide file tree
Showing 70 changed files with 3,451 additions and 479 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Changelog

## v1.130.0 (23/03/2023)

### Features:
- [#5070](https://github.com/telstra/open-kilda/pull/5070) Path validation (Issue: [#4527](https://github.com/telstra/open-kilda/issues/4527)) [**docs**]
- [#5078](https://github.com/telstra/open-kilda/pull/5078) Ability to add single switch flow into diverse group Closes #2072 (Issues: [#2072](https://github.com/telstra/open-kilda/issues/2072) [#2072](https://github.com/telstra/open-kilda/issues/2072))

### Bug Fixes:
- [#5064](https://github.com/telstra/open-kilda/pull/5064) Fixed bug with empty vlan stats and set vlans (Issue: [#5063](https://github.com/telstra/open-kilda/issues/5063)) [**storm-topologies**]
- [#5036](https://github.com/telstra/open-kilda/pull/5036) #4984: fix sub flow descriptions (Issue: [#4984](https://github.com/telstra/open-kilda/issues/4984))
- [#5079](https://github.com/telstra/open-kilda/pull/5079) fix flow_id in path from flow update request ignored (Issue: [#5075](https://github.com/telstra/open-kilda/issues/5075))
- [#5110](https://github.com/telstra/open-kilda/pull/5110) Bugfix/4574 switch validation fail for grpc timeout (Issue: [#4574](https://github.com/telstra/open-kilda/issues/4574))

### Improvements:
- [#5124](https://github.com/telstra/open-kilda/pull/5124) #4574: Switch validation when GPRC is down tests (Issue: [#4574](https://github.com/telstra/open-kilda/issues/4574)) [**tests**]
- [#5128](https://github.com/telstra/open-kilda/pull/5128) 5013 max bandwidth from topologyyaml is not applying (Issue: [#5013](https://github.com/telstra/open-kilda/issues/5013))
- [#5104](https://github.com/telstra/open-kilda/pull/5104) #5063: Can't patch flow with empty vlan stats and non zeros src/dst v… (Issues: [#5063](https://github.com/telstra/open-kilda/issues/5063) [#5063](https://github.com/telstra/open-kilda/issues/5063)) [**tests**]
- [#5107](https://github.com/telstra/open-kilda/pull/5107) #5067: Added vlan in range check for flow statistics tests (Issue: [#5067](https://github.com/telstra/open-kilda/issues/5067)) [**tests**]
- [#5012](https://github.com/telstra/open-kilda/pull/5012) Added Kilda High Level Design doc [**docs**]
- [#5115](https://github.com/telstra/open-kilda/pull/5115) #4527: Path validation tests (Issues: [#4527](https://github.com/telstra/open-kilda/issues/4527) [#4527](https://github.com/telstra/open-kilda/issues/4527)) [**tests**]

For the complete list of changes, check out [the commit log](https://github.com/telstra/open-kilda/compare/v1.129.1...v1.130.0).

### Affected Components:
nbworker

---

## v1.129.1 (16/03/2023)

### Bug Fixes:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ control millions of flows, and provide sub-second network telemetry. OpenKilda p
- REST API and GUI to configure and manage OpenKilda capabilities;
- and more!

You can find OpenKIlda high level design [here](docs/design/kilda-high-level-design/design.md).

## Important notes

### Deprecation
Expand Down
3 changes: 3 additions & 0 deletions docs/design/kilda-high-level-design/design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## High Level Design

![High Level Design](kilda_design.png "High level design")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
97 changes: 97 additions & 0 deletions docs/design/solutions/path-validation/path-validation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Path Validation

## Motivation
The main use case is to allow users to verify whether some arbitrary flow path is possible to create with the given
constraints without actually creating this flow. A path here is a sequence of nodes, that is a sequence of switches
with in and out ports. Constraints are various parameters such as max latency, bandwidth, encapsulation type,
path computation strategy, and other.

## Implementation details
The validation of a path is done for each segment and each validation type individually. This way, the validation
collects all errors on the path and returns them all in a single response. The response is concise and formed
in human-readable format.

There is no locking of resources for this path and, therefore, no guarantee that it will be possible to create this flow
after validation in the future.

## Northbound API

REST URL: ```/v2/network/path/check```, method: ```GET```

A user is required to provide a path represented by a list of nodes. Nodes must be ordered from start to end;
each next element is the next hop. A user can add optional parameters:
- `encapsulation_type`: enum value "TRANSIT_VLAN" or "VXLAN". API returns an error for every switch in the list if it
doesn't support the given encapsulation type.
- `max_bandwidth`: bandwidth required for this path. API returns an error for each segment of the given path when the
available bandwidth on the segment is less than the given value. When used in combination with `reuse_flow_resources`,
available bandwidth as if the given flow doesn't consume any bandwidth.
- `max_latency`: the first tier latency value in milliseconds. API returns an error for each segment of the given path,
which max latency is greater than the given value.
- `max_latency_tier2`: the second tier latency value in milliseconds. API returns an error for each segment of the given
path, which max latency is greater than the given value.
- `path_computation_strategy`: an enum value PathComputationStrategy. API will return different set of errors depending
on the selected strategy. For example, when COST is selected API ignores available bandwidth and latency parameters.
If none is selected, all validations are executed.
- `reuse_flow_resources`: a flow ID. Verify the given path as if it is created instead of the existing flow, that is as
if the resources of some flow are released before validation. Returns an error if this flow doesn't exist.
- `diverse_with_flow`: a flow ID. Verify whether the given path intersects with the given flow. API returns an error for
each common segment. Returns an error if this flow doesn't exist.

### Request Body
```json
{
"encapsulation_type": "TRANSIT_VLAN|VXLAN",
"max_bandwidth": 0,
"max_latency": 0,
"max_latency_tier2": 0,
"path_computation_strategy": "COST|LATENCY|MAX_LATENCY|COST_AND_AVAILABLE_BANDWIDTH",
"reuse_flow_resources": "flow_id",
"diverse_with_flow": "diverse_flow_id",
"nodes": [
{
"switch_id": "00:00:00:00:00:00:00:01",
"output_port": 0
},
{
"switch_id": "00:00:00:00:00:00:00:02",
"input_port": 0,
"output_port": 1
},
{
"switch_id": "00:00:00:00:00:00:00:03",
"input_port": 0
}
]
}
```

### Responses

Code: 200

Content:
- is_valid: True if the path is valid and conform to the strategy, false otherwise
- errors: List of strings with error descriptions if any
- correlation_id: Correlation ID from correlation_id Header
```json
{
"correlation_id": "string",
"is_valid": "bool",
"errors": [
"error0",
"errorN"
]
}
```

Codes: 4XX,5XX
```json
{
"correlation_id": "string",
"error-description": "string",
"error-message": "string",
"error-type": "string",
"timestamp": 0
}
```

1 change: 1 addition & 0 deletions src-java/base-topology/base-messaging/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies {
implementation 'com.google.guava:guava'
implementation 'org.apache.commons:commons-lang3'
implementation 'org.slf4j:slf4j-api'
implementation 'javax.validation:validation-api'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
testImplementation 'org.junit.vintage:junit-vintage-engine'

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* Copyright 2023 Telstra Open Source
*
* 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.
*/

package org.openkilda.messaging.info.network;

import org.openkilda.messaging.info.InfoData;

import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Value;

import java.util.List;

@Value
@Builder
@EqualsAndHashCode(callSuper = false)
@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
public class PathValidationResult extends InfoData {
Boolean isValid;
List<String> errors;
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ static LogicalPortsValidationEntryV2 join(List<LogicalPortsValidationEntryV2> en
builder.proper(joinLists(nonNullEntries.stream().map(LogicalPortsValidationEntryV2::getProper)));
builder.missing(joinLists(nonNullEntries.stream().map(LogicalPortsValidationEntryV2::getMissing)));
builder.misconfigured(joinLists(nonNullEntries.stream().map(LogicalPortsValidationEntryV2::getMisconfigured)));
List<String> errorList = nonNullEntries.stream().map(e -> e.error).distinct().collect(Collectors.toList());
if (errorList.size() > 1) {
builder.error(errorList.stream()
.map(e -> Objects.isNull(e) ? "There is an error while splitting and joining entities" : e)
.collect(Collectors.joining(",")));
} else {
errorList.stream().filter(Objects::nonNull).findFirst().ifPresent(builder::error);
}
return builder.build();
}

Expand All @@ -72,6 +80,7 @@ List<LogicalPortsValidationEntryV2> split(int firstChunkSize, int chunkSize) {
.excess(entry.getExcess())
.proper(entry.getProper())
.misconfigured(entry.getMisconfigured())
.error(error)
.build());
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Builder;
import lombok.Value;

import java.time.Duration;
import java.util.List;

@Value
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PathDto {
@JsonProperty("bandwidth")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* Copyright 2023 Telstra Open Source
*
* 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.
*/

package org.openkilda.messaging.payload.network;

import org.openkilda.messaging.payload.flow.FlowEncapsulationType;
import org.openkilda.messaging.payload.flow.PathNodePayload;
import org.openkilda.model.PathComputationStrategy;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Builder;
import lombok.Value;

import java.util.List;
import javax.validation.constraints.PositiveOrZero;

@Value
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PathValidationPayload {
@JsonProperty("bandwidth")
Long bandwidth;

@JsonProperty("max_latency")
@PositiveOrZero(message = "max_latency cannot be negative")
Long latencyMs;

@JsonProperty("max_latency_tier2")
@PositiveOrZero(message = "max_latency_tier2 cannot be negative")
Long latencyTier2ms;

@JsonProperty("nodes")
List<PathNodePayload> nodes;

@JsonProperty("diverse_with_flow")
String diverseWithFlow;

@JsonProperty("reuse_flow_resources")
String reuseFlowResources;

@JsonProperty("flow_encapsulation_type")
FlowEncapsulationType flowEncapsulationType;

@JsonProperty("path_computation_strategy")
PathComputationStrategy pathComputationStrategy;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,24 @@ public void splitAndUniteEmptyLogicalPortEntryTest() {
.proper(new ArrayList<>())
.build();
List<LogicalPortsValidationEntryV2> list = entry.split(4, 4);
assertEquals(1, list.size());
assertEquals("Method split should return the list with the length of 1", 1, list.size());
LogicalPortsValidationEntryV2 united = LogicalPortsValidationEntryV2.join(list);
assertEquals(entry, united);
}

@Test
public void splitAndUniteEmptyLogicalPortEntryWithErrorTest() {
LogicalPortsValidationEntryV2 entry = LogicalPortsValidationEntryV2.builder()
.asExpected(false)
.error("Timeout for waiting response on DumpLogicalPortsRequest()"
+ " Details: Error in SpeakerWorkerService")
.missing(new ArrayList<>())
.misconfigured(new ArrayList<>())
.excess(new ArrayList<>())
.proper(new ArrayList<>())
.build();
List<LogicalPortsValidationEntryV2> list = entry.split(4, 4);
assertEquals("Method split should return the list with the length of 1", 1, list.size());
LogicalPortsValidationEntryV2 united = LogicalPortsValidationEntryV2.join(list);
assertEquals(entry, united);
}
Expand All @@ -52,7 +69,7 @@ public void splitAndUniteNullLogicalPortEntryTest() {
.proper(null)
.build();
List<LogicalPortsValidationEntryV2> list = entry.split(4, 4);
assertEquals(1, list.size());
assertEquals("Method split should return the list with the length of 1", 1, list.size());
LogicalPortsValidationEntryV2 united = LogicalPortsValidationEntryV2.join(list);
assertEquals(entry, united);
}
Expand All @@ -67,7 +84,7 @@ public void splitAndUniteOneLogicalPortEntryTest() {
.misconfigured(buildMisconfiguredLogicalPortsInfo(4, 1))
.build();
List<LogicalPortsValidationEntryV2> list = entry.split(4, 4);
assertEquals(1, list.size());
assertEquals("Method split should return the list with the length of 1", 1, list.size());
LogicalPortsValidationEntryV2 united = LogicalPortsValidationEntryV2.join(list);
assertEquals(entry, united);
}
Expand All @@ -82,7 +99,7 @@ public void splitAndUniteFourLogicalPortEntryTest() {
.misconfigured(buildMisconfiguredLogicalPortsInfo(4, 1))
.build();
List<LogicalPortsValidationEntryV2> list = entry.split(1, 1);
assertEquals(4, list.size());
assertEquals("Method split should return the list with the length of 4", 4, list.size());
LogicalPortsValidationEntryV2 united = LogicalPortsValidationEntryV2.join(list);
assertEquals(entry, united);
}
Expand All @@ -97,7 +114,7 @@ public void splitAndUniteNotDividedLogicalPortEntryTest() {
.misconfigured(buildMisconfiguredLogicalPortsInfo(4, 4))
.build();
List<LogicalPortsValidationEntryV2> list = entry.split(2, 3);
assertEquals(4, list.size());
assertEquals("Method split should return the list with the length of 4", 4, list.size());
LogicalPortsValidationEntryV2 united = LogicalPortsValidationEntryV2.join(list);
assertEquals(entry, united);
}
Expand All @@ -112,7 +129,7 @@ public void splitAndUniteTwoEntryTest() {
.misconfigured(new ArrayList<>())
.build();
List<LogicalPortsValidationEntryV2> list = entry.split(2, 2);
assertEquals(3, list.size());
assertEquals("Method split should return the list with the length of 3", 3, list.size());
LogicalPortsValidationEntryV2 united = LogicalPortsValidationEntryV2.join(list);
assertEquals(entry, united);
}
Expand All @@ -127,7 +144,7 @@ public void splitAndUniteHugeChunkLogicalPortEntryTest() {
.misconfigured(buildMisconfiguredLogicalPortsInfo(4, 4))
.build();
List<LogicalPortsValidationEntryV2> list = entry.split(100, 200);
assertEquals(1, list.size());
assertEquals("Method split should return the list with the length of 1", 1, list.size());
LogicalPortsValidationEntryV2 united = LogicalPortsValidationEntryV2.join(list);
assertEquals(entry, united);
}
Expand All @@ -142,7 +159,23 @@ public void splitAndUniteManyEntriesLogicalPortEntryTest() {
.misconfigured(buildMisconfiguredLogicalPortsInfo(3000, 800))
.build();
List<LogicalPortsValidationEntryV2> list = entry.split(100, 200);
assertEquals(14, list.size());
assertEquals("Method split should return the list with the length of 14", 14, list.size());
LogicalPortsValidationEntryV2 united = LogicalPortsValidationEntryV2.join(list);
assertEquals(entry, united);
}

@Test
public void splitAndUniteManyEntriesLogicalPortEntryWithErrorMessageTest() {
LogicalPortsValidationEntryV2 entry = LogicalPortsValidationEntryV2.builder()
.asExpected(true)
.error("Some error message")
.missing(buildLogicalPortsInfo(1, 500))
.excess(buildLogicalPortsInfo(1000, 600))
.proper(buildLogicalPortsInfo(2000, 700))
.misconfigured(buildMisconfiguredLogicalPortsInfo(3000, 800))
.build();
List<LogicalPortsValidationEntryV2> list = entry.split(100, 200);
assertEquals("Method split should return the list with the length of 14", 14, list.size());
LogicalPortsValidationEntryV2 united = LogicalPortsValidationEntryV2.join(list);
assertEquals(entry, united);
}
Expand All @@ -157,7 +190,7 @@ public void splitAndUniteManyEntriesByOneLogicalPortEntryTest() {
.misconfigured(buildMisconfiguredLogicalPortsInfo(3000, 800))
.build();
List<LogicalPortsValidationEntryV2> list = entry.split(1, 1);
assertEquals(2600, list.size());
assertEquals("Method split should return the list with the length of 2600", 2600, list.size());
LogicalPortsValidationEntryV2 united = LogicalPortsValidationEntryV2.join(list);
assertEquals(entry, united);
}
Expand Down
Loading

0 comments on commit fdeeec9

Please sign in to comment.