Deploying ZenML in a container.
zenml up
, the server and the local ZenML client share the same SQLite database.
The rest of this guide is addressed to advanced users who are looking to manually deploy and manage a containerized ZenML server.
default
.
default
.
ZENML_STORE_URL
points to a MySQL database that uses SSL secured connections. The variable can be set either to the path where the certificate file is mounted inside the container or to the certificate contents themselves.
ZENML_STORE_URL
points to a MySQL database that uses SSL secured connections and requires client SSL certificates. The variable can be set either to the path where the certificate file is mounted inside the container or to the certificate contents themselves. This variable also requires ZENML_STORE_SSL_KEY
to be set.
ZENML_STORE_URL
points to a MySQL database that uses SSL secured connections and requires client SSL certificates. The variable can be set either to the path where the certificate file is mounted inside the container or to the certificate contents themselves. This variable also requires ZENML_STORE_SSL_CERT
to be set.
ZENML_STORE_URL
points to a MySQL database that uses SSL secured connections. Defaults to False
.
NOTSET
, ERROR
, WARN
, INFO
(default), DEBUG
or CRITICAL
.
ZENML_STORE_*
variables are set, the container will default to creating and using a SQLite database file stored at /zenml/.zenconfig/local_stores/default_zen_store/zenml.db
inside the container. The /zenml/.zenconfig/local_stores
base path where the default SQLite database is located can optionally be overridden by setting the ZENML_LOCAL_STORES_PATH
environment variable to point to a different path (e.g. a persistent volume or directory that is mounted from the host).
zenmldocker/zenml-server:0.21.1
instead of zenmldocker/zenml-server
).docker rm
.
You can visit the ZenML dashboard at http://localhost:8080 or connect your client to the server with the default
username and empty password:
localhost
URL will not work if you are using Docker based ZenML
orchestrators in your stack. In this case, you need to use an IP address that
is reachable from other
containers
instead of localhost
when you connect your client to the server, e.g.:docker logs zenml
to view the server logsdocker stop zenml
to stop the serverdocker start zenml
to start the server againdocker rm zenml
to remove the containerdocker run
--env
or --env-file
arguments (see the Docker documentation for more details). For example:
--mount
flag (see the Docker documentation for more details). For example:
docker rm
. However, it still suffers from the limitations incurred by using a SQLite database backend (see the earlier warning). The recommended way to deploy a containerized ZenML server is to use a MySQL database backend instead, as described in the next section.
--mount
flag, e.g.:
ZENML_STORE_URL
environment variable. We use the special host.docker.internal
DNS name resolved from within the Docker containers to the gateway IP address used by the Docker network (see the Docker documentation for more details). On Linux, this needs to be explicitly enabled in the docker run
command with the --add-host
argument:
zenml connect
command:
localhost
hostname will not work with MySQL databases. You need to use
the 127.0.0.1
IP address instead.docker-compose.yml
file like the one below can be used to start and manage the ZenML server container and the MySQL database service all at once:
ZENML_STORE_URL
is set to the special Docker host.docker.internal
hostname to instruct the server to connect to the database over the Docker network. The ZenML client knows how to handle the host.docker.internal
hostname differently depending on whether it is running on the host machine or in another Docker container.extra_hosts
section is needed on Linux to make the host.docker.internal
hostname resolvable from the ZenML server container.ZENML_DEFAULT_USERNAME
and ZENML_DEFAULT_PASSWORD
environment variables to customize the default account credentials.docker-compose.yml
file is located:
localhost
port (if running locally) or through some other service that exposes your container to the internet.
zenml up --docker
CLI command to deploy the Docker ZenML server, you can check the logs with the command:
docker run
command to manually deploy the Docker ZenML server, you can check the logs with the command:
docker compose
command to manually deploy the Docker ZenML server, you can check the logs with the command: