SealSkin

BaseProvider

A backend that runs session instances and reports on its host.

Attributes

attributeorphan_gracefloat
= READY_TIMEOUT * 2

Seconds an unreferenced instance may belong to a launch still in progress before managed_instances callers remove it.

attributeapp_config
= app_config or {'provider_config': {}}

Functions

constructor__init__(app_config=None) -> None

Bind the provider to an application.

paramapp_configdict[str, Any] | None
= None

Resolved application dictionary (InstalledApp shape) including provider_config; omitted for host-level calls.

Returns

None
funclaunch(session_id, env_vars, volumes=None, gpu_config=None, network=None, is_collaboration=False, master_token=None, initial_tokens=None, vpn=None) -> dict[str, Any]

Launch an instance of the application and wait until it answers.

paramsession_idstr

Unique id of the session.

paramenv_varsdict[str, str]

Environment variables for the instance.

paramvolumesdict[str, Any] | None
= None

Server paths to mount, each to {"bind": <path in the instance>}.

paramgpu_configdict[str, Any] | None
= None

GPU descriptor from state.available_gpus.

paramnetworkstr | None
= None

Docker network to attach the instance to.

paramis_collaborationbool
= False

Whether this is a collaboration session.

parammaster_tokenstr | None
= None

Master token of the downstream control plane.

paraminitial_tokensdict[str, Any] | None
= None

Initial token set for the downstream control plane.

paramvpndict[str, Any] | None
= None

The gateway the instance leaves through, as vpn.acquire returns it, or None.

Returns

dict

{"instance_id": str, "ip": str, "port": int}.

funcstop(instance_id) -> None

Stop and remove an instance; a missing one is not an error.

paraminstance_idstr

Returns

None
funcis_running(instance_id) -> bool

Tell whether an instance still runs.

paraminstance_idstr

Returns

bool
funcmanaged_instances() -> dict[str, float]

Return the instances this server labelled, with their creation times.

Returns

dict[str, float]
funcinspect_self() -> None

Discover what the backend needs to know about the server's own container.

Returns

None
funcdetect_gpus() -> None

Fill state.available_gpus with the GPUs sessions can request.

Returns

None
funcrefresh_gpus() -> None

Bring state.available_gpus up to date before it is offered or used.

Returns

None
funcget_local_image_info(image_name) -> dict[str, Any] | None

Return {"id", "short_id", "digests"} of the image sessions run, or None.

paramimage_namestr

Returns

dict[str, typing.Any] | None
funcget_remote_image_digest(image_name) -> str | None

Return the digest the registry serves for an image now, or None.

paramimage_namestr

Returns

str | None
funcpull_image(image_name) -> Any

Make new sessions run the registry's current image.

paramimage_namestr

Returns

typing.Any
funcprune_images() -> None

Remove images no session can use any more.

Returns

None
funcregistry_credentials() -> dict[str, tuple[str, str]]

Return the username and password per registry host the backend holds beside the node's file.

Returns

dict[str, tuple[str, str]]
funcexport_web_client(image, path) -> bytes

Return path of the image as a tar stream, gzipped or not, from a throwaway instance of it.

The entries may sit under one directory, the exported one, or not. The instance runs nothing of the image, or tar alone, with no network and nothing mounted, and is gone when this returns.

paramimagestr

The image reference, as an application names it.

parampathstr

The directory inside the image to export.

Returns

bytes
func_wait_until_ready(session_id, current_ip, env_vars, is_collaboration=False, master_token=None, initial_tokens=None) -> str

Poll the instance's web endpoint until it answers, then seed a room's tokens.

paramsession_idstr

Session id for log prefixes.

paramcurrent_ipCallable[[], Awaitable[str | None]]

Returns the instance's address, None while it has none; raises HTTPException when the instance can no longer start.

paramenv_varsdict[str, str]

Environment the basic-auth credentials and subfolder come from.

paramis_collaborationbool
= False

Also post the initial tokens to the control plane.

parammaster_tokenstr | None
= None

Control-plane master token.

paraminitial_tokensdict[str, Any] | None
= None

Tokens to post.

Returns

str

The instance's IP address.