Skip to content

feat(sandbox): add Dockerfile snapshot helper#2920

Open
Mukil Loganathan (langchain-infra) wants to merge 2 commits into
mainfrom
mukil/sandbox-dockerfile-sdk-wrapper
Open

feat(sandbox): add Dockerfile snapshot helper#2920
Mukil Loganathan (langchain-infra) wants to merge 2 commits into
mainfrom
mukil/sandbox-dockerfile-sdk-wrapper

Conversation

@langchain-infra
Copy link
Copy Markdown
Contributor

@langchain-infra Mukil Loganathan (langchain-infra) commented May 21, 2026

Adds a Python SandboxClient.create_snapshot(..., dockerfile=..., context=...) wrapper for the backend support in langchain-ai/langchainplus#25449.

The SDK flow is intentionally thin:

from langsmith.sandbox import SandboxClient

client = SandboxClient()
snapshot = client.create_snapshot(
    name="my-dockerfile-snapshot",
    dockerfile="Dockerfile",
    context=".",
    fs_capacity_bytes=10 * 1024 * 1024 * 1024,
    on_build_log=print,
)

Under the hood the client creates a temporary builder sandbox, uploads the Docker context, runs docker build --progress=plain with streamed logs, then asks the backend to capture a snapshot from the sandbox-local image.

Release Note

none

Test Plan

  • make format
  • uv run ruff check langsmith/sandbox/_client.py tests/unit_tests/sandbox/test_client.py
  • uv run mypy langsmith/sandbox/_client.py
  • TEST=tests/unit_tests/sandbox/test_client.py make tests
  • make lint currently fails on pre-existing mypy errors in langsmith/_internal/_orjson.py and langsmith/utils.py; ruff passes.

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.

1 participant