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

Test/add mqtt zenoh reference implementation ci update #29

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/bundled-lint-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ jobs:
- name: cargo clippy without Zenoh & vsomeip transports
working-directory: ${{github.workspace}}
run: cargo clippy --all-targets -- -W warnings -D warnings
- name: Build the project with Zenoh & vsomeip transports (and thus streamer references)
- name: Build the project with Zenoh & vsomeip & mqtt transports (and thus streamer references)
working-directory: ${{github.workspace}}
run: cargo build --features vsomeip-transport,bundled-vsomeip,zenoh-transport
run: cargo build --features vsomeip-transport,bundled-vsomeip,zenoh-transport,mqtt-transport
- name: cargo clippy with Zenoh & vsomeip transports (and thus streamer references)
working-directory: ${{github.workspace}}
run: cargo clippy --features vsomeip-transport,bundled-vsomeip,zenoh-transport --all-targets -- -W warnings -D warnings
run: cargo clippy --features vsomeip-transport,bundled-vsomeip,zenoh-transport,mqtt-transport --all-targets -- -W warnings -D warnings
- name: cargo fmt
working-directory: ${{github.workspace}}
run: cargo fmt -- --check
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/unbundled-lint-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ jobs:
- name: cargo clippy without Zenoh & vsomeip transports
working-directory: ${{github.workspace}}
run: cargo clippy --all-targets -- -W warnings -D warnings
- name: Build the project with Zenoh & vsomeip transports (and thus streamer references)
- name: Build the project with Zenoh & vsomeip & mqtt transports (and thus streamer references)
working-directory: ${{github.workspace}}
run: cargo build --features vsomeip-transport,zenoh-transport
- name: cargo clippy with Zenoh & vsomeip transports (and thus streamer references)
run: cargo build --features vsomeip-transport,zenoh-transport,mqtt-transport
- name: cargo clippy with Zenoh & vsomeip & mqtt transports (and thus streamer references)
working-directory: ${{github.workspace}}
run: cargo clippy --features vsomeip-transport,zenoh-transport --all-targets -- -W warnings -D warnings
run: cargo clippy --features vsomeip-transport,zenoh-transport,mqtt-transport --all-targets -- -W warnings -D warnings
- name: cargo fmt
working-directory: ${{github.workspace}}
run: cargo fmt -- --check
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ tarpaulin-report.html
.vscode/launch.json
.vscode/settings.json
reports/

.cargo/
103 changes: 103 additions & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ members = [
"example-streamer-uses",
"utils/hello-world-protos",
"utils/integration-test-utils",
"up-linux-streamer", "up-linux-streamer-plugin",
"example-streamer-implementations", "up-linux-streamer-plugin",
"up-streamer", "subscription-cache", "utils/usubscription-static-file"]

[workspace.package]
Expand Down Expand Up @@ -44,6 +44,7 @@ protobuf = { version = "3.3", features = ["with-bytes"] }
up-rust = { version = "0.2.0", default-features = false }
up-transport-zenoh = { version = "0.3.0" }
up-transport-vsomeip = { git = "https://github.com/eclipse-uprotocol/up-transport-vsomeip-rust.git", tag = "v0.3.0", default-features = false }
up-transport-mqtt5 = { version = "0.1.0" }
zenoh = { version = "1.0.0", features = ["default", "plugins"] }
zenoh-core = { version = "1.0.0" }
zenoh-plugin-trait = { version = "1.0.0" }
Expand Down
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# up-streamer-rust
# up-streamer-rust: what is in this repository

## up-streamer

Expand All @@ -7,11 +7,17 @@ to write a uStreamer application to bridge from one transport to another.

Reference its README.md for further details.

## up-linux-streamer
## example-streamer-implementations

Concrete implementation of a uStreamer as a binary.
Two concrete implementations of a uStreamer as a binary. These can be used out of the box either to try running different UStreamer setups or to directly use them in a project!

Reference its README.md for further details.
Reference the README.md there for more details.

## example-streamer-uses

A number of UEntity examples for SOME/IP, Zenoh and MQTT5. These can be used together with the example streamer implementations to run basic setups of either a publisher and a subscriber, or a service and a client.

Reference the README.md there for more details.

## Building

Expand All @@ -25,22 +31,21 @@ cargo build

### Also build the reference Zenoh, vsomeip streamer implementations

You'll need to use the feature flags `vsomeip-transport` and `zenoh-transport`. You then also have the option of including your own vsomeip or using one bundled in `up-transport-vsomeip`.
You'll need to use the feature flags `vsomeip-transport`, `zenoh-transport` or `mqtt-transport` depending on which implementation you want to build. You then also have the option of including your own vsomeip or using one bundled in `up-transport-vsomeip`.

For the bundled option, the following:
For the bundled option, set the following environment variables (for example in your .cargo/config.toml file):

```toml
[env]
GENERIC_CPP_STDLIB_PATH=<path to your c++ stdlib (for example /usr/include/c++/13)>
ARCH_SPECIFIC_CPP_STDLIB_PATH=<path to your c++ stdlib (for example /usr/include/x86_64-linux-gnu/c++/13)>
```
GENERIC_CPP_STDLIB_PATH=<see-below> ARCH_SPECIFIC_CPP_STDLIB_PATH=<see-below> cargo build --features vsomeip-transport,bundled-vsomeip,zenoh-transport
```

where for reference on my machine:

```
GENERIC_CPP_STDLIB_PATH=/usr/include/c++/13
ARCH_SPECIFIC_CPP_STDLIB_PATH=/usr/include/x86_64-linux-gnu/c++/13
```bash
cargo build --features vsomeip-transport,bundled-vsomeip,zenoh-transport
```

These environment varialbes are necessary because of a workaround done in `up-transport-vsomeip` due to not being able to figure out another way to compile vsomeip without them. (If you can figure out how to avoid this, I'm all ears!)
The environment variables are necessary because of a workaround done in `up-transport-vsomeip` due to not being able to figure out another way to compile vsomeip without them. (If you can figure out how to avoid this, I'm all ears!)

Please reference the documentation for [vsomeip-sys](https://github.com/eclipse-uprotocol/up-transport-vsomeip-rust/tree/main/vsomeip-sys) for more details on:
* the build requirements for vsomeip in the linked documentation in the COVESA repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ keywords.workspace = true
license.workspace = true

[[bin]]
name = "up-linux-streamer"
path = "src/main.rs"
name = "zenoh_someip"
required-features = ["zenoh-transport", "vsomeip-transport"]

[[bin]]
name = "zenoh_mqtt"
required-features = ["zenoh-transport", "mqtt-transport"]

[features]
default = []
zenoh-transport = ["up-transport-zenoh", "zenoh"]
mqtt-transport = ["up-transport-mqtt5"]
vsomeip-transport = ["up-transport-vsomeip"]
bundled-vsomeip = ["up-transport-vsomeip/bundled"]

Expand All @@ -44,6 +48,7 @@ up-rust = { workspace = true }
up-streamer = { path = "../up-streamer" }
up-transport-zenoh = { workspace = true, optional = true }
up-transport-vsomeip = { workspace = true, optional = true }
up-transport-mqtt5 = { workspace = true, optional = true }
zenoh = { workspace = true, optional = true }
usubscription-static-file = {path = "../utils/usubscription-static-file"}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
streamer_uuri: {
// Determines the authority_name of the host device
// Used when initializing host transport
authority: "linux",
authority: "authority_B",
// Determines the ue_id of the streamer
// Used when initializing host transport
ue_id: 78,
Expand All @@ -21,21 +21,35 @@
},
usubscription_config: {
// Lists the path to the subscription file when using static file
file_path: "./utils/usubscription-static-file/static-configs/testdata.json"
file_path: "../example-streamer-implementations/subscription_data.json"
},
zenoh_transport_config: {
// Configuration file which is where zenoh config information is stored
config_file: "./up-linux-streamer/ZENOH_CONFIG.json5"
config_file: "../example-streamer-implementations/ZENOH_CONFIG.json5"
},
// Configurations related to the host device we are running the streamer on
host_config: {
// Determines which transport to initialize for the host device
transport: "Zenoh",
},
mqtt_config: {
// The URL of the MQTT broker (the provided mosquitto broker runs on locahost but docker networks might complicate that)
hostname: "localhost",
// The port of the broker (unencrypted MQTT like the provided mosquitto broker typically uses 1883, encrypted uses 8883)
port: 1883,
// How many messages the broker should buffer for this connections
max_buffered_messages: 100,
// How many individual topic subscriptions are supported through this connection
max_subscriptions: 100,
// How long the connection should stay open for
session_expiry_interval: 3600,
// The username that the mqtt client gives the broker when connecting (usually not important)
username: "user"
},
someip_config: {
// Determines the authority_name of the mechatronics network
// Used when initializing SOME/IP transport
authority: "me_authority",
authority: "authority_A",
// The vsomeip configuration file to be used when initializing the vsomeip transport
//
// Some guidance:
Expand All @@ -46,11 +60,9 @@
// called
// * the `id` field should be chosen such that it matches the ue_id of the uE on the host
// device
config_file: "../../up-linux-streamer/vsomeip-configs/point_to_point.json",
config_file: "../../example-streamer-implementations/vsomeip-configs/point_to_point.json",
// An ID to use for a vsomeip application which will represent all subscriptions to
// publish messages output over vsomeip
default_someip_application_id_for_someip_subscriptions: 10,
// Whether to enable bridging across to the mechatronics network
enabled: true
default_someip_application_id_for_someip_subscriptions: 10
},
}
Loading
Loading