From 740150608622d397266985639058bdce12b4b49e Mon Sep 17 00:00:00 2001 From: Ahmed Farghal Date: Tue, 19 May 2026 12:53:21 +0100 Subject: [PATCH] Add io-uring feature flag for restate-server --- .github/workflows/ci.yml | 8 ++++---- Cargo.lock | 3 +++ crates/rocksdb/Cargo.toml | 1 + docker/Dockerfile | 2 +- docker/Dockerfile.refresh | 2 +- docker/debug.Dockerfile | 5 +++-- server/Cargo.toml | 1 + workspace-hack/Cargo.toml | 4 ++++ 8 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87e81cc154..19f4e5aa2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,10 +45,6 @@ jobs: env: RUST_BACKTRACE: full steps: - # Disabled as uring is not used in production yet. - # - name: Install liburing - # run: sudo apt-get update && sudo apt-get install -y liburing-dev - - uses: actions/checkout@v4 - name: Install Rust toolchain @@ -91,6 +87,10 @@ jobs: - name: Check Cargo.lock file is updated run: cargo update -w --locked + # Installing liburing even if not used because of cargo-hakari feature unification + - name: Install liburing + run: sudo apt-get update && sudo apt-get install -y liburing-dev + - name: Run lint run: just lint diff --git a/Cargo.lock b/Cargo.lock index 68681be089..0ce4d0aae3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8900,6 +8900,8 @@ dependencies = [ "regex-syntax", "reqwest", "ring", + "rust-librocksdb-sys", + "rust-rocksdb", "rustix", "rustls", "rustls-pki-types", @@ -9086,6 +9088,7 @@ dependencies = [ "libc", "libz-sys", "lz4-sys", + "pkg-config", "tikv-jemalloc-sys", "zstd-sys", ] diff --git a/crates/rocksdb/Cargo.toml b/crates/rocksdb/Cargo.toml index 9bd5dc20c8..9fdbd28f84 100644 --- a/crates/rocksdb/Cargo.toml +++ b/crates/rocksdb/Cargo.toml @@ -10,6 +10,7 @@ publish = false [features] default = [] test-util = ["restate-types/test-util"] +io-uring = ["rocksdb/io-uring"] [dependencies] restate-workspace-hack = { workspace = true } diff --git a/docker/Dockerfile b/docker/Dockerfile index 0c6875ebd5..3f8cd525f9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -113,7 +113,7 @@ COPY --from=upload-true /restate/target/restate-server.debug / # NOTE: When modifying this runtime stage, also update docker/Dockerfile.refresh to keep them in sync. FROM debian:trixie-slim AS runtime # useful for health checks -RUN apt-get update && apt-get install --no-install-recommends -y jq curl && rm -rf /var/lib/apt/lists/* +RUN apt update && apt upgrade -y && apt install --no-install-recommends -y jq curl liburing2 && rm -rf /var/lib/apt/lists/* # Create symlink for debug symbols fallback path (for read-only /usr/local/bin scenarios) RUN mkdir -p /usr/local/bin/.debug && \ ln -s /tmp/.debug/restate-server.debug /usr/local/bin/.debug/restate-server.debug diff --git a/docker/Dockerfile.refresh b/docker/Dockerfile.refresh index abf51d7051..ac45dce4f2 100644 --- a/docker/Dockerfile.refresh +++ b/docker/Dockerfile.refresh @@ -23,7 +23,7 @@ ARG BASE_IMAGE FROM ${SOURCE_IMAGE} AS source FROM ${BASE_IMAGE} AS runtime -RUN apt-get update && apt-get install --no-install-recommends -y jq curl && rm -rf /var/lib/apt/lists/* +RUN apt update && apt upgrade -y && apt install --no-install-recommends -y jq curl liburing2 && rm -rf /var/lib/apt/lists/* # Create symlink for debug symbols fallback path (for read-only /usr/local/bin scenarios) RUN mkdir -p /usr/local/bin/.debug && \ ln -s /tmp/.debug/restate-server.debug /usr/local/bin/.debug/restate-server.debug diff --git a/docker/debug.Dockerfile b/docker/debug.Dockerfile index 78b8a810af..a2a47897aa 100644 --- a/docker/debug.Dockerfile +++ b/docker/debug.Dockerfile @@ -73,6 +73,9 @@ RUN --mount=type=cache,target=/var/cache/sccache \ # We do not need the Rust toolchain to run the server binary! FROM debian:trixie-slim AS runtime +# useful for health checks +RUN apt update && apt upgrade -y && apt install -y jq curl liburing2 && rm -rf /var/lib/apt/lists/* + COPY --from=builder /restate/target/restate-server /usr/local/bin COPY --from=builder /restate/target/restatectl /usr/local/bin COPY --from=builder /restate/target/restate /usr/local/bin @@ -80,7 +83,5 @@ COPY --from=builder /restate/NOTICE /NOTICE COPY --from=builder /restate/LICENSE /LICENSE # copy OS roots COPY --from=builder /etc/ssl /etc/ssl -# useful for health checks -RUN apt-get update && apt-get install -y jq curl && rm -rf /var/lib/apt/lists/* WORKDIR / ENTRYPOINT ["/usr/local/bin/restate-server"] diff --git a/server/Cargo.toml b/server/Cargo.toml index 03323bd70e..32c0abee5b 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -33,6 +33,7 @@ no-trace-logging = ["tracing/max_level_trace", "tracing/release_max_level_debug" metadata-api = ["restate-admin/metadata-api"] kafka-oidc = ["restate-node/kafka-oidc"] taskdump = ["restate-core/taskdump"] +io-uring = ["restate-rocksdb/io-uring"] [dependencies] restate-workspace-hack = { workspace = true } diff --git a/workspace-hack/Cargo.toml b/workspace-hack/Cargo.toml index 4e4447e09f..3bd3c03cd1 100644 --- a/workspace-hack/Cargo.toml +++ b/workspace-hack/Cargo.toml @@ -102,6 +102,8 @@ regex-automata = { version = "0.4", default-features = false, features = ["dfa", regex-syntax = { version = "0.8" } reqwest = { version = "0.12", default-features = false, features = ["blocking", "http2", "json", "rustls-tls", "rustls-tls-native-roots", "stream"] } ring = { version = "0.17", features = ["std"] } +rust-librocksdb-sys = { git = "https://github.com/restatedev/rust-rocksdb", rev = "432ac4288a219dd70d4c71ccfcd0ad51d6bcc0d1", default-features = false, features = ["bindgen-runtime", "bzip2", "io-uring", "jemalloc", "lz4", "snappy", "static", "zlib", "zstd"] } +rust-rocksdb = { git = "https://github.com/restatedev/rust-rocksdb", rev = "432ac4288a219dd70d4c71ccfcd0ad51d6bcc0d1", features = ["io-uring", "jemalloc", "multi-threaded-cf"] } rustls = { version = "0.23", default-features = false, features = ["logging", "prefer-post-quantum", "ring", "std", "tls12"] } rustls-pki-types = { version = "1", features = ["std"] } rustls-webpki = { version = "0.103", default-features = false, features = ["aws-lc-rs", "ring", "std"] } @@ -234,6 +236,8 @@ regex-automata = { version = "0.4", default-features = false, features = ["dfa", regex-syntax = { version = "0.8" } reqwest = { version = "0.12", default-features = false, features = ["blocking", "http2", "json", "rustls-tls", "rustls-tls-native-roots", "stream"] } ring = { version = "0.17", features = ["std"] } +rust-librocksdb-sys = { git = "https://github.com/restatedev/rust-rocksdb", rev = "432ac4288a219dd70d4c71ccfcd0ad51d6bcc0d1", default-features = false, features = ["bindgen-runtime", "bzip2", "io-uring", "jemalloc", "lz4", "snappy", "static", "zlib", "zstd"] } +rust-rocksdb = { git = "https://github.com/restatedev/rust-rocksdb", rev = "432ac4288a219dd70d4c71ccfcd0ad51d6bcc0d1", features = ["io-uring", "jemalloc", "multi-threaded-cf"] } rustls = { version = "0.23", default-features = false, features = ["logging", "prefer-post-quantum", "ring", "std", "tls12"] } rustls-pki-types = { version = "1", features = ["std"] } rustls-webpki = { version = "0.103", default-features = false, features = ["aws-lc-rs", "ring", "std"] }