Metadata-Version: 2.4
Name: sandbox-cloud-harbor-environment
Version: 0.1.0
Summary: Harbor environment plugin for Sandbox Cloud Platform
License-Expression: MPL-2.0
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: httpx>=0.27
Requires-Dist: sandbox-cloud-client>=0.1.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# sandbox-cloud-harbor-environment

Harbor environment plugin for [Sandbox Cloud Platform](https://github.com/e3f-six/sandbox-cloud-platform).

Lets Harbor users run benchmark jobs (e.g. terminal-bench 2.0) against the Sandbox Cloud Platform with the same UX as other Harbor cloud environments. Installable from **public PyPI** — no company-private index required.

## Installation

```bash
uv tool install harbor --with sandbox-cloud-harbor-environment
```

or with pip in a Python 3.12 environment:

```bash
pip install harbor==0.6.6 sandbox-cloud-harbor-environment
```

This pulls the public `sandbox-cloud-client` SDK automatically.

## Usage

Set your connection details in environment variables:

```bash
export SANDBOX_CLOUD_PLATFORM_BASE_URL=https://your-platform-host
export SANDBOX_CLOUD_PLATFORM_API_KEY=scp...
```

Run a Harbor benchmark using the import-path extension point:

```bash
harbor run -d terminal-bench@2.0 \
    --environment-import-path sandbox_cloud_harbor_environment:SandboxCloudHarborEnvironment
```

> **Why `--environment-import-path` and not `--env sandbox-cloud-platform`?**
>
> Harbor 0.6.6's `--env` flag only accepts values from the built-in
> `EnvironmentType` enum (docker, daytona, e2b, …). External packages installed
> via `--with` cannot add new enum values at runtime.  The official Harbor
> extension point for custom environments is `--environment-import-path`, which
> accepts any `module.path:ClassName` importable in the tool's virtual environment.

## Environment variables

| Variable | Default | Description |
|---|---|---|
| `SANDBOX_CLOUD_PLATFORM_BASE_URL` | `http://localhost:8000` | Platform base URL |
| `SANDBOX_CLOUD_PLATFORM_API_KEY`  | *(none)* | API key — forwarded as `Authorization: Bearer`; required when auth is enabled (the platform is OIDC-only) |

## Compatibility

- Python 3.12+
- harbor 0.6.6
- sandbox-cloud-client >= 0.1.0 (public PyPI)

## Troubleshooting

**`Import error: sandbox_cloud not found`**
The `sandbox-cloud-client` package provides the `sandbox_cloud.*` client modules and is a declared dependency; `pip install sandbox-cloud-harbor-environment` pulls it from public PyPI. If you see this, reinstall in a clean environment.

**`HTTPStatusError 401 Unauthorized`**
Set `SANDBOX_CLOUD_PLATFORM_API_KEY` to a valid API key. (Note: the in-repo `sandbox_cloud.plugins.harbor.environment` import-path does NOT send an auth header — use **this** package's import-path, which forwards `Authorization: Bearer`.)

**`Connection refused / Cannot connect to host`**
Set `SANDBOX_CLOUD_PLATFORM_BASE_URL` to the correct platform URL and ensure you are on an allowed network.

**Harbor version mismatch**
This package targets `harbor==0.6.6`. Other versions may work but are not tested.
Pin `harbor==0.6.6` if you encounter compatibility issues:
```bash
uv tool install harbor==0.6.6 --with sandbox-cloud-harbor-environment
```

## License

[MPL-2.0](LICENSE) — source-available; modifications permitted, modified covered files' source published on distribution (file-level copyleft).
