solari-runloop-compat 0.2.3__tar.gz → 0.2.4__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.
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/COMPAT.md +1 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/PKG-INFO +1 -1
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/pyproject.toml +1 -1
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/__init__.py +1 -1
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_vendor_user.py +11 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/.gitignore +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/LICENSE +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/NOTICE +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/README.md +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_branding.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_client.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_config.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_context.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_dockerfile.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_exceptions.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_gateway.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_loop.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_mapping.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_models.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_redact.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_resources.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/_sync.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/lib/__init__.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/lib/polling.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/pagination.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/sdk.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/__init__.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/blueprint_build_log.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/blueprint_build_logs_list_view.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/blueprint_build_parameters.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/blueprint_view.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devbox_async_execution_detail_view.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devbox_execution_detail_view.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devbox_snapshot_list_view.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devbox_snapshot_view.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devbox_view.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devboxes/__init__.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devboxes/devbox_logs_list_view.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/secret_view.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/__init__.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/after_idle.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/code_mount_parameters.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/launch_parameters.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/lifecycle_configuration.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/lifecycle_hooks.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/resume_triggers.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/tunnel_view.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/run_runloop_examples.sh +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_config.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_context.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_dockerfile.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_gateway_wire.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_live_staging.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_mapping.py +0 -0
- {solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/tests/test_surface.py +0 -0
|
@@ -138,6 +138,7 @@ asks the gateway for exactly that at create time (`user: "user"`, `cwd: "/home/u
|
|
|
138
138
|
sudo). Restores from a snapshot keep the snapshot's own user.
|
|
139
139
|
- **Gateway that predates `user` / `cwd`** (it answers 400 naming them, or ignores them): the plain create is used and the sandbox runs as **root in
|
|
140
140
|
`/home/root`**, which is what this package did before. Check `whoami` if code depends on it.
|
|
141
|
+
- **Template or snapshot made before user support** (the server answers 400 naming `user`): the plain create is used, the sandbox runs as **root**, and one warning says so. Rebuild templates and snapshots to get the vendor user.
|
|
141
142
|
- Shared isolation is commands and code only and takes no `user` / `cwd`; the compat packages never create shared sandboxes. (Runloop's own docs: the default user is `user` with home `/home/user`.)
|
|
142
143
|
|
|
143
144
|
## Snapshots and output (0.2.2)
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "solari-runloop-compat"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.4"
|
|
8
8
|
description = "Runloop-compatible Python interface over Solari Sandboxes. Not affiliated with Runloop."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import re
|
|
6
|
+
import warnings
|
|
6
7
|
from typing import Any
|
|
7
8
|
|
|
8
9
|
from solari_core.errors import GatewayError
|
|
@@ -17,6 +18,15 @@ def _refuses_user_fields(e: BaseException) -> bool:
|
|
|
17
18
|
return isinstance(e, GatewayError) and e.status == 400 and re.search(r"\b(user|cwd)\b", repr(getattr(e, "body", None)), re.I) is not None
|
|
18
19
|
|
|
19
20
|
|
|
21
|
+
def _warn_root() -> None:
|
|
22
|
+
warnings.warn(
|
|
23
|
+
"solari-runloop-compat: the server or this template's image predates user support, so the sandbox runs as root instead of 'user'. "
|
|
24
|
+
"Rebuild templates and snapshots made before user support shipped to get the vendor user.",
|
|
25
|
+
RuntimeWarning,
|
|
26
|
+
stacklevel=4,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
20
30
|
async def create_as_vendor_user(solari: Any, **opts: Any) -> Any:
|
|
21
31
|
"""``solari.create(**opts)`` with ``user`` / ``cwd`` set to Runloop's defaults. A gateway that predates them (it answers 400
|
|
22
32
|
naming them) gets the plain create, and the sandbox runs as root there (COMPAT.md). Restores from a snapshot keep the
|
|
@@ -31,4 +41,5 @@ async def create_as_vendor_user(solari: Any, **opts: Any) -> Any:
|
|
|
31
41
|
raise
|
|
32
42
|
if explicit: # the default user is best effort on a gateway that predates user/cwd; a user the caller named is not
|
|
33
43
|
raise SolariCompatUnsupported("user_parameters", "this gateway cannot create sandboxes as another user yet") from e
|
|
44
|
+
_warn_root()
|
|
34
45
|
return await solari.create(**opts)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/blueprint_view.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/devbox_view.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/secret_view.py
RENAMED
|
File without changes
|
{solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/shared/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{solari_runloop_compat-0.2.3 → solari_runloop_compat-0.2.4}/solari_runloop/types/tunnel_view.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|