DockerProvider
Launches applications as Docker containers on the local daemon.
Attributes
attributeclientAnyThe shared Docker client.
Functions
funcinspect_self() -> NoneMap the server container's mounts, ports, and network (see inspect_self_container).
Returns
Nonefuncdetect_gpus() -> NoneOffer the host's render nodes; NVIDIA ones carry their device index.
Returns
Nonefuncrefresh_gpus() -> NoneKeep the render nodes found at startup.
Returns
Nonefuncget_local_image_info(image_name) -> dict[str, Any] | NoneReturn id and digests of a locally available image.
paramimage_namestrImage reference.
Returns
dict[str, Any] | None{"id", "short_id", "digests"} or None when not present.
funcget_remote_image_digest(image_name) -> str | NoneReturn the digest the registry currently serves for an image.
paramimage_namestrImage reference.
Returns
str | NoneThe registry digest, or None if it could not be determined.
funcpull_image(image_name) -> AnyPull an image from its registry, or its mirror, with the node's credential for it.
paramimage_namestrImage reference.
Returns
typing.AnyThe pulled image object.
funcprune_images() -> NoneRemove dangling images left behind by pulls.
Returns
Nonefuncexport_web_client(image, path) -> bytesCopy path out of a container of the image that never starts (see BaseProvider).
The archive comes through Docker's copy API, as docker cp takes
it: a container's logs are not binary-safe, so nothing is run.
paramimagestrparampathstrReturns
bytesfunclaunch(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]Run the application container and wait until it answers HTTP.
See BaseProvider.launch for the arguments; volume keys are server
paths and are translated to host paths here. With vpn, the
container resolves names at the gateway and, once started, has its
default route pointed at it by the helper (_route_through).
paramsession_idstrparamenv_varsdict[str, str]paramvolumesdict[str, Any] | None= Noneparamgpu_configdict[str, Any] | None= Noneparamnetworkstr | None= Noneparamis_collaborationbool= Falseparammaster_tokenstr | None= Noneparaminitial_tokensdict[str, Any] | None= Noneparamvpndict[str, Any] | None= NoneReturns
dict[str, typing.Any]func_route_through(session_id, container_id, gateway_ip) -> NonePoint a container's default route at its VPN gateway.
The helper is the gateway image run in the container's network
namespace with NET_ADMIN, which the container itself never gets;
the route it sets outlives it.
paramsession_idstrparamcontainer_idstrparamgateway_ipstrReturns
Nonefuncstop(instance_id) -> NoneStop (and remove) a container.
paraminstance_idstrContainer id.
Returns
Nonefuncis_running(instance_id) -> boolTell whether a container still exists and has not exited.
paraminstance_idstrReturns
boolfuncmanaged_instances() -> dict[str, float]Return this server's labelled containers with their creation times.
Returns
dict[str, float]func_get_container_ip(container_attrs) -> str | NoneExtract the first usable IP address from container attributes.
paramcontainer_attrsdict[str, Any]Returns
str | None