Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
- name: Fetch MNIST model
run: mise run fetch-mnist-rclone

- name: Prefetch dependencies
run: mise run prefetch

- name: Build WASM modules
run: mise run build-modules

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ __pycache__/
.pytest_cache/
.python-version
uv.lock
node_modules/
pnpm-lock.yaml
14 changes: 12 additions & 2 deletions .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pipx = "latest"
"pipx:cmake" = "latest"
"pipx:componentize-py" = "latest"
"pipx:pytest" = "latest"
pnpm = "latest"
protoc = "latest"
python = "3.13"
rclone = "latest"
Expand Down Expand Up @@ -154,7 +155,10 @@ depends = ["cargo-check"]
run = "osv-scanner --lockfile Cargo.lock"

[tasks.prefetch]
depends = ["download-models"]
# `build-ws-wasm-agent` produces `services/ws-wasm-agent/pkg/`, which the
# static workspace references via a `link:` path. Run it before `pnpm install`
# so the link target exists.
depends = ["download-models", "build-ws-wasm-agent"]
description = "Pre-download all dependencies and models (Rust crates, Dart packages, Python envs, Java/Maven, .NET, Node, WIT)"
run = """
cargo check --workspace
Expand All @@ -163,10 +167,16 @@ uv sync --directory services/ws-modules/pydata1
uv sync --directory services/ws-modules/pyface1
mvn dependency:resolve --quiet
dotnet restore
npm install --prefix services/ws-server/static
pnpm install --dir services/ws-server/static --ignore-scripts --config.ignoredBuiltDependencies=protobufjs
zig build --fetch --build-file services/ws-modules/zig-data1/build.zig
"""

# pnpm refuses non-TTY destructive node_modules cleanup unless `CI=true`,
# which fires when an earlier install left a different layout (e.g. before
# `link:` was wired up). Treat `mise run prefetch` as a CI-style batch.
[tasks.prefetch.env]
CI = "true"

[tasks.regenerate-verification]
alias = "regen-verification"
description = "Regenerate checked-in verification output files"
Expand Down
11 changes: 9 additions & 2 deletions services/ws-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ RUN apt-get update \
npm \
pkg-config \
protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g pnpm

WORKDIR /workspace

COPY . .

RUN npm install --omit=dev --prefix /workspace/runtime-deps onnxruntime-web pyodide
# `--config.node-linker=hoisted` writes packages directly under
# `node_modules/` instead of symlinking into `.pnpm/`, so the downstream
# `COPY --from=builder /workspace/runtime-deps/node_modules/onnxruntime-web`
# step picks up a real directory.
RUN pnpm add --prod --dir /workspace/runtime-deps --config.node-linker=hoisted \
--ignore-scripts --config.ignoredBuiltDependencies=protobufjs \
onnxruntime-web pyodide
RUN cargo build -p et-ws-server --release --locked

FROM debian:bookworm-slim AS runtime
Expand Down
2 changes: 1 addition & 1 deletion services/ws-server/static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"style.css"
],
"dependencies": {
"et-ws-wasm-agent": "*",
"et-ws-wasm-agent": "link:../../ws-wasm-agent/pkg",
"onnxruntime-web": "*"
}
}
Loading