cocoonstack-sandbox 0.1.24__tar.gz → 0.1.25__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.
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/PKG-INFO +1 -1
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonsandbox/client.py +10 -11
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonsandbox/conn.py +5 -5
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonsandbox/sandbox.py +1 -1
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonstack_sandbox.egg-info/PKG-INFO +1 -1
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/pyproject.toml +1 -1
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/LICENSE +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/README.md +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonsandbox/__init__.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonsandbox/checkpoint.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonsandbox/endpoint.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonsandbox/errors.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonsandbox/frames.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonsandbox/py.typed +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonsandbox/template.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonsandbox/volumes.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonstack_sandbox.egg-info/SOURCES.txt +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonstack_sandbox.egg-info/dependency_links.txt +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonstack_sandbox.egg-info/top_level.txt +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/setup.cfg +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_checkpoint.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_client.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_endpoint.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_fault_matrix.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_fixtures.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_frames.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_hardening.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_keepalive.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_packaging.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_proc.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_proxy.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_stream.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_upgrade.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_volume_controller.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_volumes.py +0 -0
- {cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/tests/test_wire_binding.py +0 -0
|
@@ -96,11 +96,12 @@ class Client(_Closeable):
|
|
|
96
96
|
)
|
|
97
97
|
return Sandbox(client=self, id=id, token=token, owner=reply.get("owner_addr") or addr)
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
peers, peers_err = self._peers()
|
|
100
100
|
try:
|
|
101
|
-
return _scatter(
|
|
101
|
+
return _scatter([self.addr, *peers], probe)
|
|
102
102
|
except APIError:
|
|
103
|
-
|
|
103
|
+
reason = f"no owner found for {id}" if peers_err is None else f"no owner found for {id}; {peers_err}"
|
|
104
|
+
raise APIError("lookup", 404, reason) from None
|
|
104
105
|
|
|
105
106
|
def attach(self, owner_addr: str, id: str, token: str) -> Sandbox:
|
|
106
107
|
"""Binds a handle to a known owner without a lookup."""
|
|
@@ -176,16 +177,14 @@ class Client(_Closeable):
|
|
|
176
177
|
owner, reply = _redirect_fallback(addr, redirect, post, verb)
|
|
177
178
|
return self._handle_from(owner, reply, verb)
|
|
178
179
|
|
|
179
|
-
def _peers(self) -> list[str]:
|
|
180
|
+
def _peers(self) -> tuple[list[str], APIError | None]:
|
|
180
181
|
try:
|
|
181
|
-
|
|
182
|
-
self.
|
|
183
|
-
self.addr, "GET", "/v1/peers", None, "peers", timeout=min(_PEERS_TIMEOUT, self.timeout)
|
|
184
|
-
).get("peers")
|
|
185
|
-
or []
|
|
182
|
+
reply = self._request(
|
|
183
|
+
self.addr, "GET", "/v1/peers", None, "peers", timeout=min(_PEERS_TIMEOUT, self.timeout)
|
|
186
184
|
)
|
|
187
|
-
except APIError:
|
|
188
|
-
return []
|
|
185
|
+
except APIError as exc:
|
|
186
|
+
return [], exc
|
|
187
|
+
return reply.get("peers") or [], None
|
|
189
188
|
|
|
190
189
|
def _handle_from(self, dialed: str, reply: dict[str, Any], verb: str = "claim") -> Sandbox:
|
|
191
190
|
return Sandbox(
|
|
@@ -203,11 +203,6 @@ def dial_agent(
|
|
|
203
203
|
except OSError as exc:
|
|
204
204
|
err = _handshake_error(f"dial {addr}", exc)
|
|
205
205
|
raise (_mark_gone(err, tag) if isinstance(exc, ConnectionRefusedError) else err) from exc
|
|
206
|
-
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
|
207
|
-
sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
|
|
208
|
-
for opt, setting in _TCP_KEEPALIVE.items():
|
|
209
|
-
if hasattr(socket, opt):
|
|
210
|
-
sock.setsockopt(socket.IPPROTO_TCP, getattr(socket, opt), setting)
|
|
211
206
|
request = (
|
|
212
207
|
f"GET /v1/sandboxes/{sandbox_id}/agent HTTP/1.1\r\n"
|
|
213
208
|
f"Host: {endpoint.netloc}\r\n"
|
|
@@ -218,6 +213,11 @@ def dial_agent(
|
|
|
218
213
|
).encode()
|
|
219
214
|
reader = None
|
|
220
215
|
try:
|
|
216
|
+
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
|
217
|
+
sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
|
|
218
|
+
for opt, setting in _TCP_KEEPALIVE.items():
|
|
219
|
+
if hasattr(socket, opt):
|
|
220
|
+
sock.setsockopt(socket.IPPROTO_TCP, getattr(socket, opt), setting)
|
|
221
221
|
if endpoint.scheme != "https":
|
|
222
222
|
sock.settimeout(None)
|
|
223
223
|
return Conn(sock, _buffered_reader(sock), request, timeout, tag)
|
|
@@ -306,7 +306,7 @@ class Sandbox:
|
|
|
306
306
|
return [f for f in conn.recv_until("done") if f["type"] == "replaced"]
|
|
307
307
|
|
|
308
308
|
def git_clone(self, url: str, path: str, branch: str = "", depth: int = 0, auth: str = "") -> None:
|
|
309
|
-
"""Clones into path
|
|
309
|
+
"""Clones into path, shallow when depth is set; auth rides an in-memory header."""
|
|
310
310
|
self._done_rpc("git_clone", url=url, path=path, branch=branch or None, depth=depth or None, auth=auth or None)
|
|
311
311
|
|
|
312
312
|
def git_status(self, path: str) -> dict[str, Any]:
|
|
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
|
{cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonstack_sandbox.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{cocoonstack_sandbox-0.1.24 → cocoonstack_sandbox-0.1.25}/cocoonstack_sandbox.egg-info/top_level.txt
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
|
|
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
|