Repository navigation
feat: add tensorlake sandbox - #1555
Open
cooltx7eel wants to merge 1 commit into
Open
cooltx7eel wants to merge 1 commit into
cooltx7eel wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
TensorlakeProvider, aContainerProviderthat runs an environment server in a Tensorlake sandbox and returns a public HTTPSbase_urlforEnvClient. It is an optional extra (pip install openenv[tensorlake]) with a lazy SDK import, and follows the same keep-alive-then-launch approach as the Modal, Daytona and Novita providers. Also adds tests, an echo-env example, and docs entries.public=Trueto accept that.169.254.0.0/16is always blocked.allow_outanddeny_outcontrol the rest.surface_server_logs=True.openenv.core.containers.runtime.tensorlake_provider. It is not re-exported, same asKubernetesProvider.Type of Change
Alignment Checklist
Before submitting, verify:
.claude/docs/PRINCIPLES.mdand this PR aligns with our principles.claude/docs/INVARIANTS.mdand no invariants are violated/pre-submit-pr(orbash .claude/hooks/lint.shand tests) and addressed all issuesRFC Status
Test Plan
PYTHONPATH=src:envs uv run pytest tests/test_core/test_tensorlake_provider.py: 24 passed, no Tensorlake account needed. The tests use a fake SDK and cover the public URL contract, thepublic=Trueopt-in, metadata egress blocking, empty allowlist, cleanup after a failed start,cmdoverride andopenenv.yamldiscovery, idempotent and retried stop, env var merging, HTTPS enforcement, context-manager exit, andwait_for_readyon dead, healthy, foreign and flaky servers.PYTHONPATH=src:envs uv run pytest tests/test_core/: 586 passed, 20 skipped.ruff check,ruff format --checkandusort checkon the changed files. The repo-wideusort checkandruff format --checkreporttests/envs/test_julia_env.py,tests/envs/test_grid_world.pyandsrc/openenv/core/harness/README.md, which are untouched by this PR and already fail onmain.tl sbx image import ghcr.io/huggingface/openenv-echo-env:latest --registered-name echo-env TENSORLAKE_API_KEY=... PYTHONPATH=src:envs uv run python examples/tensorlake_echo_env.py Expected: the sandbox starts, /health returns 200, echo_message round-trips "Hello, World!", and the sandbox is terminated at exit.Claude Code Review
Note
Medium Risk
New optional integration with public unauthenticated ingress and egress policy knobs; implementation includes careful cleanup and secret redaction but misconfiguration could expose sandbox URLs or leak env vars in logs.
Overview
Adds
TensorlakeProvider, a new cloudContainerProviderthat boots a registered Tensorlake sandbox image, replaces the image CMD with a keep-alive entrypoint, launches the OpenEnv server on port 8000 (fromopenenv.yamlorcmd=), and returns a public HTTPSbase_urlforEnvClient.Install via
pip install openenv[tensorlake](lazy SDK import,tensorlake>=0.5.135to avoid websockets conflicts with core). Security behavior matches other sandbox providers: callers must passpublic=True, ingress URLs must be HTTPS,169.254.0.0/16egress is always blocked, and optionalallow_out/deny_outtune the rest; server logs in errors are redacted unlesssurface_server_logs=True.Also adds
examples/tensorlake_echo_env.py, a large fake-SDK unit test suite, autodoc/reference entries, and getting-started / runtime-providers docs listing thetensorlakeextra.Reviewed by Cursor Bugbot for commit c301d0e. Bugbot is set up for automated code reviews on this repo. Configure here.