wfexs_backend.utils.docker#

Module Contents#

Classes#

API#

exception wfexs_backend.utils.docker.DockerHelperException#

Bases: Exception

class wfexs_backend.utils.docker.Credentials#

Bases: typing.NamedTuple

domain: str | None = None#
username: str | None = None#
password: str | None = None#
class wfexs_backend.utils.docker.DockerTagMetadata#

Bases: typing.NamedTuple

registryServer: str = None#
repo: str = None#
alias: str = None#
manifest: Mapping[str, Any] = None#
partial_fingerprint: str = None#
class wfexs_backend.utils.docker.DXFFat(host: str, repo: str, auth: Optional[Callable[[dxf.DXFBase, requests.Response], None]] = None, insecure: bool = False, auth_host: Optional[str] = None, tlsverify: Union[bool, str] = True, timeout: Optional[float] = None)#

Bases: dxf.DXF

get_fat_manifest_and_response(alias: str, http_method: str = 'get') Tuple[str, requests.Response]#

Request the “fat” manifest for an alias, which returns the list of all the available architectures, and returns the manifest and the response.

Parameters:

alias (str) – Alias name.

Return type:

tuple

Returns:

Tuple containing the “fat” manifest as a string (JSON)

and the requests.Response

get_parsed_manifest_and_dcd(alias: str) Tuple[Mapping[str, Any], str] | Tuple[None, None]#
get_fat_manifest_and_dcd(alias: str, http_method: str = 'get') Tuple[str, str | None]#

Request the “fat” manifest for an alias, which returns the list of all the available architectures, and returns the manifest and the response.

Parameters:

alias (str) – Alias name.

Return type:

tuple

Returns:

Tuple containing the “fat” manifest as a string (JSON)

and the dcd

get_fat_manifest(alias: str) str#

Get the “fat” manifest for an alias

Parameters:

alias (str) – Alias name.

Return type:

str

Returns:

The “fat” manifest as string (JSON)

class wfexs_backend.utils.docker.DockerHelper#

Bases: abc.ABC

DEFAULT_DOCKER_REGISTRY: Final[str] = 'docker.io'#
DOCKER_REGISTRY: Final[str] = 'registry-1.docker.io'#
DEFAULT_ALIAS: Final[str] = 'latest'#
add_creds(username: str, password: str, domain: str | None = None) None#
choose_domain(domain_name: str | None = None) None#
_auth(dxf: dxf.DXFBase, response: requests.Response) None#

Helper method for DXF machinery

query_tag(tag: str) DockerTagMetadata | None#