Commit 3d292851 authored by Anant Sharma's avatar Anant Sharma Committed by GitHub
Browse files

build: add top level rust workspace (#137)

parent 404a78e9
......@@ -40,7 +40,7 @@ jobs:
pre-merge-rust:
runs-on: ubuntu-latest
strategy:
matrix: { dir: ['lib/runtime', 'lib/llm', 'lib/bindings/c', 'lib/bindings/python', 'launch/dynamo-run', 'launch/llmctl', 'components', 'lib/runtime/examples'] }
matrix: { dir: ['.', 'lib/bindings/python', 'lib/runtime/examples'] }
permissions:
contents: read
steps:
......
This diff is collapsed.
......@@ -15,32 +15,42 @@
[workspace]
members = [
"http",
"metrics",
"components/*",
"launch/*",
"lib/llm",
"lib/runtime",
"lib/bindings/c",
]
resolver = "2"
[workspace.package]
version = "0.1.0"
edition = "2021"
authors = ["NVIDIA"]
description = "Dynamo Inference Framework"
authors = ["NVIDIA Inc. <sw-dl-dynamo@nvidia.com>"]
license = "Apache-2.0"
homepage = "https://github.com/ai-dynamo/dynamo"
repository = "https://github.com/ai-dynamo/dynamo.git"
keywords = ["llm", "genai", "inference", "nvidia", "distributed", "dynamo"]
[workspace.dependencies]
# local or crates.io
dynamo-runtime = { path = "../lib/runtime" }
dynamo-llm = { path = "../lib/llm" }
# Local crates
dynamo-runtime = { path = "lib/runtime" }
dynamo-llm = { path = "lib/llm" }
# crates.io
# External dependencies
anyhow = { version = "1" }
async-nats = { version = "0.38", features = ["service"] }
async-stream = { version = "0.3" }
async-trait = { version = "0.1" }
bytes = "1"
derive_builder = "0.20"
futures = "0.3"
async_zmq = { version = "0.4.0" }
blake3 = { version = "1" }
bytes = { version = "1" }
chrono = { version = "0.4", default-features = false, features = ["alloc", "std", "clock", "now", "serde"] }
derive_builder = { version = "0.20" }
derive-getters = { version = "0.5" }
either = { version = "1.13", features = ["serde"] }
futures = { version = "0.3" }
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1" }
thiserror = { version = "2.0.11" }
......@@ -50,3 +60,6 @@ tokio-util = { version = "0.7", features = ["codec", "net"] }
tracing = { version = "0.1" }
validator = { version = "0.20.0", features = ["derive"] }
uuid = { version = "1", features = ["v4", "serde"] }
xxhash-rust = { version = "0.8", features = ["xxh3", "const_xxh3"] }
strum = { version = "0.27", features = ["derive"] }
prometheus = { version = "0.13" }
\ No newline at end of file
This diff is collapsed.
......@@ -26,8 +26,9 @@ repository.workspace = true
[dependencies]
dynamo-runtime = { workspace = true}
dynamo-llm = { workspace = true}
clap = { version = "4.5", features = ["derive"] }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }
clap = { version = "4.5", features = ["derive"] }
......@@ -23,24 +23,21 @@ homepage.workspace = true
repository.workspace = true
[dependencies]
# local
dynamo-runtime.workspace = true
dynamo-llm.workspace = true
dynamo-llm = { workspace = true }
dynamo-runtime = { workspace = true }
# workspace - todo
futures = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
# crates.io
serde.workspace = true
serde_json.workspace = true
tokio.workspace = true
tracing.workspace = true
futures.workspace = true
async-nats = { version = "0.38", features = ["service"] }
axum = { version = "0.6" }
clap = { version = "4.5", features = ["derive", "env"] }
thiserror = "1.0"
opentelemetry = "0.20"
opentelemetry-prometheus = "0.13"
prometheus = "0.13"
rand = "0.8"
axum = "0.6"
reqwest = { version = "0.11", features = ["json", "rustls-tls"] }
\ No newline at end of file
opentelemetry = { version = "0.20" }
opentelemetry-prometheus = { version = "0.13" }
prometheus = { version = "0.13" }
rand = { version = "0.8" }
reqwest = { version = "0.11", features = ["json", "rustls-tls"] }
thiserror = { version = "1.0" }
\ No newline at end of file
......@@ -125,33 +125,22 @@ WORKDIR /workspace
COPY pyproject.toml /workspace/
COPY README.md /workspace/
COPY LICENSE /workspace/
COPY Cargo.toml /workspace/
COPY Cargo.lock /workspace/
COPY rust-toolchain.toml /workspace/
ARG CARGO_BUILD_JOBS
# Build Rust runtime
COPY lib/runtime /workspace/lib/runtime
RUN cd lib/runtime && \
cargo build --release --locked && cargo doc --no-deps
# Build OpenAI HTTP Service binaries
COPY lib/llm /workspace/lib/llm
ENV CARGO_TARGET_DIR=/workspace/target
# Build Rust
COPY lib/ /workspace/lib/
COPY components /workspace/components
RUN cd components && \
cargo build --release && \
cp target/release/http /usr/local/bin/
# Build Dynamo Run binaries
COPY launch /workspace/launch
RUN cd launch && \
cargo build --release --features mistralrs,sglang,vllm,python && \
RUN cargo build --release --locked --features mistralrs,sglang,vllm,python && cargo doc --no-deps && \
cp target/release/dynamo-run /usr/local/bin/ && \
cp target/release/llmctl /usr/local/bin/
# Generate C bindings. Note that this is required for TRTLLM backend re-build
COPY lib/bindings /workspace/lib/bindings
RUN cd lib/bindings/c/ && \
cargo build --release --locked && cargo doc --no-deps
COPY deploy/dynamo/sdk /workspace/deploy/dynamo/sdk
# Install uv, create virtualenv for general use, and build dynamo wheel
......@@ -169,7 +158,7 @@ RUN mkdir /opt/dynamo && \
RUN mkdir -p /opt/dynamo/bindings/wheels && \
mkdir /opt/dynamo/bindings/lib && \
cp dist/ai_dynamo*cp312*.whl /opt/dynamo/bindings/wheels/. && \
cp lib/bindings/c/target/release/libdynamo_llm_capi.so /opt/dynamo/bindings/lib/. && \
cp target/release/libdynamo_llm_capi.so /opt/dynamo/bindings/lib/. && \
cp -r lib/bindings/c/include /opt/dynamo/bindings/.
# Install dynamo.runtime and dynamo.llm wheels globally in container for tests that
......
......@@ -70,35 +70,26 @@ WORKDIR /workspace
COPY pyproject.toml /workspace/
COPY README.md /workspace/
COPY LICENSE /workspace/
COPY Cargo.toml /workspace/
COPY Cargo.lock /workspace/
COPY rust-toolchain.toml /workspace/
ARG CARGO_BUILD_JOBS
# Build Rust runtime
COPY lib/runtime /workspace/lib/runtime
RUN cd lib/runtime && \
cargo build --release --locked && cargo doc --no-deps
ENV CARGO_TARGET_DIR=/workspace/target
# Build OpenAI HTTP Service binaries
COPY lib/llm /workspace/lib/llm
# Build Rust
COPY lib/ /workspace/lib/
COPY components /workspace/components
RUN cd components && \
cargo build --release && \
cp target/release/http /usr/local/bin/
# Build Dynamo Run binaries
COPY launch /workspace/launch
# TODO: Tanmay Add LLMAPI-based feature flag once the engine is ready.
RUN cd launch && \
cargo build --release --features python && \
RUN cargo build --release --locked --features python && \
cargo doc --no-deps && \
cp target/release/dynamo-run /usr/local/bin/ && \
cp target/release/llmctl /usr/local/bin/
COPY deploy/dynamo/sdk /workspace/deploy/dynamo/sdk
# Generate C bindings for kv cache routing.
COPY lib/bindings /workspace/lib/bindings
RUN cd lib/bindings/c && \
cargo build --release --locked && cargo doc --no-deps
COPY deploy/dynamo/sdk /workspace/deploy/dynamo/sdk
# Install uv, create virtualenv for general use, and build dynamo wheel
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
......@@ -115,7 +106,7 @@ RUN mkdir /opt/dynamo && \
RUN mkdir -p /opt/dynamo/bindings/wheels && \
mkdir /opt/dynamo/bindings/lib && \
cp dist/ai_dynamo*cp312*.whl /opt/dynamo/bindings/wheels/. && \
cp lib/bindings/c/target/release/libdynamo_llm_capi.so /opt/dynamo/bindings/lib/. && \
cp target/release/libdynamo_llm_capi.so /opt/dynamo/bindings/lib/. && \
cp -r lib/bindings/c/include /opt/dynamo/bindings/.
# Install dynamo.runtime and dynamo.llm wheels globally in container for tests that
......
......@@ -210,32 +210,20 @@ WORKDIR /workspace
COPY pyproject.toml /workspace/
COPY README.md /workspace/
COPY LICENSE /workspace/
COPY Cargo.toml /workspace/
COPY Cargo.lock /workspace/
COPY rust-toolchain.toml /workspace/
ARG CARGO_BUILD_JOBS
# Build Rust runtime
COPY lib/runtime /workspace/lib/runtime
RUN cd lib/runtime && \
cargo build --release --locked && cargo doc --no-deps
# Build OpenAI HTTP Service binaries
COPY lib/llm /workspace/lib/llm
COPY lib/ /workspace/lib/
COPY components /workspace/components
RUN cd components && \
cargo build --release && \
cp target/release/http /usr/local/bin/
# Build Dynamo Run binaries
COPY launch /workspace/launch
RUN cd launch && \
cargo build --release --features mistralrs,sglang,vllm,python && \
cp target/release/dynamo-run /usr/local/bin/ && \
cp target/release/llmctl /usr/local/bin/
# Generate C bindings for kv cache routing in vLLM
COPY lib/bindings /workspace/lib/bindings
RUN cd lib/bindings/c && \
cargo build --release --locked && cargo doc --no-deps
ARG CARGO_BUILD_JOBS
ENV CARGO_TARGET_DIR=/workspace/target
RUN cargo build --release --locked --features mistralrs,sglang,vllm,python && \
cargo doc --no-deps
COPY deploy/dynamo/sdk /workspace/deploy/dynamo/sdk
# Build dynamo wheel
......@@ -250,7 +238,7 @@ RUN source /opt/dynamo/venv/bin/activate && \
RUN mkdir -p /opt/dynamo/bindings/wheels && \
mkdir /opt/dynamo/bindings/lib && \
cp dist/ai_dynamo*cp312*.whl /opt/dynamo/bindings/wheels/. && \
cp lib/bindings/c/target/release/libdynamo_llm_capi.so /opt/dynamo/bindings/lib/. && \
cp target/release/libdynamo_llm_capi.so /opt/dynamo/bindings/lib/. && \
cp -r lib/bindings/c/include /opt/dynamo/bindings/.
# Tell vllm to use the Dynamo LLM C API for KV Cache Routing
......
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
[workspace]
members = [
"llmctl",
"dynamo-run"
]
resolver = "2"
[workspace.package]
version = "0.1.0"
edition = "2021"
authors = ["NVIDIA"]
license = "Apache-2.0"
homepage = "https://github.com/ai-dynamo/dynamo"
repository = "https://github.com/ai-dynamo/dynamo.git"
[workspace.dependencies]
# local or crates.io
dynamo-runtime = { path = "../lib/runtime" }
dynamo-llm = { path = "../lib/llm" }
# crates.io
anyhow = { version = "1" }
async-stream = { version = "0.3" }
async-trait = { version = "0.1" }
bytes = "1"
derive_builder = "0.20"
futures = "0.3"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1" }
thiserror = { version = "2.0.11" }
tokio = { version = "1", features = ["full"] }
tokio-stream = { version = "0.1" }
tokio-util = { version = "0.7", features = ["codec", "net"] }
tracing = { version = "0.1" }
validator = { version = "0.20.0", features = ["derive"] }
uuid = { version = "1", features = ["v4", "serde"] }
This diff is collapsed.
......@@ -15,11 +15,12 @@
[package]
name = "dynamo-run"
version = "0.1.0"
edition = "2021"
authors = ["NVIDIA"]
homepage = "https://github.com/ai-dynamo/dynamo"
license = "Apache-2.0"
version.workspace = true
edition.workspace = true
authors.workspace = true
homepage.workspace = true
license.workspace = true
repository.workspace = true
[features]
mistralrs = ["dynamo-llm/mistralrs"]
......@@ -32,24 +33,26 @@ cuda = ["dynamo-llm/cuda"]
metal = ["dynamo-llm/metal"]
[dependencies]
anyhow = "1"
async-openai = "0.27.2"
async-stream = { version = "0.3" }
async-trait = { version = "0.1" }
dynamo-llm = { workspace = true }
dynamo-runtime = { workspace = true }
anyhow = { workspace = true }
async-stream = { workspace = true }
async-trait = { workspace = true }
futures = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }
tokio-util = { workspace = true }
tracing = { workspace = true }
async-openai = { version = "0.27.2" }
candle-hf-hub = { version = "0.3.3", default-features = false, features = ["tokio", "rustls-tls"] }
clap = { version = "4.5", features = ["derive", "env"] }
dialoguer = { version = "0.11", default-features = false, features = ["editor", "history"] }
futures = { version = "0.3" }
futures-util = "0.3"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["full"] }
tokio-util = { version = "0.7", features = ["codec", "net"] }
tracing = { version = "0.1" }
futures-util = { version = "0.3" }
tracing-subscriber = { version = "0.3", features = ["env-filter", "local-time", "json"] }
dynamo-runtime = { path = "../../lib/runtime" }
dynamo-llm = { path = "../../lib/llm" }
[target.x86_64-unknown-linux-gnu.dependencies]
netlink-packet-route = { version = "0.19", optional = true }
rtnetlink = { version = "0.14", optional = true }
rtnetlink = { version = "0.14", optional = true }
\ No newline at end of file
This diff is collapsed.
......@@ -15,20 +15,21 @@
[package]
name = "llmctl"
version = "0.1.0"
edition = "2021"
authors = ["NVIDIA"]
license = "Apache-2.0"
homepage = "https://github.com/ai-dynamo/dynamo"
repository = "https://github.com/ai-dynamo/dynamo.git"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
[dependencies]
dynamo-runtime = { path = "../../lib/runtime" }
dynamo-llm = { path = "../../lib/llm" }
dynamo-runtime = { workspace = true }
dynamo-llm = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tracing = { workspace = true }
tokio = { workspace = true }
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1" }
tracing = { version = "0.1" }
tokio = { version = "1", features = ["full"] }
clap = { version = "4.5", features = ["derive"] }
tabled = "0.18"
\ No newline at end of file
tabled = { version = "0.18" }
\ No newline at end of file
This diff is collapsed.
......@@ -15,12 +15,12 @@
[package]
name = "libdynamo_llm"
version = "0.1.0"
edition = "2021"
authors = ["NVIDIA"]
license = "Apache-2.0"
homepage = "https://github.com/ai-dynamo/dynamo"
repository = "https://github.com/ai-dynamo/dynamo.git"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
[lib]
name = "dynamo_llm_capi"
......@@ -33,15 +33,16 @@ cbindgen = "0.27"
dynamo-llm = { path = "../../llm" }
dynamo-runtime = { path = "../../runtime" }
anyhow = { version = "1" }
futures = "0.3"
once_cell = "1"
serde = "1"
serde_json = "1.0.138"
tokio = { version = "1", features = ["full"] }
tokio-stream = "0"
tracing = "0"
libc = "0.2"
uuid = { version = "1", features = ["v4", "serde"] }
async-once-cell = "0.5.4"
anyhow = { workspace = true }
futures = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true }
tokio-stream = { workspace = true }
tracing = { workspace = true }
uuid = { workspace = true }
async-once-cell = { version = "0.5.4" }
libc = { version = "0.2" }
once_cell = { version = "1" }
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }
This diff is collapsed.
......@@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
[workspace]
# empty workspace to exclude from top level workspace
# excluded due to pyo3 extension module build issues
[package]
name = "dynamo-py3"
version = "0.1.0"
......@@ -34,14 +38,14 @@ crate-type = ["cdylib"]
dynamo-llm = { path = "../../llm", features = ["python"] }
dynamo-runtime = { path = "../../runtime" }
futures = "0.3"
once_cell = "1.20.3"
serde = "1"
serde_json = "1.0.138"
thiserror = "2.0"
futures = { version = "0.3" }
once_cell = { version = "1.20.3" }
serde = { version = "1" }
serde_json = { version = "1.0.138" }
thiserror = { version = "2.0" }
tokio = { version = "1", features = ["full"] }
tokio-stream = "0"
tracing = "0"
tokio-stream = { version = "0" }
tracing = { version = "0" }
tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] }
# "extension-module" tells pyo3 we want to build an extension module (skips linking against libpython.so)
......@@ -61,4 +65,4 @@ pyo3-async-runtimes = { version = "0.23.0", default-features = false, features =
"unstable-streams",
] }
pythonize = "0.23"
pythonize = "0.23"
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment