How to develop a custom container registry
In the current version of ZenML, container registries have a rather basic base abstraction. In essence, their base configuration only features a uri
and their implementation features a non-abstract prepare_image_push
method for validation.
This is a slimmed-down version of the base implementation which aims to highlight the abstraction layer. In order to see the full implementation and get the complete docstrings, please check the API docs.
If you want to create your own custom flavor for a container registry, you can follow the following steps:
BaseContainerRegistry
class and if you need to execute any checks/validation before the image gets pushed, you can define these operations in the prepare_image_push
method. As an example, you can check the AWSContainerRegistry
.BaseContainerRegistryConfig
class.BaseContainerRegistryFlavor
class.Once you are done with the implementation, you can register it through the CLI as:
It is important to draw attention to when and how these base abstractions are coming into play in a ZenML workflow.
Config
object are inherently pydantic
objects, you can also add your own custom validators here.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 CustomContainerRegistryFlavor
and the CustomContainerRegistryConfig
are implemented in a different module/path than the actual CustomContainerRegistry
).
How to develop a custom container registry
In the current version of ZenML, container registries have a rather basic base abstraction. In essence, their base configuration only features a uri
and their implementation features a non-abstract prepare_image_push
method for validation.
This is a slimmed-down version of the base implementation which aims to highlight the abstraction layer. In order to see the full implementation and get the complete docstrings, please check the API docs.
If you want to create your own custom flavor for a container registry, you can follow the following steps:
BaseContainerRegistry
class and if you need to execute any checks/validation before the image gets pushed, you can define these operations in the prepare_image_push
method. As an example, you can check the AWSContainerRegistry
.BaseContainerRegistryConfig
class.BaseContainerRegistryFlavor
class.Once you are done with the implementation, you can register it through the CLI as:
It is important to draw attention to when and how these base abstractions are coming into play in a ZenML workflow.
Config
object are inherently pydantic
objects, you can also add your own custom validators here.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 CustomContainerRegistryFlavor
and the CustomContainerRegistryConfig
are implemented in a different module/path than the actual CustomContainerRegistry
).