Repository navigation
feat(providers): add the tensorlake sandbox provider - #155
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
🤖 Automated Claude routine — Env Pod PR Context Review. This is a bot, not Edgar Arakelyan; not a human review. Context from outside this diff, not a defect in it: #148 (Vercel sandbox provider, open) and the draft #139 (Freestyle VM provider) each add a provider too, and all three edit the same shared files. None of the three references the others, so the overlap isn't visible from any one branch. Checked at this PR's head (
The reason that last one is more than a textual conflict: the obvious "keep both sides" resolution either resurrects the helpers this PR deleted, or merges cleanly while leaving the later provider out of Nothing to change in this PR. Just flagging it so whichever lands second doesn't lose a provider's coverage in the merge. Generated by Claude Code |
|
Thanks for asking, and sorry for the wait. GitHub now shows the PR as conflicting with 1. Merge
2. After the merge. diff --git a/src/agent_env/providers/sandbox_providers/tensorlake/provider.py b/src/agent_env/providers/sandbox_providers/tensorlake/provider.py
index 6b72a08..d23f94a 100644
--- a/src/agent_env/providers/sandbox_providers/tensorlake/provider.py
+++ b/src/agent_env/providers/sandbox_providers/tensorlake/provider.py
@@ -20,7 +20,6 @@ from agent_env.attribution import PIPELINE_STEP_KEY, RUN_ID_KEY, Attribution
from agent_env.config.errors import ConfigError
from agent_env.providers.sandbox_providers.sandbox import NetworkPolicy
from agent_env.providers.sandbox_providers.sandbox_provider import (
- Accepts,
SandboxProvider,
apply_default_attribution,
refuse_unenforceable_policy,
@@ -63,9 +62,6 @@ class TensorlakeSandboxProvider(SandboxProvider):
``api_url`` defaults to the public Tensorlake API.
"""
- CREATES_VMS = True
- SANDBOX_ACCEPTS = Accepts.LOADABLE # a sandbox is a VM, which loads the image; a container pulls it by name
-
# Exposed ports are served at ``https://<port>-<sandbox-id>.sandbox.tensorlake.ai``.
EGRESS_HOSTS: ClassVar[tuple[str, ...]] = ("*.sandbox.tensorlake.ai",)
diff --git a/tst/unit/providers/sandbox_providers/tensorlake_sandbox_test.py b/tst/unit/providers/sandbox_providers/tensorlake_sandbox_test.py
index a3c8cce..b78d859 100644
--- a/tst/unit/providers/sandbox_providers/tensorlake_sandbox_test.py
+++ b/tst/unit/providers/sandbox_providers/tensorlake_sandbox_test.py
@@ -23,7 +23,8 @@ from agent_env.store import set_object_store
def _artifact(url: str | None = "s3://bucket/image.tar.gz", *, context_only: bool = False) -> SimpleNamespace:
return SimpleNamespace(
- tar_gz_object_url=url, context_only=context_only, image_name="img:latest", load_problem=lambda: None
+ tar_gz_object_url=url, context_only=context_only, image_name="img:latest", load_problem=lambda **_: None,
+ rebuilt_for=lambda *_, **__: False
)
3. The download-host race isn't fixed yet. async def _live_info(self, sandbox_id: str) -> SandboxInfo:
async with self._client_cls.for_cloud(**self._client_kwargs()) as client:
return (await client.get(sandbox_id)).valuepassed in from Once you push, the fork CI needs a maintainer to approve the run again; ping here and we'll do it right away. |
9a4cf9c to
1f0f041
Compare
- Read the applied egress policy inside the per-sandbox lock, so two wrappers of one sandbox no longer drop each other's download host. - On cancellation, wait for a pending create and delete its sandbox before the cancellation goes on, so asyncio.run cannot leak it. - Bound the egress wait by elapsed time, and each probe by the time left. - Check that core imports with every optional-only package blocked, including packages that two extras share. - Name the probe timeout, join retries and builder disk size. - List tensorlake 0.5.148 in THIRD_PARTY_NOTICES.md, as uv.lock resolves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n's provider declarations AsyncSandbox.info() returns the handle's cached copy, so two wrappers of one sandbox (the deploy's and the one get_sandbox gives install_cli) overwrote each other's download hosts. The provider now gives TensorlakeSandbox a reader that asks the API, and _allow_download_hosts reads the applied policy through it. CREATES_VMS is gone on main and SANDBOX_ACCEPTS is derived from create_vm, so both declarations go. The load tests' image stand-in gains the load_problem keywords and rebuilt_for that VmSandbox.load_docker_images now calls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1f0f041 to
c0f9106
Compare
|
Hi @earakely-scale , thanks for the review. I've rebased this PR and fixed item 2 and 3 you mentioned above. Could u please take another look? |
Summary
Feature request issue at #154
Adds
tensorlake, a built-in VM sandbox provider that runs on Tensorlake MicroVMs. You install it with thetensorlakeextra. Docker-in-VM flows (gateway, agents, image loading) run on it unchanged.agentenv-dind-host-v1(Docker and Compose; we published it in Tensorlake's public image registry). The Dockerfile is in the provider folder.Setup and config:
src/agent_env/providers/sandbox_providers/tensorlake/README.md.Testing
tensorlake_sandbox_provider_test.py,tensorlake_sandbox_test.py.tensorlake_sandbox_smoke_test.pyruns with a Tensorlake key. Without one, it skips withremote_sandbox.agent-env run hello --sandbox tensorlake

Confidence Score: 5/5
No new blocking issue was established.Summary
Adds
tensorlakeas an optional VM sandbox provider.The ancestry checks did not pass, so the full PR diff was reviewed as changes since the last review. All supplied previous threads are unnumbered; none require a
previousFindingsentry.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Select tensorlake] --> B[Resolve provider config] B --> C[Create MicroVM] C --> D[Expose ports and start Docker] D --> E[Load images and run workloads] E --> F[Reconnect by sandbox ID] F --> G[Restore ports and network policy] G --> H[Terminate sandbox] C -->|Startup fails| H D -->|Setup fails| HReviews (3) · Last reviewed commit: "fix(tensorlake): read the sandbox's poli..." · Reviewed by Greptile