Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/databroker api v2 #101

Merged
merged 58 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
3030133
Init Databroker API V2
rafaeling May 16, 2024
b306d1b
Added oneof to Datapoint and some changes
rafaeling May 21, 2024
4ead652
Rename oneof Datapoint
rafaeling May 28, 2024
33229c4
Add oneof for Stream Provider response
rafaeling May 28, 2024
0599f7a
Update provide stream response and add files to the build project
rafaeling May 29, 2024
b9d55fd
Update ProvideStream and Actuate calls
rafaeling May 31, 2024
bfbf9bf
Add Start/Stop Signal
rafaeling Jun 3, 2024
45eb635
Remove Start/Stop Signal and add batch methods
rafaeling Jun 4, 2024
db3e10a
Use correct numeration
rafaeling Jun 4, 2024
1f04b60
Clean up and rename messages
rafaeling Jun 4, 2024
7665757
Move ValueFailure to bottom
rafaeling Jun 4, 2024
5d94ff8
Add proposed API
argerus Jun 7, 2024
e19cfa6
Updates after review session
rafaeling Jun 20, 2024
7925eca
format
rafaeling Jun 20, 2024
604644f
pre commit
rafaeling Jun 20, 2024
f59dbb3
Improve documentation
rafaeling Jun 24, 2024
8fbc180
Avoid reusing messages among calls
rafaeling Jun 24, 2024
d21e057
Add signal i32 id to metadata
rafaeling Jul 15, 2024
8d4ad4b
Fix year comment
rafaeling Jul 15, 2024
7303581
Introduce subscribe i32 parameter due to performance reasons
rafaeling Aug 15, 2024
1a08ef5
Correct parameter name
rafaeling Aug 15, 2024
22dbea2
Kuksa val v2 skeleton
rafaeling Jul 15, 2024
09f1d33
Initial publish request values implementation for OpenProviderStream
rafaeling Jul 15, 2024
3686c3f
Initial implementation for ListMetadata
rafaeling Jul 30, 2024
8d2c9fa
Extend unit test
rafaeling Aug 6, 2024
32e74d4
Subscribe & publish_value
lukasmittag Aug 2, 2024
39005a8
Formatting & clippy findings
lukasmittag Aug 2, 2024
c88892c
Fix test for subscribe
lukasmittag Aug 7, 2024
a7385b8
Formatting
lukasmittag Aug 8, 2024
f0e2979
Test for get_signal_id and HashMap:with_capacity adaption
lukasmittag Aug 13, 2024
94abd14
check without if else publish value succeeds
lukasmittag Aug 14, 2024
8dcffab
Adapt to changes of API v2 that came recently in
lukasmittag Sep 4, 2024
70e981d
Remove ValueFailure
argerus Sep 24, 2024
5102cb9
Remove oneof and ValueFailure from Datapoint and some proto naming im…
rafaeling Sep 30, 2024
e0a926a
Move conversion of UpdatError
lukasmittag Oct 1, 2024
2d1cca3
Add value restriction metadata
rafaeling Oct 2, 2024
2897171
Add GetValue and GetValues Support (#75)
erikbosch Oct 7, 2024
abaafc0
Implement Provider Actuation
wba2hi Sep 16, 2024
7b47ed9
Remove ListValues
erikbosch Oct 16, 2024
c117be6
Implement server info service method
rafaeling Oct 16, 2024
a8df2f6
SubscribeById implementation
rafaeling Oct 15, 2024
d94497e
Merge pull request #83 from boschglobal/feature/add_databroker_server…
rafaeling Oct 22, 2024
d0424e9
Merge pull request #81 from boschglobal/feature/subscribe_by_id_imple…
rafaeling Oct 22, 2024
50f2ba6
Min/Max Support (#79)
erikbosch Oct 24, 2024
59265ab
Update incomplete information on errors
rafaeling Oct 24, 2024
95e3041
Merge pull request #87 from boschglobal/fix/doc_open_provider_stream
rafaeling Oct 29, 2024
3368c07
Add OutOfRange error validation
rafaeling Oct 28, 2024
3bacf45
Merge pull request #88 from boschglobal/fix/actuate_and_batch_actuate…
rafaeling Oct 29, 2024
1bc3f86
Initiate Comprehensive Kuksa Requirements Analysis for Enhanced Versi…
rafaeling Oct 31, 2024
62552a5
Implement validatation of actuator type on acutation and some more er…
rafaeling Oct 30, 2024
54755f0
Merge pull request #90 from boschglobal/feature/missing_errors_and_ch…
rafaeling Nov 4, 2024
8483c51
Add reflection support for kuksa.val.v2
rafaeling Oct 29, 2024
aa4444f
Merge pull request #89 from boschglobal/feature/api-v2-reflection
rafaeling Nov 5, 2024
e737ae0
Add missing min max restriction
rafaeling Nov 4, 2024
f9f7f6f
Merge pull request #93 from boschglobal/feature/missing_min_max_restr…
rafaeling Nov 5, 2024
de2730e
[kuksa.val.v2] Improve throughput by skipping ACKs
rafaeling Nov 13, 2024
07eaf88
Remove recently added `optional` from proto3 files
rafaeling Nov 13, 2024
041729b
Merge branch 'feature/databroker-api-v2'
argerus Nov 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The [COVESA Vehicle Signal Specification](https://covesa.github.io/vehicle_signa

However, VSS does not define how these signals are to be collected and managed within a vehicle, nor does it prescribe how other components in the vehicle can read or write signal values from and to the tree.

**Kuksa Databroker** is a resource efficient implementation of the VSS signal tree and is intended to be run within a vehicle on a microprocessor based platform. It allows applications in the vehicle to interact with the vehicle's sensors and actuators using a uniform, high level gRPC API for querying signals, updating current and target values of sensors and actuators and getting notified about changes to signals of interest.
**Kuksa Databroker** is a resource efficient implementation of the VSS signal tree and is intended to be run within a vehicle on a microprocessor based platform. It allows applications in the vehicle to interact with the vehicle's sensors and actuators using a uniform, high level gRPC API for querying signals, updating values of sensors and actuators and getting notified about changes to signals of interest.

<!-- black box diagram -- inputs/outputs -->

Expand Down Expand Up @@ -88,6 +88,21 @@ Data is usually exchanged with ECUs by means of a CAN bus or Ethernet based prot

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- KUKSA ANALYSIS -->
## Kuksa analysis
Extended [Kuksa analysis](./doc/kuksa_analysis.md) containing functional requirements, use cases diagrams, latest and new API definition `kuksa.val.v2` as well as new design discussions for future developments and improvements.

### APIs supported by Databroker

Kuksa Databroker implements the following service interfaces:

- Enabled on Databroker by default [kuksa.val.v2.VAL](proto/kuksa/val/v2/val.proto) (recommended to use)
- Enabled on Databroker by default [kuksa.val.v1.VAL](proto/kuksa/val/v1/val.proto)
- Disabled on Databroker by default [sdv.databroker.v1.Broker](proto/sdv/databroker/v1/broker.proto)
- Disabled on Databroker by default [sdv.databroker.v1.Collector](proto/sdv/databroker/v1/collector.proto)

<p align="right">(<a href="#readme-top">back to top</a>)</p>

<!-- GETTING STARTED -->

## Getting started
Expand Down Expand Up @@ -120,7 +135,8 @@ The quickest possible way to get Kuksa Databroker up and running.
### Reading and writing VSS data using the CLI

1. Start the CLI in a container attached to the _kuksa_ bridge network and connect to the Databroker container:
The databroker supports both of `sdv.databroker.v1` and `kuksa.val.v1` as an API. Per default the databroker-cli uses the `sdv.databroker.v1` interface. To change it use `--protocol` option when starting. Choose either one of `kuksa-val-v1` and `sdv-databroker-v1`.

The databroker supports the lastest new API `kuksa.val.v2` and `kuksa.val.v1` by default, `sdv.databroker.v1` must be enabled using `--enable-databroker-v1`. Per default the databroker-cli uses the `kuksa.val.v1` interface, which can be changed by supplying the `--protocol` option when starting. Choose either `kuksa.val.v1` or `sdv.databroker.v1`, as databroker-cli still does not support `kuksa.val.v2`.

```sh
# in a new terminal
Expand Down Expand Up @@ -252,6 +268,15 @@ cargo test --all-targets

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Performance
The Kuksa team has released an official tool to measure the latency and throughput of the Databroker for all supported APIs:
[kuksa-perf](https://github.com/eclipse-kuksa/kuksa-perf)

The use case measures the time it takes for a signal to be transferred from the Provider to the Signal Consumer
Signal Consumer(stream subscribe) <- Databroker <- Provider(stream publish)

Feel free to use it and share your results with us!

## Contributing

Please refer to the [Kuksa Contributing Guide](CONTRIBUTING.md).
Expand Down
2 changes: 1 addition & 1 deletion data/vss-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ use the full name. When official release is created replace the copied *.json-fi
Build and run kuksa_databroker using the new VSS file according to [documentation](../../README.md), e.g.

```sh
$cargo run --bin databroker -- --metadata ../data/vss-core/vss_release_4.0.json
$cargo run --bin databroker -- --metadata ./data/vss-core/vss_release_4.0.json
```

Use the client to verify that changes in VSS are reflected, by doing e.g. set/get on some new or renamed signals.
Expand Down
6 changes: 6 additions & 0 deletions databroker-cli/src/sdv_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,8 @@ mod test {
change_type: proto::v1::ChangeType::OnChange.into(),
description: "".into(),
allowed: None,
min: None,
max: None,
},
proto::v1::Metadata {
id: 2,
Expand All @@ -1272,6 +1274,8 @@ mod test {
change_type: proto::v1::ChangeType::OnChange.into(),
description: "".into(),
allowed: None,
min: None,
max: None,
},
proto::v1::Metadata {
id: 3,
Expand All @@ -1281,6 +1285,8 @@ mod test {
change_type: proto::v1::ChangeType::OnChange.into(),
description: "".into(),
allowed: None,
min: None,
max: None,
},
]
.to_vec();
Expand Down
17 changes: 17 additions & 0 deletions databroker-proto/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

use std::{env, path::PathBuf};

fn main() -> Result<(), Box<dyn std::error::Error>> {
std::env::set_var("PROTOC", protobuf_src::protoc());
tonic_build::configure()
Expand All @@ -23,8 +25,23 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
"proto/sdv/databroker/v1/collector.proto",
"proto/kuksa/val/v1/val.proto",
"proto/kuksa/val/v1/types.proto",
"proto/kuksa/val/v2/val.proto",
"proto/kuksa/val/v2/types.proto",
],
&["proto"],
)?;

let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
tonic_build::configure()
.file_descriptor_set_path(out_dir.join("kuksa.val.v2_descriptor.bin"))
.compile(
&[
"proto/kuksa/val/v2/val.proto",
"proto/kuksa/val/v2/types.proto",
],
&["proto"],
)
.unwrap();

Ok(())
}
6 changes: 6 additions & 0 deletions databroker-proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,11 @@ pub mod kuksa {
}
}
}
pub mod v2 {
tonic::include_proto!("kuksa.val.v2");

pub const FILE_DESCRIPTOR_SET: &[u8] =
tonic::include_file_descriptor_set!("kuksa.val.v2_descriptor");
}
}
}
7 changes: 5 additions & 2 deletions databroker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ kuksa-common = { path = "../lib/common"}
kuksa = { path = "../lib/kuksa"}
databroker-proto = { workspace = true }
tonic = { workspace = true, features = ["transport", "channel", "prost"] }
tonic-reflection = "0.11.0"
prost = { workspace = true }
prost-types = { workspace = true }
tokio = { workspace = true, features = [
Expand Down Expand Up @@ -60,9 +61,11 @@ jemallocator = { version = "0.5.0", optional = true }
lazy_static = "1.4.0"
thiserror = "1.0.47"

futures = { version = "0.3.28" }
async-trait = "0.1.82"

# VISS
axum = { version = "0.6.20", optional = true, features = ["ws"] }
futures = { version = "0.3.28", optional = true }
chrono = { version = "0.4.31", optional = true, features = ["std"] }
uuid = { version = "1.4.1", optional = true, features = ["v4"] }

Expand All @@ -74,7 +77,7 @@ sd-notify = "0.4.1"
default = ["tls"]
tls = ["tonic/tls"]
jemalloc = ["dep:jemallocator"]
viss = ["dep:axum", "dep:chrono", "dep:futures", "dep:uuid"]
viss = ["dep:axum", "dep:chrono", "dep:uuid"]
libtest = []

[build-dependencies]
Expand Down
Loading
Loading