Docker Deployer

Deploying your pipelines locally with Docker.

The Docker deployer is a deployer flavor that comes built-in with ZenML and deploys your pipelines locally using Docker.

When to use it

You should use the Docker deployer if:

  • you need a quick and easy way to deploy your pipelines locally.

  • you want to debug issues that happen when deploying your pipeline in Docker containers without waiting and paying for remote infrastructure.

  • you need an easy way to test out how pipeline deployments work

How to deploy it

To use the Docker deployer, you only need to have Dockerarrow-up-right installed and running.

How to use it

To use the Docker deployer, you can register it and use it in your active stack:

zenml deployer register docker --flavor=docker

# Register and activate a stack with the new deployer
zenml stack register docker-deployer -D docker -o default -a default --set
circle-info

ZenML will build a local Docker image called zenml:<PIPELINE_NAME> and use it to deploy your pipeline as a Docker container. Check out this pagearrow-up-right if you want to learn more about how ZenML builds these images and how you can customize them.

You can now deploy any ZenML pipelinearrow-up-right using the Docker deployer:

Additional configuration

For additional configuration of the Docker deployer, you can pass the following DockerDeployerSettings attributes defined in the zenml.deployers.docker.docker_deployer module when configuring the deployer or defining or deploying your pipeline:

  • Basic settings common to all Deployers:

    • auth_key: A user-defined authentication key to use to authenticate with deployment API calls.

    • generate_auth_key: Whether to generate and use a random authentication key instead of the user-defined one.

    • lcm_timeout: The maximum time in seconds to wait for the deployment lifecycle management to complete.

  • Docker-specific settings:

    • port: The port to expose the deployment on.

    • allocate_port_if_busy: If True, allocate a free port if the configured port is busy.

    • port_range: The range of ports to search for a free port.

    • run_args: Arguments to pass to the docker run call. A full list of what can be passed in via the run_args can be found in the Docker Python SDK documentationarrow-up-right.

Check out this docs pagearrow-up-right for more information on how to specify settings.

For example, if you wanted to specify the port to use for the deployment, you would configure settings as follows:

Last updated

Was this helpful?