DockerImage

class verta.registry.DockerImage(port, request_path, health_path, repository, tag=None, sha=None, env_vars=None)

Docker image information.

For use around RegisteredModelVersion.log_docker().

New in version 0.20.0.

Parameters
  • port (int) – Container port for access.

  • request_path (str) – URL path for routing predictions.

  • health_path (str) – URL path for container health checks.

  • repository (str) – Image repository.

  • tag (str, optional) – Image tag. Either this or sha must be provided.

  • sha (str, optional) – Image ID. Either this or tag must be provided.

  • env_vars (list of str, or dict of str to str, optional) – Environment variables. If a list of names is provided, the values will be captured from the current environment. If not provided, nothing will be captured.

Variables
  • port (int) – Container port for access.

  • request_path (str) – URL path for routing predictions.

  • health_path (str) – URL path for container health checks.

  • repository (str) – Image repository.

  • tag (str or None) – Image tag.

  • sha (str or None) – Image ID.

  • env_vars (dict of str to str, or None) – Environment variables.

Examples

from verta.registry import DockerImage

docker_image = DockerImage(
    port=5000,
    request_path="/predict_json",
    health_path="/health",

    repository="012345678901.dkr.ecr.apne2-az1.amazonaws.com/models/example",
    tag="example",

    env_vars={"CUDA_VISIBLE_DEVICES": "0,1"},
)