DockerProvider
Launches applications as Docker containers on the local daemon.
Attributes
attributeclient= get_docker_client()Functions
constructor__init__(app_config) -> NoneCreate a provider bound to the shared Docker client.
paramapp_configdict[str, Any]Resolved application dictionary.
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.
paramimage_namestrImage reference.
Returns
typing.AnyThe pulled image object.
funclaunch(session_id, env_vars, volumes=None, gpu_config=None, network=None, is_collaboration=False, master_token=None, initial_tokens=None) -> dict[str, Any]Run the application container and wait until it answers HTTP.
See launch for the arguments.
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= NoneReturns
dict[str, typing.Any]funcstop(instance_id) -> NoneStop (and remove) a container.
paraminstance_idstrContainer id.
Returns
Nonefunc_wait_for_container_ready(container, session_id, subfolder, env_vars, timeout=60, is_collaboration=False, master_token=None, initial_tokens=None) -> strPoll the container until its web endpoint answers.
paramcontainerAnyDocker container object.
paramsession_idstrSession id for log prefixes.
paramsubfolderstrURL prefix the app serves under.
paramenv_varsdict[str, str]Environment used to derive the basic-auth credentials.
paramtimeoutint= 60Seconds to wait before giving up.
paramis_collaborationbool= FalseAlso post the initial tokens to the control plane.
parammaster_tokenstr | None= NoneControl-plane master token.
paraminitial_tokensdict[str, Any] | None= NoneTokens to post.
Returns
strThe container's IP address.
func_get_container_ip(container_attrs) -> str | NoneExtract the first usable IP address from container attributes.
paramcontainer_attrsdict[str, Any]Returns
str | None