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
2 changes: 1 addition & 1 deletion docs/source/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ with EchoEnv(base_url="http://localhost:8000").sync() as client:
result = client.reset()
```

The same client also runs environments on cloud sandboxes (Daytona, Modal, Novita, Azure Container Apps, Hugging Face) through runtime providers. `HFSandboxProvider` ships with core OpenEnv and needs a Hugging Face token for an account that can run Jobs (the sandboxes are billed as Jobs): it runs an environment's Space image in a Hugging Face sandbox ([example](guides/runtime-providers#hfsandboxprovider)). See the [Runtime Providers guide](guides/runtime-providers) to pick one.
The same client also runs environments on cloud sandboxes (Daytona, Modal, Novita, Azure Container Apps, Hugging Face) and on a Kubernetes cluster through runtime providers. `HFSandboxProvider` ships with core OpenEnv and needs a Hugging Face token for an account that can run Jobs (the sandboxes are billed as Jobs): it runs an environment's Space image in a Hugging Face sandbox ([example](guides/runtime-providers#hfsandboxprovider)). `KubernetesProvider` is an optional extra (`pip install openenv[kubernetes]`). See the [Runtime Providers guide](guides/runtime-providers) to pick one.

## Next Steps

Expand Down
21 changes: 17 additions & 4 deletions docs/source/guides/runtime-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ is a one-line change.
| `ModalProvider` | Modal sandboxes | `pip install openenv[modal]` | ✅ |
| `NovitaSandboxProvider` | Novita AI sandboxes | `pip install openenv[novita]` | ✅ |
| `HFSandboxProvider` | Hugging Face sandboxes (billed as HF Jobs) | core | ✅ |

A `KubernetesProvider` is planned but not available yet.
| `KubernetesProvider` | Kubernetes cluster | `pip install openenv[kubernetes]` | ✅ |

Cloud-provider SDKs are optional extras, imported lazily, so installing core
OpenEnv pulls in no cloud SDK. The core providers (`LocalDockerProvider`,
Expand Down Expand Up @@ -237,8 +236,22 @@ Full example: [`examples/hf_sandbox_coding_env.py`](https://github.com/huggingfa

### KubernetesProvider

🚧 Not yet implemented. The class exists as a placeholder for the planned
Kubernetes backend.
Runs one environment as one Pod and one Service in an existing namespace.
Install with `pip install openenv[kubernetes]`. The returned URL is the
in-cluster Service DNS name over `http://{name}.{namespace}:{port}`, which Pod
DNS search expands under `svc.<cluster-domain>`. `ModalProvider` and
`ACASandboxProvider` still require `https://`. Use this provider from a trainer
in the same cluster; it does not create a namespace, Deployment, Ingress, or
port-forward.

```python
from openenv.core.containers.runtime.kubernetes_provider import KubernetesProvider

provider = KubernetesProvider(namespace="openenv")
base_url = provider.start_container("echo-env:latest")
provider.wait_for_ready(base_url)
provider.stop_container()
```

### LocalDockerProvider

Expand Down
2 changes: 2 additions & 0 deletions docs/source/reference/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,5 @@ See [Evaluating with Environments](../tutorials/evaluation-inspect) for a worked
[[autodoc]] openenv.core.containers.runtime.novita_provider.NovitaSandboxProvider

[[autodoc]] openenv.core.containers.runtime.hf_sandbox_provider.HFSandboxProvider

[[autodoc]] openenv.core.containers.runtime.kubernetes_provider.KubernetesProvider
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ modal = [
"modal>=1.4.0",
"pyyaml>=6.0",
]
kubernetes = [
"kubernetes>=29.0.0",
]
novita = [
"novita-sandbox>=2.1.1",
]
Expand Down
6 changes: 3 additions & 3 deletions src/openenv/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ provider.wait_for_ready(base_url)
provider.stop_container()
```

### Kubernetes Provider (Coming Soon)
### Kubernetes Provider

```python
from openenv.core.containers.runtime import KubernetesProvider
from openenv.core.containers.runtime.kubernetes_provider import KubernetesProvider

provider = KubernetesProvider(namespace="envs")
base_url = provider.start_container("my-env:latest")
# Use environment...
provider.wait_for_ready(base_url)
provider.stop_container()
```

Expand Down
2 changes: 0 additions & 2 deletions src/openenv/core/containers/runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from .providers import (
ContainerProvider,
DockerSwarmProvider,
KubernetesProvider,
LocalDockerProvider,
RuntimeProvider,
)
Expand All @@ -20,7 +19,6 @@
"ContainerProvider",
"DockerSwarmProvider",
"LocalDockerProvider",
"KubernetesProvider",
"RuntimeProvider",
"UVProvider",
]
Loading
Loading