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

Implement re_grpc_server #8622

Merged
merged 27 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7816d6f
Add `LogMsg` proto definition
jprochazk Jan 8, 2025
791dfb4
Add `MessageProxy` service definition
jprochazk Jan 8, 2025
ea2646e
Expose protubuf conversions in re_log_encoding
jprochazk Jan 8, 2025
7fdcac5
Add `SizeBytes` impls for some types
jprochazk Jan 8, 2025
799ed2f
Fix typos
jprochazk Jan 8, 2025
796f736
Implement `re_grpc_server`
jprochazk Jan 8, 2025
f59825a
Fix lints
jprochazk Jan 8, 2025
f04124c
Implement `SizeBytes` for `LogMsg` in `re_protos`
jprochazk Jan 9, 2025
b8cd115
Use `SizeBytes` instead of `encoded_len` + add memory limit tests
jprochazk Jan 9, 2025
827148e
Merge branch 'main' into jan/grpc-server
jprochazk Jan 9, 2025
306877b
Fix lint
jprochazk Jan 9, 2025
cc4b712
Fix lints
jprochazk Jan 9, 2025
2fb22b9
Fix lints
jprochazk Jan 9, 2025
4cd889c
Add top-level doc
jprochazk Jan 9, 2025
0667da6
Mark `heap_size_bytes` as `inline`
jprochazk Jan 9, 2025
792cfda
More inlines
jprochazk Jan 9, 2025
c2a850d
Update comment
jprochazk Jan 9, 2025
79f1a7e
Remove outdated comment
jprochazk Jan 9, 2025
31915c5
Add comment about channel capacity
jprochazk Jan 9, 2025
9f5cf25
Add todo
jprochazk Jan 9, 2025
1e8b00e
Some refactoring
jprochazk Jan 9, 2025
7f5708e
Add todo
jprochazk Jan 9, 2025
3dbdcfd
Add todo for removing `LogMsg`
jprochazk Jan 9, 2025
b5642d2
add comment about `SetStoreInfo` order
jprochazk Jan 9, 2025
8c1a78e
Rename
jprochazk Jan 9, 2025
6aaa103
Remove `Queue`, rename `QueueState` to `EventLoop`, add some comments
jprochazk Jan 9, 2025
01c5cfb
Merge branch 'main' into jan/grpc-server
jprochazk Jan 9, 2025
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
1 change: 1 addition & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ Update instructions:
| re_data_loader | Handles loading of Rerun data from file using data loader plugins |
| re_data_source | Handles loading of Rerun data from different sources |
| re_grpc_client | Communicate with the Rerun Data Platform over gRPC |
| re_grpc_server | Host an in-memory Storage Node |
| re_sdk_comms | TCP communication between Rerun SDK and Rerun Server |
| re_web_viewer_server | Serves the Rerun web viewer (Wasm and HTML) over HTTP |
| re_ws_comms | WebSocket communication library (encoding, decoding, client, server) between a Rerun server and Viewer |
Expand Down
26 changes: 25 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5616,6 +5616,7 @@ dependencies = [
name = "re_build_info"
version = "0.22.0-alpha.1+dev"
dependencies = [
"re_byte_size",
"serde",
]

Expand All @@ -5639,7 +5640,6 @@ dependencies = [
"arrow",
"half",
"re_arrow2",
"re_tuid",
"smallvec",
]

Expand Down Expand Up @@ -6004,6 +6004,27 @@ dependencies = [
"wasm-bindgen-futures",
]

[[package]]
name = "re_grpc_server"
version = "0.22.0-alpha.1+dev"
dependencies = [
"re_build_info",
"re_byte_size",
"re_chunk",
"re_format",
"re_log",
"re_log_encoding",
"re_log_types",
"re_memory",
"re_protos",
"re_tracing",
"re_types",
"tokio",
"tokio-stream",
"tokio-util",
"tonic",
]

[[package]]
name = "re_int_histogram"
version = "0.22.0-alpha.1+dev"
Expand Down Expand Up @@ -6147,6 +6168,7 @@ name = "re_protos"
version = "0.22.0-alpha.1+dev"
dependencies = [
"prost",
"re_byte_size",
"thiserror 1.0.65",
"tonic",
"tonic-web-wasm-client",
Expand Down Expand Up @@ -6444,6 +6466,7 @@ dependencies = [
"document-features",
"getrandom",
"once_cell",
"re_byte_size",
"re_protos",
"serde",
"web-time",
Expand Down Expand Up @@ -8819,6 +8842,7 @@ dependencies = [
"futures-core",
"pin-project-lite",
"tokio",
"tokio-util",
]

[[package]]
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ tinyvec = { version = "1.6", features = ["alloc", "rustc_1_55"] }
tobj = "4.0"
tokio = { version = "1.40.0", default-features = false }
tokio-stream = "0.1.16"
tokio-util = { version = "0.7.12", default-features = false }
toml = { version = "0.8.10", default-features = false }
tonic = { version = "0.12.3", default-features = false }
tonic-build = { version = "0.12.3", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions crates/build/re_build_info/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ serde = ["dep:serde"]


[dependencies]
re_byte_size.workspace = true

# Optional dependencies:
serde = { workspace = true, optional = true, features = ["derive", "rc"] }
6 changes: 6 additions & 0 deletions crates/build/re_build_info/src/crate_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,12 @@ impl std::fmt::Display for CrateVersion {
}
}

impl re_byte_size::SizeBytes for CrateVersion {
fn heap_size_bytes(&self) -> u64 {
0
}
}

#[test]
fn test_parse_version() {
macro_rules! assert_parse_ok {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use camino::Utf8Path;

const PROTOS_DIR: &str = "crates/store/re_protos/proto";
const INPUT_V0: &[&str] = &["rerun/v0/remote_store.proto", "rerun/v0/log_msg.proto"];
const INPUT_V0_DIR: &str = "rerun/v0";
const OUTPUT_V0_RUST_DIR: &str = "crates/store/re_protos/src/v0";

fn main() {
Expand All @@ -28,16 +28,27 @@ fn main() {

let definitions_dir_path = workspace_dir.join(PROTOS_DIR);
let rust_generated_output_dir_path = workspace_dir.join(OUTPUT_V0_RUST_DIR);
let proto_paths = std::fs::read_dir(definitions_dir_path.join(INPUT_V0_DIR))
.unwrap()
.map(|v| {
v.unwrap()
.path()
.strip_prefix(&definitions_dir_path)
.unwrap()
.to_owned()
})
.collect::<Vec<_>>();

re_log::info!(
definitions=?definitions_dir_path,
output=?rust_generated_output_dir_path,
protos=?proto_paths,
"Running codegen for storage node types",
);

re_protos_builder::generate_rust_code(
definitions_dir_path,
INPUT_V0,
&proto_paths,
rust_generated_output_dir_path,
);
}
2 changes: 1 addition & 1 deletion crates/store/re_grpc_client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "re_grpc_client"
authors.workspace = true
description = "gRCP client for the Rerun Data Platform gRPC prototocl"
description = "gRCP client for the Rerun Data Platform gRPC protocol"
edition.workspace = true
homepage.workspace = true
include.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/store/re_grpc_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const CATALOG_BP_STORE_ID: &str = "catalog_blueprint";
const CATALOG_REC_STORE_ID: &str = "catalog";
const CATALOG_APPLICATION_ID: &str = "redap_catalog";

/// Stream an rrd file or metadsasta catalog over gRPC from a Rerun Data Platform server.
/// Stream an rrd file or metadata catalog over gRPC from a Rerun Data Platform server.
///
/// `on_msg` can be used to wake up the UI thread on Wasm.
pub fn stream_from_redap(
Expand Down
39 changes: 39 additions & 0 deletions crates/store/re_grpc_server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[package]
name = "re_grpc_server"
authors.workspace = true
description = "gRCP server for the Rerun Data Platform gRPC protocol"
edition.workspace = true
homepage.workspace = true
include.workspace = true
license.workspace = true
publish = true
readme = "README.md"
repository.workspace = true
rust-version.workspace = true
version.workspace = true

[lints]
workspace = true

[package.metadata.docs.rs]
all-features = true


[dependencies]
re_build_info.workspace = true
re_byte_size.workspace = true
re_chunk.workspace = true
re_format.workspace = true
re_log.workspace = true
re_log_encoding = { workspace = true, features = ["encoder", "decoder"] }
re_log_types.workspace = true
re_memory.workspace = true
re_protos.workspace = true
re_tracing.workspace = true
re_types.workspace = true

# External
tokio.workspace = true
tokio-stream = { workspace = true, features = ["sync"] }
tokio-util.workspace = true
tonic = { workspace = true, default-features = false, features = ["transport"] }
10 changes: 10 additions & 0 deletions crates/store/re_grpc_server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# re_grpc_server

Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates.

[![Latest version](https://img.shields.io/crates/v/re_grpc_server.svg?speculative-link)](https://crates.io/crates/re_grpc_server?speculative-link)
[![Documentation](https://docs.rs/re_grpc_server/badge.svg?speculative-link)](https://docs.rs/re_grpc_server?speculative-link)
![MIT](https://img.shields.io/badge/license-MIT-blue.svg)
![Apache](https://img.shields.io/badge/license-Apache-blue.svg)

Server implementation of an in-memory Storage Node.
Loading
Loading