initializing zenml at the root of your repository.If ZenML does not find an initialized ZenML repository in any parent directory, it will default to the current working directory, but usually, it's better to not have to rely on this mechanism and initialize zenml at the root.

Afterward, you should see the new custom alerter flavor in the list of available alerter flavors:

zenml alerter flavor list

It is important to draw attention to when and how these abstractions are coming into play in a ZenML workflow.

The MyAlerterFlavor class is imported and utilized upon the creation of the custom flavor through the CLI.

The MyAlerterConfig class is imported when someone tries to register/update a stack component with the my_alerter flavor. Especially, during the registration process of the stack component, the config will be used to validate the values given by the user. As Config objects are inherently pydantic objects, you can also add your own custom validators here.

The MyAlerter only comes into play when the component is ultimately in use.

The design behind this interaction lets us separate the configuration of the flavor from its implementation. This way we can register flavors and components even when the major dependencies behind their implementation are not installed in our local setting (assuming the MyAlerterFlavor and the MyAlerterConfig are implemented in a different module/path than the actual MyAlerter).

PreviousSlack Alerter

NextImage Builders

Last updated 19 days ago