Skip to content
Draft
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
132 changes: 107 additions & 25 deletions Cargo.lock

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
members = [
"cli",
"crates/*",
"crates/lib/ty",
"crates/core/derive",
"crates/encoding/derive",
"crates/codederror/derive",
Expand All @@ -15,11 +16,13 @@ members = [
"tools/xtask",
"workspace-hack",
]

exclude = [
"crates/lib",
]

default-members = [
"cli",
"crates/*",
"crates/core/derive",
"crates/codederror/derive",
"server",
"tools/restatectl",
]
Expand Down Expand Up @@ -81,6 +84,7 @@ restate-time-util = { path = "crates/time-util" }
restate-timer = { path = "crates/timer" }
restate-timer-queue = { path = "crates/timer-queue" }
restate-tracing-instrumentation = { path = "crates/tracing-instrumentation" }
restate-ty = { path = "crates/lib/ty" }
restate-types = { path = "crates/types" }
restate-utoipa = { path = "crates/utoipa" }
restate-wal-protocol = { path = "crates/wal-protocol" }
Expand Down Expand Up @@ -162,7 +166,7 @@ hyper-rustls = { version = "0.27.2", default-features = false, features = [
hyper-util = { version = "0.1" }
indexmap = "2.7"
itertools = "0.14.0"
jiff = "0.2.14"
jiff = { version = "0.2.14" }
jsonschema = { version = "0.28.3", default-features = false }
metrics = { version = "0.24" }
metrics-exporter-prometheus = { version = "0.17", default-features = false, features = [
Expand All @@ -184,7 +188,7 @@ paste = "1.0"
pin-project = "1.0"
pin-project-lite = { version = "0.2" }
prost = { version = "0.14.1" }
prost-build = { version = "0.14.1" }
prost-build = { version = "0.14.1", default-features = false }
priority-queue = { version = "2.7.0" }
prost-dto = { version = "0.0.4" }
prost-types = { version = "0.14.1" }
Expand All @@ -206,10 +210,10 @@ rustls = { version = "0.23.26", default-features = false, features = ["ring"] }
schemars = { version = "0.8", features = ["bytes", "enumset"] }
semver = { version = "1.0", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_with = "3.8"
serde_json = { version = "1.0" }
serde_with = { version = "3.15" }
serde_yaml = "0.9"
sha2 = "0.10.8"
sha2 = { version = "0.10.8" }
smartstring = { version = "1.0.1" }
static_assertions = { version = "1.1.0" }
strum = { version = "0.27.1", features = ["derive"] }
Expand Down Expand Up @@ -253,7 +257,7 @@ ulid = { version = "1.2.0" }
url = { version = "2.5" }
urlencoding = { version = "2.1" }
uuid = { version = "1.3.0", features = ["v7", "serde"] }
xxhash-rust = { version = "0.8", features = ["xxh3"] }
xxhash-rust = { version = "0.8" }
zstd = { version = "0.13" }

[patch.crates-io.restate-workspace-hack]
Expand Down
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ restate-cli-util = { workspace = true }
restate-cloud-tunnel-client = { workspace = true }
restate-serde-util = { workspace = true }
restate-time-util = { workspace = true }
restate-ty = { workspace = true }
restate-types = { workspace = true }
restate-lite = { workspace = true, optional = true }
mock-service-endpoint = { workspace = true, optional = true }
Expand Down
3 changes: 2 additions & 1 deletion cli/src/clients/admin_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ use restate_admin_rest_model::invocations::RestartAsNewInvocationResponse;
use restate_admin_rest_model::services::*;
use restate_admin_rest_model::version::VersionInformation;
use restate_serde_util::SerdeableHeaderHashMap;
use restate_types::identifiers::{DeploymentId, LambdaARN};
use restate_types::LambdaARN;
use restate_types::identifiers::DeploymentId;
use restate_types::schema::deployment::ProtocolType;
use restate_types::schema::service::ServiceMetadata;

Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/deployments/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use restate_admin_rest_model::version::AdminApiVersion;
use restate_cli_util::ui::console::{Styled, StyledTable, confirm_or_exit};
use restate_cli_util::ui::stylesheet::Style;
use restate_cli_util::{c_eprintln, c_error, c_indent_table, c_indentln, c_success, c_warn};
use restate_types::identifiers::LambdaARN;
use restate_ty::LambdaARN;
use restate_types::schema::service::ServiceMetadata;

use crate::cli_env::CliEnv;
Expand Down
14 changes: 8 additions & 6 deletions crates/admin-rest-model/src/deployments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0.

use std::collections::HashMap;

use http::{Uri, Version};
use serde::{Deserialize, Serialize};
use serde_with::serde_as;

use restate_serde_util::SerdeableHeaderHashMap;
use restate_types::identifiers::ServiceRevision;
use restate_types::identifiers::{DeploymentId, LambdaARN};
use restate_types::LambdaARN;
use restate_types::identifiers::DeploymentId;
use restate_types::schema::deployment::{EndpointLambdaCompression, ProtocolType};
use restate_types::schema::info::Info;
use restate_types::schema::service::ServiceMetadata;
use serde::{Deserialize, Serialize};
use serde_with::serde_as;
use std::collections::HashMap;

// This enum could be a struct with a nested enum to avoid repeating some fields, but serde(flatten) unfortunately breaks the openapi code generation
#[serde_as]
Expand Down Expand Up @@ -160,7 +162,7 @@ pub enum RegisterDeploymentRequest {
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ServiceNameRevPair {
pub name: String,
pub revision: ServiceRevision,
pub revision: u32,
}

#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
Expand Down
3 changes: 2 additions & 1 deletion crates/admin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false

[features]
default = ["serve-web-ui"]
options_schema = ["restate-service-client/options_schema", "restate-types/schemars"]
options_schema = ["restate-service-client/options_schema", "restate-types/schemars", "restate-ty/schemars"]
serve-web-ui = ["restate-web-ui", "mime_guess"]
storage-query = []
metadata-api = []
Expand All @@ -27,6 +27,7 @@ restate-service-client = { workspace = true }
restate-service-protocol = { workspace = true, features = ["discovery"] }
restate-storage-query-datafusion = { workspace = true }
restate-time-util = { workspace = true }
restate-ty = { workspace = true }
restate-types = { workspace = true }
restate-wal-protocol = { workspace = true }
restate-web-ui = { git = "https://github.com/restatedev/restate-web-ui-crate", optional = true, version = "0.1.11", tag = "v0.1.11" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ use restate_core::{
Metadata, ShutdownError, TaskCenter, TaskHandle, TaskKind, cancellation_watcher,
};
use restate_metadata_store::MetadataStoreClient;
use restate_ty::metadata::MetadataKind;
use restate_types::cluster::cluster_state::LegacyClusterState;
use restate_types::cluster_state::ClusterState;
use restate_types::epoch::EpochMetadata;
use restate_types::identifiers::PartitionId;
use restate_types::metadata_store::keys::partition_processor_epoch_key;
use restate_types::net::metadata::MetadataKind;
use restate_types::nodes_config::NodesConfiguration;
use restate_types::partitions::PartitionTable;

Expand Down
4 changes: 3 additions & 1 deletion crates/admin/src/rest_api/deployments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ use okapi_operation::*;
use restate_admin_rest_model::deployments::*;
use restate_admin_rest_model::version::AdminApiVersion;
use restate_errors::warn_it;
use restate_ty::identifiers::DeploymentId;
use restate_ty::invocation::ServiceRevision;
use restate_ty::lambda::InvalidLambdaARN;
use restate_types::deployment::{HttpDeploymentAddress, LambdaDeploymentAddress};
use restate_types::identifiers::{DeploymentId, InvalidLambdaARN, ServiceRevision};
use restate_types::schema;
use restate_types::schema::deployment::{Deployment, DeploymentType};
use restate_types::schema::registry::{
Expand Down
3 changes: 2 additions & 1 deletion crates/bifrost/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ restate-futures-util = { workspace = true }
restate-metadata-store = { workspace = true }
restate-rocksdb = { workspace = true, optional = true }
restate-test-util = { workspace = true, optional = true }
restate-ty = { workspace = true }
restate-types = { workspace = true }

ahash = { workspace = true }
Expand Down Expand Up @@ -81,4 +82,4 @@ tikv-jemallocator = { workspace = true }

[[bench]]
name = "replicated_loglet_serde"
harness = false
harness = false
2 changes: 2 additions & 0 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ test-util = [
"restate-core-derive",
"restate-metadata-store/test-util",
"restate-types/test-util",
"restate-ty/test-util",
"tokio/test-util"
]

Expand All @@ -23,6 +24,7 @@ restate-core-derive = { workspace = true, optional = true }
restate-futures-util = { workspace = true }
restate-metadata-store = { workspace = true }
restate-time-util = { workspace = true }
restate-ty = { workspace = true }
restate-types = { workspace = true }

ahash = { workspace = true }
Expand Down
12 changes: 6 additions & 6 deletions crates/core/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.file_descriptor_set_path(out_dir.join("cluster_ctrl_svc_descriptor.bin"))
// allow older protobuf compiler to be used
.protoc_arg("--experimental_allow_proto3_optional")
.extern_path(".restate.common", "::restate_types::protobuf::common")
.extern_path(".restate.common", "::restate_ty::protobuf")
.extern_path(".restate.cluster", "::restate_types::protobuf::cluster")
.compile_protos(
&["./protobuf/cluster_ctrl_svc.proto"],
&["protobuf", "../types/protobuf"],
&["protobuf", "../types/protobuf", "../lib/ty/protobuf"],
)?;

tonic_prost_build::configure()
Expand All @@ -33,11 +33,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.file_descriptor_set_path(out_dir.join("node_ctl_svc_descriptor.bin"))
// allow older protobuf compiler to be used
.protoc_arg("--experimental_allow_proto3_optional")
.extern_path(".restate.common", "::restate_types::protobuf::common")
.extern_path(".restate.common", "::restate_ty::protobuf")
.extern_path(".restate.cluster", "::restate_types::protobuf::cluster")
.compile_protos(
&["./protobuf/node_ctl_svc.proto"],
&["protobuf", "../types/protobuf"],
&["protobuf", "../types/protobuf", "../lib/ty/protobuf"],
)?;

tonic_prost_build::configure()
Expand All @@ -52,14 +52,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.file_descriptor_set_path(out_dir.join("core_node_svc_descriptor.bin"))
// allow older protobuf compiler to be used
.protoc_arg("--experimental_allow_proto3_optional")
.extern_path(".restate.common", "::restate_types::protobuf::common")
.extern_path(".restate.common", "::restate_ty::protobuf")
.extern_path(".restate.node", "::restate_types::protobuf::node")
.compile_protos(
&[
"./protobuf/restate/network.proto",
"./protobuf/core_node_svc.proto",
],
&["protobuf", "../types/protobuf"],
&["protobuf", "../types/protobuf", "../lib/ty/protobuf"],
)?;

Ok(())
Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ use tokio::sync::{mpsc, oneshot, watch};
use tracing::instrument;

use restate_metadata_store::{MetadataStoreClient, ReadError};
use restate_ty::{GenerationalNodeId, Version, Versioned};
use restate_types::live::{Live, Pinned};
use restate_types::logs::metadata::Logs;
use restate_types::metadata::GlobalMetadata;
pub use restate_types::net::metadata::MetadataKind;
use restate_types::net::metadata::{self, MetadataContainer};
use restate_types::nodes_config::NodesConfiguration;
use restate_types::partition_table::PartitionTable;
use restate_types::schema::Schema;
use restate_types::{GenerationalNodeId, Version, Versioned};

pub use self::manager::{MetadataManager, TargetVersion};
use crate::network::Connection;
use crate::{ShutdownError, TaskCenter, TaskId, TaskKind};
pub use restate_ty::metadata::MetadataKind;

use self::metadata_client_wrapper::MetadataClientWrapper;

Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/network/connection_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,11 @@ mod tests {
use tokio_stream::wrappers::ReceiverStream;

use restate_test_util::assert_eq;
use restate_ty::metadata::MetadataKind;
use restate_types::Version;
use restate_types::config::NetworkingOptions;
use restate_types::net::address::AdvertisedAddress;
use restate_types::net::metadata::GetMetadataRequest;
use restate_types::net::metadata::MetadataKind;
use restate_types::net::metadata::MetadataManagerService;
use restate_types::net::node::GetNodeState;
use restate_types::net::{
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/network/io/reactor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ use tokio::time::Sleep;
use tracing::{Instrument, Span, debug, info, trace, warn};

use restate_futures_util::overdue::OverdueLoggingExt;
use restate_ty::metadata::MetadataKind;
use restate_types::live::Live;
use restate_types::logs::metadata::Logs;
use restate_types::net::ServiceTag;
use restate_types::net::metadata::MetadataKind;
use restate_types::nodes_config::NodesConfiguration;
use restate_types::partition_table::PartitionTable;
use restate_types::schema::Schema;
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/network/protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ pub mod network {

use opentelemetry::propagation::{Extractor, Injector};

use restate_ty::metadata::MetadataKind;
use restate_types::GenerationalNodeId;
use restate_types::net::metadata::MetadataKind;
use restate_types::nodes_config::ClusterFingerprint;

use restate_types::net::{
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/network/server_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ use tonic::service::Routes;
use tower_http::trace::{DefaultOnFailure, TraceLayer};
use tracing::{Level, debug};

use restate_ty::protobuf::NodeRpcStatus;
use restate_types::health::HealthStatus;
use restate_types::net::address::FabricPort;
use restate_types::net::listener::{AddressBook, Listeners};
use restate_types::protobuf::common::NodeRpcStatus;

use super::net_util::run_hyper_server;

Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/network/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ use bytes::Bytes;
use futures::FutureExt;
use tokio::sync::oneshot;

use restate_ty::metadata::MetadataKind;
use restate_types::net::address::AdvertisedAddress;
use restate_types::net::address::FabricPort;
use restate_types::net::metadata::MetadataKind;
use restate_types::net::{ProtocolVersion, RpcResponse};
use restate_types::{GenerationalNodeId, Version};

Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/test_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ use std::sync::Arc;
use futures::Stream;

use restate_metadata_store::MetadataStoreClient;
use restate_ty::metadata::MetadataKind;
use restate_types::logs::metadata::{ProviderKind, bootstrap_logs_metadata};
use restate_types::metadata::Precondition;
use restate_types::metadata_store::keys::{
BIFROST_CONFIG_KEY, NODES_CONFIG_KEY, PARTITION_TABLE_KEY,
};
use restate_types::net::Service;
use restate_types::net::address::AdvertisedAddress;
use restate_types::net::metadata::MetadataKind;
use restate_types::nodes_config::{NodeConfig, NodesConfiguration, Role};
use restate_types::partition_table::PartitionTable;
use restate_types::{GenerationalNodeId, Version};
Expand Down
1 change: 1 addition & 0 deletions crates/ingress-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ restate-errors = { workspace = true }
restate-serde-util = { workspace = true }
restate-time-util = { workspace = true, features = ["serde_with"] }
restate-tracing-instrumentation = { workspace = true }
restate-ty = { workspace = true }
restate-types = { workspace = true }

anyhow = { workspace = true }
Expand Down
5 changes: 3 additions & 2 deletions crates/ingress-http/src/handler/awakeables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use http_body_util::Full;
use restate_types::errors::{InvocationError, codes};
use restate_types::identifiers::{AwakeableIdentifier, ExternalSignalIdentifier, WithInvocationId};
use restate_types::invocation::{InvocationResponse, JournalCompletionTarget, ResponseResult};
use restate_types::journal_v2::SignalId;
use restate_types::journal_v2::{Signal, SignalResult};
use std::str::FromStr;
use tracing::{debug, trace, warn};
Expand Down Expand Up @@ -73,13 +74,13 @@ where
"Processing awakeables request"
);

let (invocation_id, signal_id) = signal_id.into_inner();
let (invocation_id, entry_index) = signal_id.into_inner();

self.dispatcher
.send_signal(
invocation_id,
Signal::new(
signal_id,
SignalId::for_index(entry_index),
match result {
ResponseResult::Success(s) => SignalResult::Success(s),
ResponseResult::Failure(f) => SignalResult::Failure(f.into()),
Expand Down
4 changes: 2 additions & 2 deletions crates/ingress-http/src/handler/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use super::APPLICATION_JSON;
use crate::RequestDispatcherError;
use bytes::Bytes;
use http::{Response, StatusCode, header};
use restate_types::errors::{IdDecodeError, InvocationError};
use restate_types::identifiers::DeploymentId;
use restate_ty::identifiers::{DeploymentId, IdDecodeError};
use restate_types::errors::InvocationError;
use restate_types::schema::invocation_target::InputValidationError;
use serde::Serialize;
use std::string;
Expand Down
Loading
Loading