withruntime 0.7.2__tar.gz → 0.8.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {withruntime-0.7.2/withruntime.egg-info → withruntime-0.8.2}/PKG-INFO +86 -2
- {withruntime-0.7.2 → withruntime-0.8.2}/README.md +85 -1
- {withruntime-0.7.2 → withruntime-0.8.2}/pyproject.toml +1 -1
- withruntime-0.8.2/tests/test_blaxel.py +1181 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_client.py +1 -0
- withruntime-0.8.2/tests/test_files_upload_parallel.py +76 -0
- withruntime-0.8.2/tests/test_http_tls_close.py +118 -0
- withruntime-0.8.2/tests/test_stream_exit_close.py +55 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_client.py +20 -5
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_http.py +7 -3
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_client.py +20 -5
- withruntime-0.8.2/withruntime/_version.py +1 -0
- withruntime-0.8.2/withruntime/blaxel/__init__.py +121 -0
- withruntime-0.8.2/withruntime/blaxel/_async_io.py +50 -0
- withruntime-0.8.2/withruntime/blaxel/_async_sandbox.py +1651 -0
- withruntime-0.8.2/withruntime/blaxel/_core.py +1586 -0
- withruntime-0.8.2/withruntime/blaxel/_sync_io.py +61 -0
- withruntime-0.8.2/withruntime/blaxel/_sync_sandbox.py +1649 -0
- withruntime-0.8.2/withruntime/blaxel/core/__init__.py +4 -0
- withruntime-0.8.2/withruntime/blaxel/core/agents.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/__init__.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/api/__init__.py +2 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/api/applications/__init__.py +2 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/api/applications/list_application_revisions.py +5 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/api/compute/__init__.py +2 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/api/compute/get_sandbox.py +5 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/api/compute/update_sandbox.py +5 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/api/functions/__init__.py +2 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/api/functions/create_function.py +5 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/api/images.py +6 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/api/workspaces.py +6 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/client.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/models/__init__.py +17 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/models/create_job_execution_request.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/models/create_job_execution_request_env.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/models/env.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/models/function.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/models/function_runtime.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/models/function_spec.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/models/metadata.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/models/workspace.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/client/types.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/common.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/drive.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/core/jobs.py +6 -0
- withruntime-0.8.2/withruntime/blaxel/core/sandbox/__init__.py +9 -0
- withruntime-0.8.2/withruntime/blaxel/core/sandbox/types.py +6 -0
- withruntime-0.8.2/withruntime/blaxel/crewai.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/googleadk.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/langgraph.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/livekit.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/llamaindex.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/openai.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/pydantic.py +3 -0
- withruntime-0.8.2/withruntime/blaxel/telemetry.py +2 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/inspect_ai.py +2 -1
- {withruntime-0.7.2 → withruntime-0.8.2/withruntime.egg-info}/PKG-INFO +86 -2
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime.egg-info/SOURCES.txt +47 -0
- withruntime-0.7.2/withruntime/_version.py +0 -1
- {withruntime-0.7.2 → withruntime-0.8.2}/LICENSE +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/setup.cfg +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_account_errors.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_async_stream_cleanup.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_audit.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_billing.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_capacity_wait.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_daytona.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_deepagents.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_e2b_code_interpreter.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_e2b_sandbox.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_eval_sandbox.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_exec_stream.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_files_download.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_files_mode.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_harbor.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_identity_token.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_images_v2.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_images_volumes_interpreter.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_inspect_ai.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_late_answer.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_lifecycle_settings.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_limits.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_mounts.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_network_funding.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_network_products.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_observability.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_openai_agents.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_previews_network_desktop.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_proxy.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_referrals.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_secrets.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_snapshot_after_fork.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_sso.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_switching.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_tools.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_unpack.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_vercel.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_volume_backups.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_wake_awake.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_wallet.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/tests/test_watch.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/__init__.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/__init__.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/audit.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/billing.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/desktop.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/images.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/interpreter.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/limits.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/mcp.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/mounts.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/network.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/network_products.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/observability.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/previews.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/referrals.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/secrets.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/sso.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/switching.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/volumes.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_async_products/watch.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_clock.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_connection.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_errors.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_eval_sandbox.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_proxy.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/__init__.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/audit.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/billing.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/desktop.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/images.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/interpreter.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/limits.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/mcp.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/mounts.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/network.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/network_products.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/observability.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/previews.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/referrals.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/secrets.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/sso.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/switching.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/volumes.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_sync_products/watch.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_tunnel.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_unpack.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/_ws.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/daytona/__init__.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/daytona/_async_daytona.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/daytona/_async_io.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/daytona/_core.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/daytona/_sync_daytona.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/daytona/_sync_io.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/deepagents.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/__init__.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/_async_io.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/_async_sandbox.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/_core.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/_sync_io.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/_sync_sandbox.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/code_interpreter/__init__.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/code_interpreter/_async_ci.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/code_interpreter/_models.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/e2b/code_interpreter/_sync_ci.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/harbor.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/openai_agents.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/tools.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/__init__.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/_async_io.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/_async_sandbox.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/_core.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/_sync_io.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/_sync_sandbox.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/api.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/sandbox/__init__.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/vercel/sandbox/sync.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/wallet.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime/webhooks.py +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime.egg-info/dependency_links.txt +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime.egg-info/entry_points.txt +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime.egg-info/requires.txt +0 -0
- {withruntime-0.7.2 → withruntime-0.8.2}/withruntime.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: withruntime
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.2
|
|
4
4
|
Summary: Runtime Cloud: one client (sync and async) for every Runtime product. Sandboxes first.
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Project-URL: Homepage, https://withruntime.com
|
|
@@ -73,7 +73,10 @@ list, glob, stat, move, remove, upload and download directories), `pause`,
|
|
|
73
73
|
`wake`, `extend`, `update`, `keep_alive`, `fork` and `snapshot`, and the
|
|
74
74
|
`interpreter`, `network`, `previews` and `desktop` products. A paused sandbox
|
|
75
75
|
also wakes by itself on the next call, and `Sandbox.get_or_create(name)` returns
|
|
76
|
-
the sandbox with that name or creates it.
|
|
76
|
+
the sandbox with that name or creates it. A sandbox pauses itself after 60 seconds
|
|
77
|
+
with nothing happening in it, keeping its memory and processes, so an
|
|
78
|
+
idle sandbox costs no compute; `idle_pause_seconds` sets 10 to 86,400, or 0 for
|
|
79
|
+
never. The client has `sandboxes`, `images`,
|
|
77
80
|
`volumes`, `snapshots`, `limits`, `feedback` and `support`;
|
|
78
81
|
`runtime.limits.get()` (0.3.1 and later) says whether the key is read-only and
|
|
79
82
|
what its agent may still spend today. Every write carries an
|
|
@@ -133,6 +136,87 @@ use instead. The sync modules are generated from the async ones by
|
|
|
133
136
|
`scripts/generate_dropin_sync.py`. `DAYTONA.md` and `VERCEL.md` in the
|
|
134
137
|
JavaScript package list every mapping and gap.
|
|
135
138
|
|
|
139
|
+
## Code written for Blaxel
|
|
140
|
+
|
|
141
|
+
`withruntime.blaxel` runs code written for Blaxel's Python SDK (`blaxel`
|
|
142
|
+
0.4.11) on Runtime. Change the import and set `RUNTIME_API_KEY`, or run
|
|
143
|
+
`npx withruntime login` once:
|
|
144
|
+
|
|
145
|
+
```python no-run
|
|
146
|
+
from withruntime.blaxel import SandboxInstance # was: from blaxel.core import SandboxInstance
|
|
147
|
+
from withruntime.blaxel import SyncSandboxInstance # was: from blaxel.core import SyncSandboxInstance
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`withruntime.blaxel.core` holds the same names, so replacing `blaxel.` with
|
|
151
|
+
`withruntime.blaxel.` works too. A Runtime key in `BL_API_KEY` is used; a
|
|
152
|
+
Blaxel key is never sent anywhere.
|
|
153
|
+
|
|
154
|
+
How it maps:
|
|
155
|
+
|
|
156
|
+
- **Sandboxes.** `create`, `create_if_not_exists` (one sandbox when two calls
|
|
157
|
+
race), `get`, `get_by_external_id`, `list`, `delete`, `fork`, `snapshots` and
|
|
158
|
+
the `update_*` calls work. `memory` is kept, with one vCPU for every 2048 MB.
|
|
159
|
+
Blaxel's general templates (`blaxel/base-image`, `py-app`, `ts-app`, `node`,
|
|
160
|
+
`jupyter-server`, `docker-in-sandbox`) run on Runtime's image. Any other
|
|
161
|
+
image `ns/name:tag` starts from the ready Runtime image `ns-name:tag`
|
|
162
|
+
(every `/` becomes `-`; the tag is `latest` when none is given), so the
|
|
163
|
+
code keeps Blaxel's image string. A missing one raises `NotSupportedError`
|
|
164
|
+
with the build command, for example `npx withruntime image build
|
|
165
|
+
--dockerfile Dockerfile --name my-company-agent-image -t
|
|
166
|
+
my-company-agent-image:latest`. Volumes mount Runtime volumes of the same
|
|
167
|
+
name. On the free trial a sandbox has at most 4096 MB of memory (2 vCPUs).
|
|
168
|
+
- **Standby.** A sandbox pauses after a minute with no call (Blaxel: about 15
|
|
169
|
+
seconds). It keeps its memory and processes, and wakes on the next command,
|
|
170
|
+
file call or preview visit. `archive` pauses it and keeps its memory too.
|
|
171
|
+
A lease in use is renewed, so a long command is not paused at the hour.
|
|
172
|
+
`keep_alive` raises the idle pause to the process's time limit, or turns it
|
|
173
|
+
off for a process with none. The first call from any client that finds no
|
|
174
|
+
`keep_alive` process running gives the old idle pause back.
|
|
175
|
+
- **How long it is kept.** A paused sandbox with no `ttl` or `lifecycle` is
|
|
176
|
+
kept 365 days. Blaxel keeps it until you delete it. A limit is rounded up to
|
|
177
|
+
whole days of pause. A limit of an hour or less that counts from creation
|
|
178
|
+
also ends the sandbox at that time. On the free trial a paused sandbox is kept
|
|
179
|
+
seven days, the most Blaxel's first tier keeps one.
|
|
180
|
+
- **Envs** reach every process, from any client: they are kept on the
|
|
181
|
+
sandbox, and a process's own `env` wins.
|
|
182
|
+
- **Paths.** `/blaxel`, Blaxel's working directory and `HOME`, is
|
|
183
|
+
`/workspace`. Relative paths and `~` start there.
|
|
184
|
+
- **Processes.** You can find a process by name from any client, as long as
|
|
185
|
+
Runtime still has its record. Runtime keeps the running processes and the
|
|
186
|
+
last 16 that ended.
|
|
187
|
+
- **Previews** are Runtime previews of each port. A private preview's
|
|
188
|
+
`tokens.create(expires_at)` gives a token, which works as Blaxel's
|
|
189
|
+
`X-Blaxel-Preview-Token` header or `bl_preview_token` address parameter.
|
|
190
|
+
`fetch(port)` uses a private preview for you.
|
|
191
|
+
- **Code interpreter.** `CodeInterpreter.run_code` and `create_code_context`
|
|
192
|
+
run on Runtime's interpreter and return Blaxel's result classes.
|
|
193
|
+
- **Errors.** Errors keep Blaxel's classes: `SandboxAPIError`,
|
|
194
|
+
`ResponseError` and `SnapshotAPIError`. Each also carries Runtime's `code`,
|
|
195
|
+
`hint` and `request_id`.
|
|
196
|
+
- **Runtime fields.** `runtime_create={...}` passes Runtime's own create
|
|
197
|
+
fields, for example `{"funding": "trial"}`. `sandbox.withruntime` is the
|
|
198
|
+
Runtime sandbox underneath.
|
|
199
|
+
|
|
200
|
+
Differences you can hit:
|
|
201
|
+
|
|
202
|
+
- Commands run as root, as on Blaxel, with the sandbox's `PATH` and `HOME`
|
|
203
|
+
(`/workspace`). File calls act as the sandbox user and fall back to `sudo`
|
|
204
|
+
where only root may: they reach files a root process made, including private
|
|
205
|
+
ones, and a file they write is the sandbox user's.
|
|
206
|
+
- A key sees the sandboxes it made, and another key's answer 404, unless an
|
|
207
|
+
owner or admin makes the key account-wide, as a Blaxel workspace key is
|
|
208
|
+
([teams](https://withruntime.com/docs/teams#keys-in-a-team)).
|
|
209
|
+
- Public previews need a paid sandbox.
|
|
210
|
+
- A process's `pid` is Runtime's process id, not an operating-system number.
|
|
211
|
+
|
|
212
|
+
These raise `NotSupportedError` before anything happens, naming what to use:
|
|
213
|
+
regions outside the US, read-only and ephemeral volumes, drives, `extra_args`
|
|
214
|
+
other than `iptables`, egress and subnet settings, preview headers, custom
|
|
215
|
+
domains and preview expiry, restoring a snapshot in place (fork from it
|
|
216
|
+
instead), sessions, codegen, `system`, schedules, and Blaxel's agents, models,
|
|
217
|
+
tools, jobs and applications. The sync module is generated from the async one
|
|
218
|
+
by `scripts/generate_dropin_sync.py`.
|
|
219
|
+
|
|
136
220
|
## Agent frameworks
|
|
137
221
|
|
|
138
222
|
`withruntime.openai_agents` is a sandbox client for the OpenAI Agents SDK's
|
|
@@ -50,7 +50,10 @@ list, glob, stat, move, remove, upload and download directories), `pause`,
|
|
|
50
50
|
`wake`, `extend`, `update`, `keep_alive`, `fork` and `snapshot`, and the
|
|
51
51
|
`interpreter`, `network`, `previews` and `desktop` products. A paused sandbox
|
|
52
52
|
also wakes by itself on the next call, and `Sandbox.get_or_create(name)` returns
|
|
53
|
-
the sandbox with that name or creates it.
|
|
53
|
+
the sandbox with that name or creates it. A sandbox pauses itself after 60 seconds
|
|
54
|
+
with nothing happening in it, keeping its memory and processes, so an
|
|
55
|
+
idle sandbox costs no compute; `idle_pause_seconds` sets 10 to 86,400, or 0 for
|
|
56
|
+
never. The client has `sandboxes`, `images`,
|
|
54
57
|
`volumes`, `snapshots`, `limits`, `feedback` and `support`;
|
|
55
58
|
`runtime.limits.get()` (0.3.1 and later) says whether the key is read-only and
|
|
56
59
|
what its agent may still spend today. Every write carries an
|
|
@@ -110,6 +113,87 @@ use instead. The sync modules are generated from the async ones by
|
|
|
110
113
|
`scripts/generate_dropin_sync.py`. `DAYTONA.md` and `VERCEL.md` in the
|
|
111
114
|
JavaScript package list every mapping and gap.
|
|
112
115
|
|
|
116
|
+
## Code written for Blaxel
|
|
117
|
+
|
|
118
|
+
`withruntime.blaxel` runs code written for Blaxel's Python SDK (`blaxel`
|
|
119
|
+
0.4.11) on Runtime. Change the import and set `RUNTIME_API_KEY`, or run
|
|
120
|
+
`npx withruntime login` once:
|
|
121
|
+
|
|
122
|
+
```python no-run
|
|
123
|
+
from withruntime.blaxel import SandboxInstance # was: from blaxel.core import SandboxInstance
|
|
124
|
+
from withruntime.blaxel import SyncSandboxInstance # was: from blaxel.core import SyncSandboxInstance
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`withruntime.blaxel.core` holds the same names, so replacing `blaxel.` with
|
|
128
|
+
`withruntime.blaxel.` works too. A Runtime key in `BL_API_KEY` is used; a
|
|
129
|
+
Blaxel key is never sent anywhere.
|
|
130
|
+
|
|
131
|
+
How it maps:
|
|
132
|
+
|
|
133
|
+
- **Sandboxes.** `create`, `create_if_not_exists` (one sandbox when two calls
|
|
134
|
+
race), `get`, `get_by_external_id`, `list`, `delete`, `fork`, `snapshots` and
|
|
135
|
+
the `update_*` calls work. `memory` is kept, with one vCPU for every 2048 MB.
|
|
136
|
+
Blaxel's general templates (`blaxel/base-image`, `py-app`, `ts-app`, `node`,
|
|
137
|
+
`jupyter-server`, `docker-in-sandbox`) run on Runtime's image. Any other
|
|
138
|
+
image `ns/name:tag` starts from the ready Runtime image `ns-name:tag`
|
|
139
|
+
(every `/` becomes `-`; the tag is `latest` when none is given), so the
|
|
140
|
+
code keeps Blaxel's image string. A missing one raises `NotSupportedError`
|
|
141
|
+
with the build command, for example `npx withruntime image build
|
|
142
|
+
--dockerfile Dockerfile --name my-company-agent-image -t
|
|
143
|
+
my-company-agent-image:latest`. Volumes mount Runtime volumes of the same
|
|
144
|
+
name. On the free trial a sandbox has at most 4096 MB of memory (2 vCPUs).
|
|
145
|
+
- **Standby.** A sandbox pauses after a minute with no call (Blaxel: about 15
|
|
146
|
+
seconds). It keeps its memory and processes, and wakes on the next command,
|
|
147
|
+
file call or preview visit. `archive` pauses it and keeps its memory too.
|
|
148
|
+
A lease in use is renewed, so a long command is not paused at the hour.
|
|
149
|
+
`keep_alive` raises the idle pause to the process's time limit, or turns it
|
|
150
|
+
off for a process with none. The first call from any client that finds no
|
|
151
|
+
`keep_alive` process running gives the old idle pause back.
|
|
152
|
+
- **How long it is kept.** A paused sandbox with no `ttl` or `lifecycle` is
|
|
153
|
+
kept 365 days. Blaxel keeps it until you delete it. A limit is rounded up to
|
|
154
|
+
whole days of pause. A limit of an hour or less that counts from creation
|
|
155
|
+
also ends the sandbox at that time. On the free trial a paused sandbox is kept
|
|
156
|
+
seven days, the most Blaxel's first tier keeps one.
|
|
157
|
+
- **Envs** reach every process, from any client: they are kept on the
|
|
158
|
+
sandbox, and a process's own `env` wins.
|
|
159
|
+
- **Paths.** `/blaxel`, Blaxel's working directory and `HOME`, is
|
|
160
|
+
`/workspace`. Relative paths and `~` start there.
|
|
161
|
+
- **Processes.** You can find a process by name from any client, as long as
|
|
162
|
+
Runtime still has its record. Runtime keeps the running processes and the
|
|
163
|
+
last 16 that ended.
|
|
164
|
+
- **Previews** are Runtime previews of each port. A private preview's
|
|
165
|
+
`tokens.create(expires_at)` gives a token, which works as Blaxel's
|
|
166
|
+
`X-Blaxel-Preview-Token` header or `bl_preview_token` address parameter.
|
|
167
|
+
`fetch(port)` uses a private preview for you.
|
|
168
|
+
- **Code interpreter.** `CodeInterpreter.run_code` and `create_code_context`
|
|
169
|
+
run on Runtime's interpreter and return Blaxel's result classes.
|
|
170
|
+
- **Errors.** Errors keep Blaxel's classes: `SandboxAPIError`,
|
|
171
|
+
`ResponseError` and `SnapshotAPIError`. Each also carries Runtime's `code`,
|
|
172
|
+
`hint` and `request_id`.
|
|
173
|
+
- **Runtime fields.** `runtime_create={...}` passes Runtime's own create
|
|
174
|
+
fields, for example `{"funding": "trial"}`. `sandbox.withruntime` is the
|
|
175
|
+
Runtime sandbox underneath.
|
|
176
|
+
|
|
177
|
+
Differences you can hit:
|
|
178
|
+
|
|
179
|
+
- Commands run as root, as on Blaxel, with the sandbox's `PATH` and `HOME`
|
|
180
|
+
(`/workspace`). File calls act as the sandbox user and fall back to `sudo`
|
|
181
|
+
where only root may: they reach files a root process made, including private
|
|
182
|
+
ones, and a file they write is the sandbox user's.
|
|
183
|
+
- A key sees the sandboxes it made, and another key's answer 404, unless an
|
|
184
|
+
owner or admin makes the key account-wide, as a Blaxel workspace key is
|
|
185
|
+
([teams](https://withruntime.com/docs/teams#keys-in-a-team)).
|
|
186
|
+
- Public previews need a paid sandbox.
|
|
187
|
+
- A process's `pid` is Runtime's process id, not an operating-system number.
|
|
188
|
+
|
|
189
|
+
These raise `NotSupportedError` before anything happens, naming what to use:
|
|
190
|
+
regions outside the US, read-only and ephemeral volumes, drives, `extra_args`
|
|
191
|
+
other than `iptables`, egress and subnet settings, preview headers, custom
|
|
192
|
+
domains and preview expiry, restoring a snapshot in place (fork from it
|
|
193
|
+
instead), sessions, codegen, `system`, schedules, and Blaxel's agents, models,
|
|
194
|
+
tools, jobs and applications. The sync module is generated from the async one
|
|
195
|
+
by `scripts/generate_dropin_sync.py`.
|
|
196
|
+
|
|
113
197
|
## Agent frameworks
|
|
114
198
|
|
|
115
199
|
`withruntime.openai_agents` is a sandbox client for the OpenAI Agents SDK's
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "withruntime"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.8.2"
|
|
8
8
|
description = "Runtime Cloud: one client (sync and async) for every Runtime product. Sandboxes first."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "Apache-2.0" }
|