Skip to content

feat(sandbox): add JS Dockerfile snapshots#2951

Open
Mukil Loganathan (langchain-infra) wants to merge 1 commit into
mainfrom
mukil/js-sandbox-dockerfile-snapshots
Open

feat(sandbox): add JS Dockerfile snapshots#2951
Mukil Loganathan (langchain-infra) wants to merge 1 commit into
mainfrom
mukil/js-sandbox-dockerfile-snapshots

Conversation

@langchain-infra
Copy link
Copy Markdown
Contributor

Summary

  • Add JS SandboxClient.createSnapshotFromDockerfile(...) while keeping the existing Docker-image createSnapshot(...) signature unchanged.
  • Upload local Docker build contexts to temporary builder sandboxes, run BuildKit, and capture the built sandbox-local image through the snapshot API.
  • Extend JS capture snapshot options with Docker image export fields and re-export the new Dockerfile snapshot options type.

Release Note

JS SDK sandbox clients can now build snapshots from a local Dockerfile context.

Test Plan

  • rtk pnpm test -- src/tests/sandbox.test.ts
  • rtk pnpm exec oxfmt --check src/sandbox/client.ts src/sandbox/types.ts src/sandbox/index.ts src/tests/sandbox.test.ts
  • rtk pnpm exec oxlint src/sandbox/client.ts src/sandbox/types.ts src/sandbox/index.ts src/tests/sandbox.test.ts
  • rtk pnpm run check:types
  • rtk pnpm run build
  • Prod JS e2e with builder snapshot 55d870c0-1d0f-48fe-aa8b-c10f543a17f1: built Dockerfile, captured ready snapshot b1ef5128-b2af-4f63-9a56-275e02cc054b, deleted test snapshot.

@github-actions
Copy link
Copy Markdown

JS perf benchmark

Lower is better. Noisy on shared runners — treat as a signal, not a gate.

Base64-heavy payload

Single large base64 string per message — the shape the worker-offload path is optimized for.
Payload: 2511.2 KB in / 5.2 KB out, 100 runs.

metric main this PR delta
Wall time (ms) 1878.73 1752.92 -6.7%
createRun total (ms) 74.48 78.08 +4.8%
createRun p50 (ms) 0.60 0.48 -19.5%
createRun p95 (ms) 0.80 0.82 +2.3%
createRun p99 (ms) 26.27 25.35 -3.5%
createRun max (ms) 26.27 25.35 -3.5%
updateRun total (ms) 42.20 43.31 +2.6%
updateRun p95 (ms) 0.72 1.01 +40.9%
loop lag total (ms) 1146.15 799.13 -30.3%
loop lag p50 (ms) 0.10 0.10 -0.7%
loop lag p95 (ms) 4.59 3.60 -21.6%
loop lag p99 (ms) 39.70 10.64 -73.2%
loop lag max (ms) 147.70 114.22 -22.7%

Structural payload

Many small strings across a wide/nested object graph. Should bypass worker offload and use sync flush.
Payload: 1239.5 KB in / 13.3 KB out, 100 runs.

metric main this PR delta
Wall time (ms) 1453.59 1512.05 +4.0%
createRun total (ms) 395.47 440.61 +11.4%
createRun p50 (ms) 3.46 3.50 +1.1%
createRun p95 (ms) 6.82 6.00 -12.0%
createRun p99 (ms) 9.57 39.12 +308.6%
createRun max (ms) 9.57 39.12 +308.6%
updateRun total (ms) 39.37 40.96 +4.0%
updateRun p95 (ms) 0.63 0.69 +8.9%
loop lag total (ms) 1003.14 1060.11 +5.7%
loop lag p50 (ms) 0.07 0.08 +11.1%
loop lag p95 (ms) 4.75 4.83 +1.7%
loop lag p99 (ms) 122.17 120.78 -1.1%
loop lag max (ms) 166.17 162.40 -2.3%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants