Skip to content

Commit

Permalink
chores: update dependencies to latest versions
Browse files Browse the repository at this point in the history
The updates that induced changes were:

- (Zenoh-Flow) flume 0.10 -> 0.11: as we were explicitly defining the
  Subscriber (in particular the `Receiver<Sample>`), the version of flume we
  were using was tied to Zenoh's. By using Zenoh's `FlumeSubscriber`, we can
  update the version of flume independently of Zenoh.

- (cargo-zenoh-flow) toml 0.5 -> 0.7: parsing must be done via a String rather
  than via slice.

Signed-off-by: Julien Loudet <julien.loudet@zettascale.tech>
  • Loading branch information
J-Loudet committed Sep 29, 2023
1 parent 0e9460f commit c6ee2af
Show file tree
Hide file tree
Showing 12 changed files with 491 additions and 251 deletions.
525 changes: 376 additions & 149 deletions Cargo.lock

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,22 @@ repository = "https://github.com/eclipse-zenoh/zenoh-flow"
version = "0.6.0-dev"

[workspace.dependencies]
clap = { version = "4.0" }
async-std = "1.12"
async-trait = "0.1.50"
base64 = "0.21"
clap = "4.0"
env_logger = "0.10"
flume = "0.11"
futures = "0.3.15"
git-version = "0.3"
log = "0.4"
serde = "1.0"
serde_cbor = "0.11"
serde_derive = "1.0"
serde_json = "1.0"
serde_yaml = "0.9"
uhlc = "0.6"
uuid = "1.1"
zenoh = { version = "0.7.2-rc" }
zenoh-collections = { version = "0.7.2-rc" }
zenoh-core = { version = "0.7.2-rc" }
Expand Down
14 changes: 7 additions & 7 deletions cargo-zenoh-flow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ version.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-std = { version = "=1.12.0", features = ["attributes"] }
cargo_toml = "0.13"
async-std = { workspace = true, features = ["attributes"] }
cargo_toml = "0.15"
clap = { workspace = true, features = ["derive"] }
colored = "2"
rand = { version = "0.8", optional = true }
serde = { version = "1.0", features = ["derive"] }
serde_derive = "1.0"
serde_json = "1.0"
serde_yaml = { version = "0.9" }
serde = { workspace = true, features = ["derive"] }
serde_derive = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
tinytemplate = "1.2"
toml = "0.5.8"
toml = "0.7"
zenoh = { workspace = true, optional = true }
zenoh-flow = { path = "../zenoh-flow", version = "0.6.0-dev" }
zenoh-util = { workspace = true, optional = true }
Expand Down
36 changes: 18 additions & 18 deletions cargo-zenoh-flow/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,24 @@ pub fn from_manifest(
let manifest_path = Path::new(&root_package.manifest_path);

let manifest_dir = manifest_path.parent().unwrap();
let content = std::fs::read(manifest_path)?;

let metadata = toml::from_slice::<Cargo>(&content)?
.package
.metadata
.ok_or_else(|| {
CZFError::MissingField(
root_package.id.clone(),
"Missing package.metadata.zenohflow",
)
})?
.zenohflow
.ok_or_else(|| {
CZFError::MissingField(
root_package.id.clone(),
"Missing package.metadata.zenohflow",
)
})?;

let metadata =
toml::from_str::<Cargo>(&String::from_utf8_lossy(&std::fs::read(manifest_path)?))?
.package
.metadata
.ok_or_else(|| {
CZFError::MissingField(
root_package.id.clone(),
"Missing package.metadata.zenohflow",
)
})?
.zenohflow
.ok_or_else(|| {
CZFError::MissingField(
root_package.id.clone(),
"Missing package.metadata.zenohflow",
)
})?;

Ok((metadata, target_dir.into(), manifest_dir.into()))
}
Expand Down
30 changes: 14 additions & 16 deletions zenoh-flow-daemon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,24 @@ readme.workspace = true
repository.workspace = true
version.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-ctrlc = { version = "1.2.0", features = ["stream"] }
async-std = { version = "=1.12.0", features = ["attributes"] }
async-trait = "0.1.50"
async-std = { workspace = true, features = ["attributes"] }
async-trait = { workspace = true }
clap = { workspace = true, features = ["derive"] }
env_logger = "0.10.0"
flume = "0.10"
futures = "0.3.5"
git-version = "0.3"
env_logger = { workspace = true }
flume = { workspace = true }
futures = { workspace = true }
git-version = { workspace = true }
hostname = "0.3.1"
log = "0.4"
machine-uid = "0.2.0"
serde = { version = "1.0", features = ["derive", "rc"] }
serde_derive = "1.0"
serde_json = "1.0"
serde_yaml = { version = "0.9" }
uhlc = "0.5.1"
uuid = { version = "1.1", features = ["serde", "v4"] }
log = { workspace = true }
machine-uid = "0.5.0"
serde = { workspace = true, features = ["derive", "rc"] }
serde_derive = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
uhlc = { workspace = true }
uuid = { workspace = true, features = ["serde", "v4"] }
zenoh = { workspace = true }
zenoh-flow = { version = "0.6.0-dev", path = "../zenoh-flow" }
zenoh-util = { workspace = true }
Expand Down
16 changes: 8 additions & 8 deletions zenoh-flow-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ version.workspace = true

[dependencies]
Inflector = "0.11.4"
async-std = { version = "=1.12.0", features = ["attributes"] }
darling = "0.14"
futures = "0.3.5"
async-std = { workspace = true, features = ["attributes"] }
darling = "0.20"
futures = { workspace = true }
proc-macro-error = "1.0.4"
proc-macro2 = "1.0"
quote = "1.0"
serde = { version = "1.0.55", features = ["derive"] }
serde_derive = "1.0.55"
syn = { version = "1.0", features = ["full"] }
syn-serde = { version = "0.2", features = ["json"] }
serde = { workspace = true, features = ["derive"] }
serde_derive = { workspace = true }
syn = { version = "2", features = ["full"] }
syn-serde = { version = "0.3", features = ["json"] }

[dev-dependencies]
env_logger = "0.9"
env_logger = { workspace = true }

[lib]
proc-macro = true
18 changes: 9 additions & 9 deletions zenoh-flow-plugin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ default = ["no_mangle"]
no_mangle = ["zenoh-plugin-trait/no_mangle"]

[dependencies]
async-std = "=1.12.0"
async-trait = "0.1.57"
async-std = { workspace = true }
async-trait = { workspace = true }
clap = { workspace = true }
env_logger = "0.10"
flume = "0.10.14"
futures = "0.3.24"
git-version = "0.3.5"
env_logger = { workspace = true }
flume = { workspace = true }
futures = { workspace = true }
git-version = { workspace = true }
lazy_static = "1.4.0"
log = "0.4.17"
serde = { version = "1.0", features = ["derive", "rc"] }
serde_json = "1.0"
log = { workspace = true }
serde = { workspace = true, features = ["derive", "rc"] }
serde_json = { workspace = true }
zenoh = { workspace = true, features = ["unstable"] }
zenoh-collections = { workspace = true }
zenoh-core = { workspace = true }
Expand Down
38 changes: 19 additions & 19 deletions zenoh-flow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,38 @@ version.workspace = true
anyhow = { version = "1.0", default-features = false, features = ["std"] }
async-lock = "2.4.0"
async-recursion = "1.0.0"
async-std = { version = "=1.12.0", features = ["attributes"] }
async-trait = "0.1.50"
base64 = "0.20.0"
async-std = { workspace = true, features = ["attributes"] }
async-trait = { workspace = true }
base64 = { workspace = true }
bincode = { version = "1.3" }
bytesize = "1.2.0"
clap = { workspace = true, features = ["derive"] }
const_format = "0.2.22"
derive_more = "0.99.10"
env_logger = "0.10"
event-listener = "2.5.1"
flume = "0.10"
futures = "0.3.15"
env_logger = { workspace = true }
event-listener = "3.0"
flume = { workspace = true }
futures = { workspace = true }
futures-lite = "1.12"
git-version = "0.3"
humantime = "2.1.0"
itertools = "0.10.3"
libloading = "0.7.0"
log = "0.4"
git-version = { workspace = true }
humantime = "2.1"
itertools = "0.11"
libloading = "0.8"
log = { workspace = true }
more-asserts = "0.3"
paste = "1.0"
petgraph = "0.6.0"
pin-project-lite = "0.2.4"
ramhorns = "0.14"
serde = { version = "1.0.55", features = ["derive", "rc"] }
serde = { workspace = true, features = ["derive", "rc"] }
serde_cbor = { version = "0.11", optional = true }
serde_derive = "1.0.55"
serde_json = { version = "1.0", optional = true }
serde_yaml = { version = "0.9" }
serde_derive = { workspace = true }
serde_json = { workspace = true, optional = true }
serde_yaml = { workspace = true }
typetag = "0.2"
uhlc = "0.5.1"
uhlc = { workspace = true }
url = "2.2"
uuid = { version = "1.1", features = ["serde", "v4"] }
uuid = { workspace = true, features = ["serde", "v4"] }
zenoh = { workspace = true, features = ["shared-memory"] }
zenoh-flow-derive = { version = "0.6.0-dev", path = "../zenoh-flow-derive" }
zenoh-sync = { workspace = true }
Expand All @@ -68,7 +68,7 @@ zrpc = { workspace = true }
zrpc-macros = { workspace = true }

[dev-dependencies]
prost = "0.11"
prost = "0.12"
tempdir = "0.3.7"

[build-dependencies]
Expand Down
19 changes: 10 additions & 9 deletions zenoh-flow/src/runtime/dataflow/instance/builtin/zenoh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ use crate::{
};
use async_std::sync::Mutex;
use async_trait::async_trait;
use flume::{Receiver, RecvError};
use futures::{future::select_all, Future};
use std::mem;
use std::sync::Arc;
use std::{collections::HashMap, pin::Pin};
use std::{error::Error, mem};
use zenoh::{
prelude::r#async::*, publication::Publisher, shm::SharedMemoryManager, subscriber::Subscriber,
prelude::r#async::*, publication::Publisher, shm::SharedMemoryManager,
subscriber::FlumeSubscriber,
};

/// Key for the key expressions used by the built-in Source/Sink.
Expand All @@ -51,12 +51,13 @@ static KEY_SHM_TOTAL_ELEMENTS: &str = "shared_memory_elements";
static KEY_SHM_BACKOFF: &str = "shared_memory_backoff";

/// Internal type of pending futures for the ZenohSource
pub(crate) type ZSubFut =
Pin<Box<dyn Future<Output = (PortId, Result<Sample, RecvError>)> + Send + Sync>>;
pub(crate) type ZSubFut = Pin<
Box<dyn Future<Output = (PortId, Result<Sample, Box<dyn Error + Send + Sync>>)> + Send + Sync>,
>;

fn wait_zenoh_sub(id: PortId, sub: &Subscriber<Receiver<Sample>>) -> ZSubFut {
fn wait_zenoh_sub(id: PortId, sub: &FlumeSubscriber<'_>) -> ZSubFut {
let sub = sub.receiver.clone();
Box::pin(async move { (id, sub.recv_async().await) })
Box::pin(async move { (id, sub.recv_async().await.map_err(|e| e.into())) })
}

/// The builtin Zenoh Source
Expand All @@ -70,7 +71,7 @@ fn wait_zenoh_sub(id: PortId, sub: &Subscriber<Receiver<Sample>>) -> ZSubFut {
pub(crate) struct ZenohSource<'a> {
_session: Arc<Session>,
outputs: HashMap<PortId, OutputRaw>,
subscribers: HashMap<PortId, Subscriber<'a, Receiver<Sample>>>,
subscribers: HashMap<PortId, FlumeSubscriber<'a>>,
futs: Arc<Mutex<Vec<ZSubFut>>>,
}

Expand Down Expand Up @@ -136,7 +137,7 @@ impl<'a> Source for ZenohSource<'a> {
mut outputs: Outputs,
) -> ZFResult<Self> {
let mut source_outputs: HashMap<PortId, OutputRaw> = HashMap::new();
let mut subscribers: HashMap<PortId, Subscriber<'a, Receiver<Sample>>> = HashMap::new();
let mut subscribers: HashMap<PortId, FlumeSubscriber<'a>> = HashMap::new();

match configuration {
Some(configuration) => {
Expand Down
5 changes: 2 additions & 3 deletions zenoh-flow/src/runtime/dataflow/instance/runners/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ use crate::zfresult::ErrorKind;
use crate::Result as ZFResult;
use async_std::sync::Mutex;
use async_trait::async_trait;
use flume::Receiver;
use std::sync::atomic::AtomicU64;
use std::sync::Arc;
use zenoh::prelude::r#async::*;
use zenoh::shm::SharedMemoryManager;
use zenoh::subscriber::Subscriber;
use zenoh::subscriber::FlumeSubscriber;
use zenoh_util::core::AsyncResolve;

/// The `ZenohSender` is the connector that sends the data to Zenoh when nodes are running on
Expand Down Expand Up @@ -258,7 +257,7 @@ impl Node for ZenohSender {
pub(crate) struct ZenohReceiver {
pub(crate) id: NodeId,
pub(crate) output_raw: OutputRaw,
pub(crate) subscriber: Subscriber<'static, Receiver<Sample>>,
pub(crate) subscriber: FlumeSubscriber<'static>,
}

impl ZenohReceiver {
Expand Down
2 changes: 1 addition & 1 deletion zenoh-flow/src/runtime/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ impl DataStore {
pub async fn subscribe_sumbitted_jobs(
&self,
rtid: &ZenohId,
) -> Result<zenoh::subscriber::Subscriber<'static, flume::Receiver<Sample>>> {
) -> Result<zenoh::subscriber::FlumeSubscriber<'static>> {
let selector = JQ_SUMBITTED_SEL!(ROOT_STANDALONE, rtid);
self.z.declare_subscriber(&selector).res().await
}
Expand Down
22 changes: 11 additions & 11 deletions zfctl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,25 @@ repository.workspace = true
version.workspace = true

[dependencies]
async-std = { version = "=1.12.0", features = ["attributes"] }
base64 = "0.20.0"
async-std = { workspace = true, features = ["attributes"] }
base64 = { workspace = true }
clap = { workspace = true, features = ["derive"] }
derive_more = "0.99.10"
# FIXME: Remove when `std::env::home_dir` gets fixed.
dirs = "4.0.0"
env_logger = "0.10.0"
dirs = "5.0"
env_logger = { workspace = true }
exitfailure = "0.5.1"
failure = "0.1.8"
git-version = "0.3.4"
log = "0.4"
git-version = { workspace = true }
log = { workspace = true }
prettytable-rs = "^0.10"
rand = "0.8.3"
semver = { version = "1.0.4", features = ["serde"] }
serde = { version = "1.0.55", features = ["derive"] }
serde_derive = "1.0.55"
serde_json = "1.0.55"
serde_yaml = "0.9"
uuid = { version = "1.1", features = ["serde", "v4"] }
serde = { workspace = true, features = ["derive"] }
serde_derive = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
uuid = { workspace = true, features = ["serde", "v4"] }
zenoh = { workspace = true }
zenoh-flow = { version = "0.6.0-dev", path = "../zenoh-flow" }
zenoh-util = { workspace = true }
Expand Down

0 comments on commit c6ee2af

Please sign in to comment.