Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bd2a99c
feat: improved `install_onnx` script
kallebysantos Jul 11, 2024
797709c
stamp: expose the received unix signal number when exiting
nyannyacha Jul 15, 2024
da4883a
chore: update dependencies
nyannyacha Jul 12, 2024
d67900a
stamp: init onnx runtime using `ctor`
nyannyacha Jul 5, 2024
5361bc4
stamp: don't propagate panic caused by library loading failure
nyannyacha Jul 12, 2024
b1451e0
fix(sb_ai): reflect upstream api changes
nyannyacha Oct 17, 2024
2e7ab58
chore: update `scripts/run_dind.sh`
nyannyacha Jul 30, 2024
717e6cf
chore(k6): bump k6 to 0.52.0
nyannyacha Aug 1, 2024
79af205
chore(k6): update `setup.sh`
nyannyacha Aug 1, 2024
6bdbde3
chore(k6): update `tsconfig.json`
nyannyacha Aug 1, 2024
085a510
chore(k6): add dependency
nyannyacha Aug 1, 2024
909a59f
chore(k6): update `package-lock.json`
nyannyacha Aug 1, 2024
2bb4fb5
fix(k6): make gte scenario more robustly
nyannyacha Aug 1, 2024
d743791
fix(k6): add a test for request cancelled to gte scenario
nyannyacha Aug 9, 2024
893ebb0
stamp: optimize pipeline loading
kallebysantos Oct 17, 2024
b0c8f6c
stamp: introduce session cleanup logic
nyannyacha Oct 27, 2024
185ffba
chore: update `examples/main.ts`
nyannyacha Aug 1, 2024
ce29ee9
stamp: move `DenoRuntimeDropToken` to `base_rt` crate
nyannyacha Aug 9, 2024
b167311
stamp: rename mod
nyannyacha Aug 9, 2024
6a41745
perf: makes run inference task in the blocking thread pool
nyannyacha Aug 9, 2024
4c986e3
stamp: polishing
nyannyacha Aug 15, 2024
a9f24ba
chore: update dependencies
nyannyacha Jul 12, 2024
faf7538
stamp: adjust cpu metrics guard
nyannyacha Aug 22, 2024
42f1ebd
stamp: clippy
kallebysantos Oct 28, 2024
8601949
feat: add GPU support
kallebysantos Oct 28, 2024
bfc3661
chore: apply format
nyannyacha Nov 1, 2024
53b2100
stamp: insert tracing macros at some points
nyannyacha Nov 1, 2024
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
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"ONNXRUNTIME_VERSION": "1.17.0",
"ONNXRUNTIME_VERSION": "1.19.2",
"DENO_VERSION": "1.45.2"
}
},
Expand Down Expand Up @@ -39,4 +39,4 @@
]
}
}
}
}
49 changes: 42 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ ctor = "0.2.6"
fastwebsockets = { version = "0.6", features = ["upgrade", "unstable-split"] }
percent-encoding = "2.3.0"
scopeguard = "1.2.0"
clap = { version = "4.0.29", features = ["cargo", "string", "env"] }
glob = "0.3.1"
httparse = "1.8.0"
http = "1.0"
Expand All @@ -110,7 +111,6 @@ faster-hex = "0.9"
num-bigint = { version = "0.4", features = ["rand"] }
notify = "=5.0.0"
parking_lot = "0.12.0"
pin-project = "1.0.11"
rustls = "0.22.4"
rustls-pemfile = "2"
rustls-tokio-stream = "=0.2.23"
Expand All @@ -130,10 +130,13 @@ rand = "=0.8.5"
signature = "2.1"
spki = "0.7.2"
urlencoding = "2.1.2"
pin-project = "1"
fxhash = "0.2"
tracing = "0.1"
tracing-subscriber = "0.3"
tracing-subscriber = { version = "0.3", features = ["env-filter", "tracing-log"] }
rkyv = "0.7"
tempfile = "3"
xxhash-rust = "0.8"

[patch.crates-io]
# If the PR is merged upstream, remove the line below.
Expand Down
49 changes: 41 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM rust:1.79.0-bookworm as builder

ARG TARGETPLATFORM
ARG GIT_V_VERSION
ARG ONNXRUNTIME_VERSION=1.17.0
ARG ONNXRUNTIME_VERSION=1.19.2
ARG PROFILE=release
ARG FEATURES

Expand All @@ -26,20 +26,53 @@ RUN objcopy --strip-debug \
--add-gnu-debuglink=/root/edge-runtime.debug \
/root/edge-runtime

RUN ./scripts/install_onnx.sh $ONNXRUNTIME_VERSION $TARGETPLATFORM /root/libonnxruntime.so
RUN ./scripts/download_models.sh

FROM debian:bookworm-slim
# Application runtime without ONNX
FROM debian:bookworm-slim as edge-runtime-base

RUN apt-get update && apt-get install -y libssl-dev && rm -rf /var/lib/apt/lists/*
RUN apt-get remove -y perl && apt-get autoremove -y

COPY --from=builder /root/edge-runtime /usr/local/bin/edge-runtime
COPY --from=builder /root/edge-runtime.debug /usr/local/bin/edge-runtime.debug
COPY --from=builder /root/libonnxruntime.so /usr/local/bin/libonnxruntime.so
COPY --from=builder /usr/src/edge-runtime/models /etc/sb_ai/models

ENV ORT_DYLIB_PATH=/usr/local/bin/libonnxruntime.so
ENV SB_AI_MODELS_DIR=/etc/sb_ai/models
ENV ORT_DYLIB_PATH=/usr/local/bin/onnxruntime/lib/libonnxruntime.so


# ONNX Runtime provider
# Application runtime with ONNX
FROM builder as ort
RUN ./scripts/install_onnx.sh $ONNXRUNTIME_VERSION $TARGETPLATFORM /root/onnxruntime


# ONNX Runtime CUDA provider
# Application runtime with ONNX CUDA
FROM builder as ort-cuda
RUN ./scripts/install_onnx.sh $ONNXRUNTIME_VERSION $TARGETPLATFORM /root/onnxruntime --gpu


FROM builder as preload-models
RUN ./scripts/download_models.sh


# With CUDA
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 as edge-runtime-cuda

COPY --from=edge-runtime-base /usr/local/bin/edge-runtime /usr/local/bin/edge-runtime
COPY --from=builder /root/edge-runtime.debug /usr/local/bin/edge-runtime.debug
COPY --from=ort-cuda /root/onnxruntime /usr/local/bin/onnxruntime
COPY --from=preload-models /usr/src/edge-runtime/models /etc/sb_ai/models

ENV ORT_DYLIB_PATH=/usr/local/bin/onnxruntime/lib/libonnxruntime.so
ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility

ENTRYPOINT ["edge-runtime"]


# Base
FROM edge-runtime-base as edge-runtime
COPY --from=ort /root/onnxruntime /usr/local/bin/onnxruntime
COPY --from=preload-models /usr/src/edge-runtime/models /etc/sb_ai/models

ENTRYPOINT ["edge-runtime"]
2 changes: 1 addition & 1 deletion crates/base/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub async fn start_server(
inspector_option: Option<InspectorOption>,
jsx_specifier: Option<String>,
jsx_module: Option<String>,
) -> Result<(), Error> {
) -> Result<Option<i32>, Error> {
let mut server = Server::new(
ip,
port,
Expand Down
Loading