How to configure MLOps tooling and infrastructure with stacks
Machine learning in production is not just about designing and training models. It is a fractured space consisting of a wide variety of tasks ranging from experiment tracking to orchestration, from model deployment to monitoring, from drift detection to feature stores and much, much more than that. Even though there are already some seemingly well-established solutions for these tasks, it can become increasingly difficult to establish a running production system in a reliable and modular manner once all these solutions are brought together.
This is a problem which is especially critical when switching from a research setting to a production setting. Due to a lack of standards, the time and resources invested in proof of concepts frequently go completely to waste, because the initial system can not easily be transferred to a production-grade setting.
At ZenML, we believe that this is one of the most important and challenging problems in the field of MLOps, and it can be solved with a set of standards and well-structured abstractions. Owing to the nature of MLOps, it is essential that these abstractions not only cover concepts such as pipelines and steps but also the infrastructure elements on which the pipelines run.
Taking this into consideration, ZenML provides additional abstractions that help you simplify infrastructure configuration and management:
Let's discuss each in further detail:
In ZenML, a Stack represents a set of configurations for your MLOps tools and infrastructure. For instance, you might want to:
Running your pipeline in the cloud
Any such combination of tools and infrastructure can be registered as a separate stack in ZenML. Since ZenML code is tooling-independent, you can switch between stacks with a single command and then automatically execute your ML workflows on the desired stack without having to modify your code.
By default, every ZenML project that you create already come with an initial active
defaultstack. If you followed the code examples in the Steps and Pipelines section, then you have already used this stack implicitly to run all of your pipelines.
This stack features two stack components:
Speaking of stack components...
For instance, each ZenML stack (e.g. the default stack above) includes an Orchestrator which is responsible for the execution of the steps within your pipeline, an Artifact Store which is responsible for storing the artifacts generated by your pipelines.
The specific tool you are using is called a Flavor of the stack component. E.g., Kubeflow is a flavor of the Orchestrator stack component category.
You can see a list of all your registered stacks with the following command:
zenml stack list
Similarly, you can see all registered stack components of a specific type using
zenml <STACK_COMPONENT_CATEGORY> list, e.g.:
zenml orchestrator list
In order to see all the available flavors for a specific stack component use
zenml <STACK_COMPONENT_CATEGORY> flavor list, e.g.:
zenml orchestrator flavor list
You can also see details of configuration parameters available for a flavor with
zenml <STACK_COMPONENT_CATEGORY> flavor describe <FLAVOR>, e.g.:
zenml orchestrator flavor describe kubeflow