Skip to content

Commit 3f90cda

Browse files
authored
Bump several crate versions (#80)
* Bump versions anyhow, clap crossterm crates Signed-off-by: Guvenc Gulce <[email protected]> * Bump tonic and prost crates to latest version Signed-off-by: Guvenc Gulce <[email protected]> * Fix clippy warning Signed-off-by: Guvenc Gulce <[email protected]> * Bump rtnetlink version to the latest Signed-off-by: Guvenc Gulce <[email protected]> --------- Signed-off-by: Guvenc Gulce <[email protected]>
1 parent 26f019c commit 3f90cda

File tree

16 files changed

+210
-273
lines changed

16 files changed

+210
-273
lines changed

Cargo.lock

Lines changed: 154 additions & 235 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ edition = "2021"
1717
[workspace.dependencies]
1818
tokio = { version = "1.47.1", features = ["full"] }
1919
tokio-stream = { version = "0.1.15", features = ["net"] }
20-
tonic = "0.11.0"
21-
prost = "0.12.3"
22-
prost-types = "0.12.3"
23-
anyhow = "1.0.80"
20+
tonic = "0.13.0"
21+
prost = "0.13.5"
22+
prost-types = "0.13.5"
23+
anyhow = "1.0.100"
2424
nix = { version = "0.29.0", features = ["mount", "user", "reboot", "feature", "net", "aio", "signal", "process", "fs", "hostname"] }
2525
serde = { version = "1.0", features = ["derive"] }
2626
serde_json = "1.0.132"
2727
uuid = { version = "1.18.1", features = ["v4"] }
28-
tonic-build = "0.11.0"
28+
tonic-build = "0.13.0"
2929
log = "0.4.28"
3030
env_logger = "0.11"
3131
openssl = { version = "0.10.72", features = ["vendored"] }
@@ -35,14 +35,15 @@ tower = { version = "0.4", features = ["full"] }
3535
sha2 = "0.10"
3636
hex = "0.4"
3737
digest = "0.10"
38-
clap = { version = "4.5.47", features = ["derive", "env"] }
38+
clap = { version = "4.5.48", features = ["derive", "env"] }
3939
dotenvy = { version = "0.15"}
4040
libc = "0.2"
41-
rtnetlink = "0.14.1"
42-
netlink-packet-route = "~0.19.0"
41+
rtnetlink = "0.18.1"
42+
netlink-packet-route = "~0.25.0"
4343
pnet = "0.35.0"
4444
dhcproto = "0.13.0"
4545
socket2 = "0.6.0"
4646
futures = "0.3.31"
4747
chrono = "0.4.42"
48+
hyper-util = { version = "0.1.14", features = ["tokio"] }
4849
feos-proto = { path = "feos/proto" }

cli/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ tonic = { workspace = true }
1616
anyhow = { workspace = true }
1717
log = { workspace = true }
1818
tokio-stream = { workspace = true }
19+
hyper-util = { workspace = true }
1920
prost = { workspace = true }
2021
tower = { workspace = true }
2122
clap = { workspace = true, features = ["derive", "env"] }
2223

2324
# CLI specific dependencies
2425
env_logger = { workspace = true }
25-
crossterm = "0.27"
26+
crossterm = "0.29"
2627
chrono = { workspace = true }

cli/src/image_commands.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use feos_proto::image_service::{
77
image_service_client::ImageServiceClient, DeleteImageRequest, ImageState, ListImagesRequest,
88
PullImageRequest, WatchImageStatusRequest,
99
};
10+
use hyper_util::rt::TokioIo;
1011
use std::path::PathBuf;
1112
use tokio::net::UnixStream;
1213
use tokio_stream::StreamExt;
@@ -55,7 +56,8 @@ pub enum ImageCommand {
5556
async fn get_image_client(socket: PathBuf) -> Result<ImageServiceClient<Channel>> {
5657
let channel = Endpoint::try_from("http://[::1]:50051")?
5758
.connect_with_connector(service_fn(move |_: Uri| {
58-
UnixStream::connect(socket.clone())
59+
let socket = socket.clone();
60+
async move { UnixStream::connect(socket).await.map(TokioIo::new) }
5961
}))
6062
.await
6163
.context("Failed to connect to ImageService via Unix socket")?;

cli/src/vm_commands.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,15 +349,12 @@ async fn wait_for_vm_state(
349349
}
350350
}
351351
Err(status) => {
352-
anyhow::bail!("Error in event stream: {}", status);
352+
anyhow::bail!("Error in event stream: {status}");
353353
}
354354
}
355355
}
356356

357-
anyhow::bail!(
358-
"Event stream ended before reaching target state: {:?}",
359-
target_state
360-
)
357+
anyhow::bail!("Event stream ended before reaching target state: {target_state:?}")
361358
}
362359

363360
async fn create_vm(

feos/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ log = { workspace = true }
5353
env_logger = { workspace = true }
5454
tokio-stream = { workspace = true }
5555
prost = { workspace = true }
56+
hyper-util = { workspace = true }
5657
once_cell = "1.19"
5758
regex = "1.10"
5859
tower = { workspace = true }

feos/proto/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
66

77
tonic_build::configure()
88
.protoc_arg("--experimental_allow_proto3_optional")
9-
.compile(
9+
.compile_protos(
1010
&[
1111
format!("{proto_dir}/vm.proto"),
1212
format!("{proto_dir}/host.proto"),

feos/services/vm-service/src/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl VmService for VmApiHandler {
131131
info!("VmApi: Received StreamVmConsole stream request.");
132132
let grpc_input_stream = request.into_inner();
133133
let (grpc_output_tx, grpc_output_rx) = mpsc::channel(32);
134-
let cmd = Command::StreamVmConsole(grpc_input_stream, grpc_output_tx);
134+
let cmd = Command::StreamVmConsole(Box::new(grpc_input_stream), grpc_output_tx);
135135
self.dispatcher_tx
136136
.send(cmd)
137137
.await

feos/services/vm-service/src/dispatcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl VmServiceDispatcher {
8585
handle_delete_vm_command(&self.repository, &self.healthcheck_cancel_bus, req, responder, hypervisor, event_bus_tx).await;
8686
}
8787
Command::StreamVmConsole(input_stream, output_tx) => {
88-
tokio::spawn(worker::handle_stream_vm_console(input_stream, output_tx, hypervisor));
88+
tokio::spawn(worker::handle_stream_vm_console(*input_stream, output_tx, hypervisor));
8989
}
9090
Command::ListVms(req, responder) => {
9191
handle_list_vms_command(&self.repository, req, responder).await;

feos/services/vm-service/src/dispatcher_handlers.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use feos_proto::{
1414
VmStateChangedEvent,
1515
},
1616
};
17+
use hyper_util::rt::TokioIo;
1718
use image_service::IMAGE_SERVICE_SOCKET;
1819
use log::{error, info, warn};
1920
use nix::unistd::Pid;
@@ -34,7 +35,12 @@ pub(crate) async fn get_image_service_client(
3435
Endpoint::try_from("http://[::1]:50051")
3536
.unwrap()
3637
.connect_with_connector(service_fn(move |_: Uri| {
37-
tokio::net::UnixStream::connect(socket_path.clone())
38+
let socket_path = socket_path.clone();
39+
async move {
40+
tokio::net::UnixStream::connect(socket_path)
41+
.await
42+
.map(TokioIo::new)
43+
}
3844
}))
3945
.await
4046
.map(ImageServiceClient::new)

0 commit comments

Comments
 (0)