Deploy a stack using mlstacks

Deploying an entire stack with mlstacks.

mlstacks is a Python package that allows you to quickly spin up MLOps infrastructure using Terraform. It is designed to be used with ZenML, but can be used with any MLOps tool or platform. You can deploy a modular MLOps stack for AWS, GCP or K3D using mlstacks. Each deployment type is designed to offer a great deal of flexibility in configuring the resources while preserving the ease of application through the use of sensible defaults.

Check out the full documentation for the mlstacks package for more information.

When should I deploy something using mlstacks?

To answer this question, here are some pros and cons in comparison to the stack-component deploy method which can help you choose what works best for you!

Offers a lot of flexibility in what you deploy.

Deploying with mlstacks gives you a full MLOps stack as the output. Your components and stack is automatically imported to ZenML. This saves you the effort of manually registering all the components.

Currently only supports AWS, GCP, and K3D as providers.

Most stack deployments are Kubernetes-based which might be too heavy for your needs.

Not all stack components are supported yet.

Installing the mlstacks extra

To install mlstacks, either run pip install mlstacks or pip install "zenml[mlstacks]" to install it along with ZenML.

MLStacks uses Terraform on the backend to manage infrastructure. You will need to have Terraform installed. Please visit the Terraform docs for installation instructions.

MLStacks also uses Helm to deploy Kubernetes resources. You will need to have Helm installed. Please visit the Helm docs for installation instructions.

Deploying a stack

A simple stack deployment can be done using the following command:

zenml stack deploy -p aws -a -n basic -r eu-north-1 -x bucket_name=my_bucket -o sagemaker