artifact-store-flavor>  <- Config class and flavor└── __init_.py                          <- Integration class

3. Define the name of your integration in constants

In zenml/integrations/constants.py, add:

EXAMPLE_INTEGRATION = "<name-of-integration>"

This will be the name of the integration when you run:

zenml integration install <name-of-integration>

4. Create the integration class __init__.py

In src/zenml/integrations/<YOUR_INTEGRATION>/init__.py you must now create a new class, which is a subclass of the Integration class, set some important attributes (NAME and REQUIREMENTS), and overwrite the flavors class method.

from zenml.integrations.constants import <EXAMPLE_INTEGRATION>

from zenml.integrations.integration import Integration

from zenml.stack import Flavor

# This is the flavor that will be used when registering this stack component

#  `zenml <type-of-stack-component> register ... -f example-orchestrator-flavor`

EXAMPLE_ORCHESTRATOR_FLAVOR = <"example-orchestrator-flavor">

# Create a Subclass of the Integration Class

class ExampleIntegration(Integration):

"""Definition of Example Integration for ZenML."""

NAME = <EXAMPLE_INTEGRATION>

REQUIREMENTS = ["<INSERT PYTHON REQUIREMENTS HERE>"]

@classmethod

def flavors(cls) -> List[Type[Flavor]]:

"""Declare the stack component flavors for the <EXAMPLE> integration."""

from zenml.integrations.<example_flavor> import <ExampleFlavor>

return [<ExampleFlavor>]

ExampleIntegration.check_installation() # this checks if the requirements are installed

Have a look at the MLflow Integration as an example for how it is done.

5. Import in all the right places

The Integration itself must be imported within src/zenml/integrations/__init__.py.

Step 4: Create a PR and celebrate 🎉

You can now create a PR to ZenML and wait for the core maintainers to take a look. Thank you so much for your contribution to the codebase, rock on! 💜

PreviousImplement a custom stack component

NextConfigure Python environments

Last updated 15 days ago