Skip to content

Commit

Permalink
Merge commit 'a6bc509b5997c922a56253455149858af715edfa'
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowhatter committed Dec 19, 2024
2 parents 61420fc + a6bc509 commit 3c9af5d
Show file tree
Hide file tree
Showing 111 changed files with 4,922 additions and 902 deletions.
5 changes: 4 additions & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ changelog:
- dependencies
- title: Other changes
labels:
- "*"
- "*"
exclude:
labels:
- internal
17 changes: 13 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ jobs:
uses: taiki-e/install-action@nextest

- name: Run tests
run: cargo nextest run -F test --exclude zenoh-examples --exclude zenoh-plugin-example --workspace
run: cargo nextest run -F test -F internal_config --exclude zenoh-examples --exclude zenoh-plugin-example --workspace

- name: Run tests with SHM
if: ${{ matrix.os == 'macOS-latest' || matrix.os == 'windows-latest' }}
run: cargo nextest run -F test -F shared-memory -F unstable -E 'not (test(test_default_features))' --exclude zenoh-examples --exclude zenoh-plugin-example --workspace
run: cargo nextest run -F test -F shared-memory -F unstable -F internal_config -E 'not (test(test_default_features))' --exclude zenoh-examples --exclude zenoh-plugin-example --workspace

- name: Run tests with SHM + unixpipe
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo nextest run -F test -F shared-memory -F unstable -F transport_unixpipe -E 'not (test(test_default_features))' --exclude zenoh-examples --exclude zenoh-plugin-example --workspace
run: cargo nextest run -F test -F shared-memory -F unstable -F internal_config -F transport_unixpipe -E 'not (test(test_default_features))' --exclude zenoh-examples --exclude zenoh-plugin-example --workspace

- name: Check for feature leaks
if: ${{ matrix.os == 'ubuntu-latest' }}
Expand Down Expand Up @@ -186,6 +186,15 @@ jobs:

- name: Check spelling
uses: crate-ci/typos@master

markdown_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v18
with:
config: '.markdownlint.yaml'
globs: '**/README.md'

# NOTE: In GitHub repository settings, the "Require status checks to pass
# before merging" branch protection rule ensures that commits are only merged
Expand All @@ -195,7 +204,7 @@ jobs:
ci:
name: CI status checks
runs-on: ubuntu-latest
needs: [check, test, valgrind, typos]
needs: [check, test, valgrind, typos, markdown_lint]
if: always()
steps:
- name: Check whether all jobs pass
Expand Down
6 changes: 6 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"MD013": false, # Line length limitation
"MD033": false, # Enable Inline HTML
"MD041": false, # Allow first line heading
"MD045": false, # Allow Images have no alternate text
}
30 changes: 27 additions & 3 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ git-version = "0.3.9"
hashbrown = "0.14"
hex = { version = "0.4.3", default-features = false } # Default features are disabled due to usage in no_std crates
hmac = { version = "0.12.1", features = ["std"] }
home = "0.5.9"
home = "=0.5.9"
http-types = "2.12.0"
humantime = "2.1.0"
itertools = "0.13.0"
Expand Down Expand Up @@ -137,6 +137,7 @@ quote = "1.0.37"
rand = { version = "0.8.5", default-features = false } # Default features are disabled due to usage in no_std crates
rand_chacha = "0.3.1"
rcgen = "0.13.1"
ref-cast = "1.0.23"
regex = "1.10.6"
ron = "0.8.1"
ringbuffer-spsc = "0.1.9"
Expand Down Expand Up @@ -188,7 +189,7 @@ vec_map = "0.8.2"
webpki-roots = "0.26.5"
winapi = { version = "0.3.9", features = ["iphlpapi", "winerror"] }
x509-parser = "0.16.0"
z-serial = "0.2.3"
z-serial = "0.3.1"
either = "1.13.0"
prost = "0.13.2"
tls-listener = { version = "0.10.2", features = ["rustls-ring"] }
Expand Down
35 changes: 29 additions & 6 deletions DEFAULT_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
///
/// It is also possible to specify a priority range and/or a reliability setting to be used on the link.
/// For example `tcp/localhost?prio=6-7;rel=0` assigns priorities "data_low" and "background" to the established link.
///
/// For TCP and TLS links, it is possible to specify the TCP buffer sizes:
/// E.g. tcp/192.168.0.1:7447#so_sndbuf=65000;so_rcvbuf=65000
connect: {
/// timeout waiting for all endpoints connected (0: no retry, -1: infinite timeout)
/// Accepts a single value (e.g. timeout_ms: 0)
Expand Down Expand Up @@ -68,6 +71,9 @@
///
/// It is also possible to specify a priority range and/or a reliability setting to be used on the link.
/// For example `tcp/localhost?prio=6-7;rel=0` assigns priorities "data_low" and "background" to the established link.
///
/// For TCP and TLS links, it is possible to specify the TCP buffer sizes:
/// E.g. tcp/192.168.0.1:7447#so_sndbuf=65000;so_rcvbuf=65000
listen: {
/// timeout waiting for all listen endpoints (0: no retry, -1: infinite timeout)
/// Accepts a single value (e.g. timeout_ms: 0)
Expand Down Expand Up @@ -128,10 +134,10 @@
/// The time-to-live on multicast scouting packets
ttl: 1,
/// Which type of Zenoh instances to automatically establish sessions with upon discovery on UDP multicast.
/// Accepts a single value (e.g. autoconnect: ["router", "peer"])
/// or different values for router, peer and client (e.g. autoconnect: { router: [], peer: ["router", "peer"] }).
/// Accepts a single value (e.g. autoconnect: ["router", "peer"]) which applies whatever the configured "mode" is,
/// or different values for router, peer or client mode (e.g. autoconnect: { router: [], peer: ["router", "peer"] }).
/// Each value is a list of: "peer", "router" and/or "client".
autoconnect: { router: [], peer: ["router", "peer"] },
autoconnect: { router: [], peer: ["router", "peer"], client: ["router", "peer"] },
/// Whether or not to listen for scout messages on UDP multicast and reply to them.
listen: true,
},
Expand All @@ -146,10 +152,10 @@
/// direct connectivity with each other.
multihop: false,
/// Which type of Zenoh instances to automatically establish sessions with upon discovery on gossip.
/// Accepts a single value (e.g. autoconnect: ["router", "peer"])
/// or different values for router, peer and client (e.g. autoconnect: { router: [], peer: ["router", "peer"] }).
/// Accepts a single value (e.g. autoconnect: ["router", "peer"]) which applies whatever the configured "mode" is,
/// or different values for router, peer or client mode (e.g. autoconnect: { router: [], peer: ["router", "peer"] }).
/// Each value is a list of: "peer", "router" and/or "client".
autoconnect: { router: [], peer: ["router", "peer"] },
autoconnect: { router: [], peer: ["router", "peer"], client: ["router", "peer"] },
},
},

Expand Down Expand Up @@ -331,6 +337,8 @@
transport: {
unicast: {
/// Timeout in milliseconds when opening a link
open_timeout: 10000,
/// Timeout in milliseconds when accepting a link
accept_timeout: 10000,
/// Maximum number of zenoh session in pending state while accepting
accept_pending: 100,
Expand Down Expand Up @@ -494,7 +502,22 @@
// If set to true, links that require certificates (tls/quic) will automatically disconnect when the time of expiration of the remote certificate chain is reached
// note that mTLS (client authentication) is required for a listener to disconnect a client on expiration
close_link_on_expiration: false,
/// Optional configuration for TCP system buffers sizes for TLS links
///
/// Configure TCP read buffer size (bytes)
// so_rcvbuf: 123456,
/// Configure TCP write buffer size (bytes)
// so_sndbuf: 123456,
},
// // Configure optional TCP link specific parameters
// tcp: {
// /// Optional configuration for TCP system buffers sizes for TCP links
// ///
// /// Configure TCP read buffer size (bytes)
// // so_rcvbuf: 123456,
// /// Configure TCP write buffer size (bytes)
// // so_sndbuf: 123456,
// }
},
/// Shared memory configuration.
/// NOTE: shared memory can be used only if zenoh is compiled with "shared-memory" feature, otherwise
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Zenoh's router is built as `target/release/zenohd`. All the examples are built i
* run the Zenoh router with permission to perform config changes via the admin space, and with a memory storage:

```sh
./target/release/zenohd --adminspace-permissions=rw --cfg='plugins/storage_manager/storages/demo:{key_expr:"demo/example/**",volume:"memory"}'
./target/release/zenohd --rest-http-port=8000 --adminspace-permissions=rw --cfg='plugins/storage_manager/storages/demo:{key_expr:"demo/example/**",volume:"memory"}'
```

* in another shell, get info of the zenoh router via the zenoh admin space (you may use `jq` for pretty json formatting):
Expand Down Expand Up @@ -246,11 +246,11 @@ By default the Zenoh router is delivered or built with 2 plugins. These may be c
> [!WARNING]
> Since `v0.6`, `zenohd` no longer loads every available plugin at startup. Instead, only configured plugins are loaded (after processing `--cfg` and `--plugin` options). Once `zenohd` is running, plugins can be hot-loaded and, if they support it, reconfigured at runtime by editing their configuration through the adminspace.

Note that the REST plugin is added to the configuration by the default value of the `--rest-http-port` CLI argument.

**[REST plugin](https://zenoh.io/docs/manual/plugin-http/)** (exposing a REST API):
This plugin converts GET and PUT REST requests into Zenoh gets and puts respectively.

Note that to activate the REST plugin on `zenohd` the CLI argument should be passed: `--rest-http-port=8000` (or any other port of your choice).

**[Storages plugin](https://zenoh.io/docs/manual/plugin-storage-manager/)** (managing [backends and storages](https://zenoh.io/docs/manual/plugin-storage-manager/#backends-and-volumes))
This plugin allows you to easily define storages. These will store key-value pairs they subscribed to, and send the most recent ones when queried. Check out [DEFAULT_CONFIG.json5](DEFAULT_CONFIG.json5) for info on how to configure them.

Expand Down
2 changes: 0 additions & 2 deletions commons/zenoh-buffers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ This crate is intended for Zenoh's internal use.

- [Click here for Zenoh's main repository](https://github.com/eclipse-zenoh/zenoh)
- [Click here for Zenoh's documentation](https://zenoh.io)


2 changes: 0 additions & 2 deletions commons/zenoh-codec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ This crate is intended for Zenoh's internal use.

- [Click here for Zenoh's main repository](https://github.com/eclipse-zenoh/zenoh)
- [Click here for Zenoh's documentation](https://zenoh.io)


2 changes: 0 additions & 2 deletions commons/zenoh-collections/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ This crate is intended for Zenoh's internal use.

- [Click here for Zenoh's main repository](https://github.com/eclipse-zenoh/zenoh)
- [Click here for Zenoh's documentation](https://zenoh.io)


2 changes: 0 additions & 2 deletions commons/zenoh-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ This crate is intended for Zenoh's internal use.

- [Click here for Zenoh's main repository](https://github.com/eclipse-zenoh/zenoh)
- [Click here for Zenoh's documentation](https://zenoh.io)


1 change: 1 addition & 0 deletions commons/zenoh-config/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ impl Default for ConnectConfig {
impl Default for TransportUnicastConf {
fn default() -> Self {
Self {
open_timeout: 10_000,
accept_timeout: 10_000,
accept_pending: 100,
max_sessions: 1_000,
Expand Down
13 changes: 13 additions & 0 deletions commons/zenoh-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ validated_struct::validator! {
TransportConf {
pub unicast: TransportUnicastConf {
/// Timeout in milliseconds when opening a link (default: 10000).
open_timeout: u64,
/// Timeout in milliseconds when accepting a link (default: 10000).
accept_timeout: u64,
/// Number of links that may stay pending during accept phase (default: 100).
accept_pending: usize,
Expand Down Expand Up @@ -499,6 +501,10 @@ validated_struct::validator! {
connect_certificate: Option<String>,
verify_name_on_connect: Option<bool>,
close_link_on_expiration: Option<bool>,
/// Configure TCP write buffer size
pub so_sndbuf: Option<u32>,
/// Configure TCP read buffer size
pub so_rcvbuf: Option<u32>,
// Skip serializing field because they contain secrets
#[serde(skip_serializing)]
root_ca_certificate_base64: Option<SecretValue>,
Expand All @@ -511,6 +517,13 @@ validated_struct::validator! {
#[serde(skip_serializing)]
connect_certificate_base64 : Option<SecretValue>,
},
pub tcp: #[derive(Default)]
TcpConf {
/// Configure TCP write buffer size
pub so_sndbuf: Option<u32>,
/// Configure TCP read buffer size
pub so_rcvbuf: Option<u32>,
},
pub unixpipe: #[derive(Default)]
UnixPipeConf {
file_access_mask: Option<u32>
Expand Down
10 changes: 10 additions & 0 deletions commons/zenoh-config/src/wrappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ pub struct EntityGlobalId(EntityGlobalIdProto);
pub type EntityId = u32;

impl EntityGlobalId {
/// Creates a new EntityGlobalId.
#[zenoh_macros::internal]
pub fn new(zid: ZenohId, eid: EntityId) -> Self {
EntityGlobalIdProto {
zid: zid.into(),
eid,
}
.into()
}

/// Returns the [`ZenohId`], i.e. the Zenoh session, this ID is associated to.
pub fn zid(&self) -> ZenohId {
self.0.zid.into()
Expand Down
2 changes: 0 additions & 2 deletions commons/zenoh-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ This crate is intended for Zenoh's internal use.

- [Click here for Zenoh's main repository](https://github.com/eclipse-zenoh/zenoh)
- [Click here for Zenoh's documentation](https://zenoh.io)


2 changes: 0 additions & 2 deletions commons/zenoh-crypto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ This crate is intended for Zenoh's internal use.

- [Click here for Zenoh's main repository](https://github.com/eclipse-zenoh/zenoh)
- [Click here for Zenoh's documentation](https://zenoh.io)


2 changes: 0 additions & 2 deletions commons/zenoh-keyexpr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ This crate is intended for Zenoh's internal use.

- [Click here for Zenoh's main repository](https://github.com/eclipse-zenoh/zenoh)
- [Click here for Zenoh's documentation](https://zenoh.io)


2 changes: 0 additions & 2 deletions commons/zenoh-macros/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ This crate is intended for Zenoh's internal use.

- [Click here for Zenoh's main repository](https://github.com/eclipse-zenoh/zenoh)
- [Click here for Zenoh's documentation](https://zenoh.io)


2 changes: 1 addition & 1 deletion commons/zenoh-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ pub fn ke(tokens: TokenStream) -> TokenStream {
let value: LitStr = syn::parse(tokens).unwrap();
let ke = value.value();
match zenoh_keyexpr::keyexpr::new(&ke) {
Ok(_) => quote!(unsafe {::zenoh::key_expr::keyexpr::from_str_unchecked(#ke)}).into(),
Ok(_) => quote!(unsafe { zenoh::key_expr::keyexpr::from_str_unchecked(#ke)}).into(),
Err(e) => panic!("{}", e),
}
}
Expand Down
2 changes: 0 additions & 2 deletions commons/zenoh-protocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ This crate is intended for Zenoh's internal use.

- [Click here for Zenoh's main repository](https://github.com/eclipse-zenoh/zenoh)
- [Click here for Zenoh's documentation](https://zenoh.io)


Loading

0 comments on commit 3c9af5d

Please sign in to comment.