Deploying ZenML
Deploying ZenML is the first step to production.
When you first get started with ZenML, it is based on the following architecture on your machine:
![](https://docs.zenml.io/~gitbook/image?url=https%3A%2F%2F3985712949-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MCl0MaN3pJfPa2vq2Rb%252Fuploads%252Fgit-blob-a4052b6d7361c397b05c03ddfd5418b4f4eef402%252FScenario1.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=25097cae&sv=1)
The SQLite database that you can see in this diagram is used to store all the metadata we produced in the previous guide (pipelines, models, artifacts, etc).
In order to move into production, you will need to deploy this server somewhere centrally outside of your machine. This allows different infrastructure components to interact with, alongside enabling you to collaborate with your team members:
![](https://docs.zenml.io/~gitbook/image?url=https%3A%2F%2F3985712949-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-MCl0MaN3pJfPa2vq2Rb%252Fuploads%252Fgit-blob-56404adbd14c296997b8a76ba39e0796ba77c37a%252FScenario3.2.png%3Falt%3Dmedia&width=768&dpr=4&quality=100&sign=fae09027&sv=1)
Choosing how to deploy ZenML
While there are many options on how to deploy ZenML, the two simplest ones are:
Option 1: Sign up for a free ZenML Pro Trial
ZenML Pro comes as a managed SaaS solution that offers a one-click deployment for your ZenML server. Click here to start a free trial.
On top of the one-click SaaS experience, ZenML Pro also comes built-in with additional features and a new dashboard that might be beneficial to follow for this guide. You can always go back to self-hosting after your learning journey is complete.
Option 2: Self-host ZenML on your cloud provider
As ZenML is open source, it is easy to self-host it. There is even a ZenML CLI one-liner that deploys ZenML on a Kubernetes cluster, abstracting away all the infrastructure complexity. If you don't have an existing Kubernetes cluster, you can create it manually using the documentation for your cloud provider. For convenience, here are links for AWS, Azure, and GCP.
Once you have created your cluster, make sure that you configure your kubectl client to connect to it.
You're now ready to deploy ZenML! Run the following command:
You will be prompted to provide a name for your deployment and details like what cloud provider you want to deploy to, in addition to the username, password, and email you want to set for the default user — and that's it! It creates the database and any VPCs, permissions, and more that are needed.
In order to be able to run the deploy
command, you should have your cloud provider's CLI configured locally with permissions to create resources like MySQL databases and networks.
To learn more about different options for deploying ZenML, visit the deployment documentation.
Connecting to a deployed ZenML
You can connect your local ZenML client with the ZenML Server using the ZenML CLI and the web-based login. This can be executed with the command:
where SERVER_URL is the host address of your ZenML deployment (e.g. https://mydeployment.zenml.com
)
Having trouble connecting with a browser? There are other ways to connect. Read here for more details.
This command will start a series of steps to validate the device from where you are connecting that will happen in your browser. After that, you're now locally connected to a remote ZenML. Nothing of your experience changes, except that all metadata that you produce will be tracked centrally in one place from now on.
You can always go back to the local zenml experience by using zenml disconnect
![ZenML Scarf](https://docs.zenml.io/~gitbook/image?url=https%3A%2F%2Fstatic.scarf.sh%2Fa.png%3Fx-pxid%3Df0b4f458-0a54-4fcd-aa95-d5ee424815bc&width=768&dpr=4&quality=100&sign=55709a31&sv=1)
Last updated