ZenML & MLStacks


It is not necessary to use the MLOps stacks recipes presented here alongside the ZenML framework, but it is highly recommended to do so. The ZenML framework is designed to be used with these recipes, and the recipes are designed to be used with ZenML.

The ZenML CLI has an integration with this package that makes it really simple to use and deploy these recipes. For more information, visit the ZenML documentation for more but a quick example is shown below.

# after installing ZenML
zenml stack deploy -p gcp -a -n basic -r us-east1 -t env=dev -x bucket_name=my-new-bucket -x project_id=zenml

This command will deploy a GCP artifact store to us-east1 region with a specific bucket name, project ID and tag, for example.

To learn more about ZenML and how it empowers you to develop a stack-agnostic MLOps solution, head over to the ZenML docs.

Importing mlstacks stacks into ZenML

The ZenML CLI also has a command to import stacks created with mlstacks into ZenML. All stacks created with mlstacks generate a .yaml file that can be imported into ZenML with the following command:

# after installing ZenML
zenml stack import -f <path-to-stack-file.yaml>

The path of the stack file can be found by navigating to the directory containing all the Terraform source files. You can easily find this by running the following command:

mlstacks source

This will print the path to the directory containing all the Terraform source and will ask you if you want to open the directory in your default file explorer. You can then navigate to the .yaml file and use that path to import it into ZenML as described above.

Last updated