Digitalocean
zenml.integrations.digitalocean
Initialization of the DigitalOcean integration.
The DigitalOcean integration provides ZenML stack component flavors for DigitalOcean services: Spaces (S3-compatible object storage) as an artifact store, and the DigitalOcean Container Registry (DOCR) as a container registry.
Orchestration, sandboxes, and step execution on DigitalOcean run on DigitalOcean
Kubernetes (DOKS) through the existing kubernetes flavors, so this
integration deliberately does not ship its own orchestrator/sandbox/step-operator
flavors.
Attributes
DIGITALOCEAN = 'digitalocean'
module-attribute
DIGITALOCEAN_CONTAINER_REGISTRY_FLAVOR = 'digitalocean'
module-attribute
DIGITALOCEAN_SPACES_ARTIFACT_STORE_FLAVOR = 'digitalocean'
module-attribute
Classes
DigitalOceanIntegration
Bases: Integration
Definition of the DigitalOcean integration for ZenML.
Methods:
flavors() -> List[Type[Flavor]]
classmethod
Declare the stack component flavors for the DigitalOcean integration.
Returns:
| Type | Description |
|---|---|
List[Type[Flavor]]
|
List of stack component flavors for this integration. |
Source code in src/zenml/integrations/digitalocean/__init__.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
Flavor
Class for ZenML Flavors.
Attributes
config_class: Type[StackComponentConfig]
abstractmethod
property
Returns StackComponentConfig config class.
Returns:
| Type | Description |
|---|---|
Type[StackComponentConfig]
|
The config class. |
config_schema: Dict[str, Any]
property
The config schema for a flavor.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The config schema. |
display_name: Optional[str]
property
The display name of the flavor.
By default, converts the technical name to a human-readable format. For example, "vm_kubernetes" becomes "VM Kubernetes". Flavors can override this to provide custom display names.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The display name of the flavor. |
docs_url: Optional[str]
property
A url to point at docs explaining this flavor.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
A flavor docs url. |
implementation_class: Type[StackComponent]
abstractmethod
property
Implementation class for this flavor.
Returns:
| Type | Description |
|---|---|
Type[StackComponent]
|
The implementation class for this flavor. |
logo_url: Optional[str]
property
A url to represent the flavor in the dashboard.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
The flavor logo. |
name: str
abstractmethod
property
The flavor name.
Returns:
| Type | Description |
|---|---|
str
|
The flavor name. |
sdk_docs_url: Optional[str]
property
A url to point at SDK docs explaining this flavor.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
A flavor SDK docs url. |
service_connector_requirements: Optional[ServiceConnectorRequirements]
property
Service connector resource requirements for service connectors.
Specifies resource requirements that are used to filter the available service connector types that are compatible with this flavor.
Returns:
| Type | Description |
|---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
type: StackComponentType
abstractmethod
property
Methods:
from_model(flavor_model: FlavorResponse) -> Flavor
classmethod
Loads a flavor from a model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flavor_model
|
FlavorResponse
|
The model to load from. |
required |
Raises:
| Type | Description |
|---|---|
CustomFlavorImportError
|
If the custom flavor can't be imported. |
ImportError
|
If the flavor can't be imported. |
Returns:
| Type | Description |
|---|---|
Flavor
|
The loaded flavor. |
Source code in src/zenml/stack/flavor.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
generate_default_docs_url() -> str
Generate the doc urls for all inbuilt and integration flavors.
Note that this method is not going to be useful for custom flavors, which do not have any docs in the main zenml docs.
Returns:
| Type | Description |
|---|---|
str
|
The complete url to the zenml documentation |
Source code in src/zenml/stack/flavor.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 | |
generate_default_sdk_docs_url() -> str
Generate SDK docs url for a flavor.
Returns:
| Type | Description |
|---|---|
str
|
The complete url to the zenml SDK docs |
Source code in src/zenml/stack/flavor.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | |
to_model(integration: Optional[str] = None, is_custom: bool = True) -> FlavorRequest
Converts a flavor to a model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
integration
|
Optional[str]
|
The integration to use for the model. |
None
|
is_custom
|
bool
|
Whether the flavor is a custom flavor. |
True
|
Returns:
| Type | Description |
|---|---|
FlavorRequest
|
The model. |
Source code in src/zenml/stack/flavor.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
Integration
Base class for integration in ZenML.
Methods:
activate() -> None
classmethod
Abstract method to activate the integration.
Source code in src/zenml/integrations/integration.py
136 137 138 | |
check_installation() -> bool
classmethod
Method to check whether the required packages are installed.
Returns:
| Type | Description |
|---|---|
bool
|
True if all required packages are installed, False otherwise. |
Source code in src/zenml/integrations/integration.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
flavors() -> List[Type[Flavor]]
classmethod
Abstract method to declare new stack component flavors.
Returns:
| Type | Description |
|---|---|
List[Type[Flavor]]
|
A list of new stack component flavors. |
Source code in src/zenml/integrations/integration.py
140 141 142 143 144 145 146 147 | |
get_requirements(target_os: Optional[str] = None, python_version: Optional[str] = None) -> List[str]
classmethod
Method to get the requirements for the integration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_os
|
Optional[str]
|
The target operating system to get the requirements for. |
None
|
python_version
|
Optional[str]
|
The Python version to use for the requirements. |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
A list of requirements. |
Source code in src/zenml/integrations/integration.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
get_uninstall_requirements(target_os: Optional[str] = None) -> List[str]
classmethod
Method to get the uninstall requirements for the integration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_os
|
Optional[str]
|
The target operating system to get the requirements for. |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
A list of requirements. |
Source code in src/zenml/integrations/integration.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
Modules
artifact_stores
Initialization of the DigitalOcean Spaces Artifact Store.
Classes
DigitalOceanSpacesArtifactStore(*args: Any, **kwargs: Any)
Bases: S3ArtifactStore
Artifact Store backed by a DigitalOcean Spaces bucket via the S3 API.
Source code in src/zenml/integrations/s3/artifact_stores/s3_artifact_store.py
169 170 171 172 173 174 175 176 177 178 179 180 181 | |
config: DigitalOceanSpacesArtifactStoreConfig
property
Get the typed config of this artifact store.
Returns:
| Type | Description |
|---|---|
DigitalOceanSpacesArtifactStoreConfig
|
The config of this artifact store. |
Modules
digitalocean_artifact_store
Implementation of the DigitalOcean Spaces Artifact Store.
DigitalOcean Spaces exposes an S3-compatible API that behaves identically to S3
for the read/write operations ZenML needs, so this class subclasses
:class:S3ArtifactStore. The Spaces endpoint URL is derived from the
configured region at runtime unless an explicit endpoint_url is
provided through client_kwargs. Keeping the derived endpoint out of the
persisted config avoids stale endpoint values when the region changes.
DigitalOceanSpacesArtifactStore(*args: Any, **kwargs: Any)
Bases: S3ArtifactStore
Artifact Store backed by a DigitalOcean Spaces bucket via the S3 API.
Source code in src/zenml/integrations/s3/artifact_stores/s3_artifact_store.py
169 170 171 172 173 174 175 176 177 178 179 180 181 | |
config: DigitalOceanSpacesArtifactStoreConfig
property
Get the typed config of this artifact store.
Returns:
| Type | Description |
|---|---|
DigitalOceanSpacesArtifactStoreConfig
|
The config of this artifact store. |
flavors
DigitalOcean integration flavors.
Classes
DigitalOceanContainerRegistryConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseContainerRegistryConfig
Configuration for the DigitalOcean Container Registry.
Source code in src/zenml/stack/stack_component.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
validate_uri(uri: str) -> str
classmethod
Validates that the URI is a DigitalOcean Container Registry URI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri
|
str
|
URI to validate. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The validated URI. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the URI is not a valid DOCR URI. |
Source code in src/zenml/integrations/digitalocean/flavors/digitalocean_container_registry_flavor.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
DigitalOceanContainerRegistryFlavor
Bases: BaseContainerRegistryFlavor
DigitalOcean Container Registry (DOCR) flavor.
config_class: Type[DigitalOceanContainerRegistryConfig]
property
Config class for this flavor.
Returns:
| Type | Description |
|---|---|
Type[DigitalOceanContainerRegistryConfig]
|
The config class. |
display_name: str
property
Display name of the flavor.
Returns:
| Type | Description |
|---|---|
str
|
The display name of the flavor. |
docs_url: Optional[str]
property
A URL to point at docs explaining this flavor.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
A flavor docs url. |
logo_url: str
property
A URL to represent the flavor in the dashboard.
Returns:
| Type | Description |
|---|---|
str
|
The flavor logo. |
name: str
property
Name of the flavor.
Returns:
| Type | Description |
|---|---|
str
|
The name of the flavor. |
sdk_docs_url: Optional[str]
property
A URL to point at SDK docs explaining this flavor.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
A flavor SDK docs url. |
service_connector_requirements: Optional[ServiceConnectorRequirements]
property
Service connector resource requirements for service connectors.
Specifies resource requirements that are used to filter the available service connector types that are compatible with this flavor. Any connector that provides a Docker registry resource can be used.
Returns:
| Type | Description |
|---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors. |
DigitalOceanSpacesArtifactStoreConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: S3ArtifactStoreConfig
Configuration for the DigitalOcean Spaces artifact store.
Inherits every option of the S3 artifact store (Spaces is S3-compatible)
and adds a region field. The bucket URI continues to use the s3://
scheme because the underlying filesystem (s3fs) addresses Spaces buckets
through the S3 API.
Example
zenml artifact-store register do_spaces --flavor=digitalocean --path=s3://my-space --region=fra1
Source code in src/zenml/stack/stack_component.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
DigitalOceanSpacesArtifactStoreFlavor
Bases: S3ArtifactStoreFlavor
Flavor of the DigitalOcean Spaces artifact store.
config_class: Type[DigitalOceanSpacesArtifactStoreConfig]
property
The config class of the flavor.
Returns:
| Type | Description |
|---|---|
Type[DigitalOceanSpacesArtifactStoreConfig]
|
The config class of the flavor. |
display_name: str
property
Display name of the flavor.
Returns:
| Type | Description |
|---|---|
str
|
The display name of the flavor. |
implementation_class: Type[DigitalOceanSpacesArtifactStore]
property
Implementation class for this flavor.
Returns:
| Type | Description |
|---|---|
Type[DigitalOceanSpacesArtifactStore]
|
The implementation class for this flavor. |
logo_url: str
property
A URL to represent the flavor in the dashboard.
Returns:
| Type | Description |
|---|---|
str
|
The flavor logo. |
name: str
property
Name of the flavor.
Returns:
| Type | Description |
|---|---|
str
|
The name of the flavor. |
service_connector_requirements: Optional[ServiceConnectorRequirements]
property
Service connector resource requirements for service connectors.
A dedicated DigitalOcean service connector is a planned follow-up; until
it exists, the Spaces artifact store authenticates with the key /
secret Spaces access keys directly, so no connector is advertised.
Returns:
| Type | Description |
|---|---|
Optional[ServiceConnectorRequirements]
|
None, until a DigitalOcean service connector is available. |
Modules
digitalocean_artifact_store_flavor
DigitalOcean Spaces artifact store flavor.
DigitalOcean Spaces is S3-compatible, so this flavor subclasses the S3
implementation rather than duplicating it. The config layer only validates
user-provided values (the Spaces region); the region-derived endpoint URL
is applied in the artifact store implementation so it is not persisted as stack
component configuration.
DigitalOceanSpacesArtifactStoreConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: S3ArtifactStoreConfig
Configuration for the DigitalOcean Spaces artifact store.
Inherits every option of the S3 artifact store (Spaces is S3-compatible)
and adds a region field. The bucket URI continues to use the s3://
scheme because the underlying filesystem (s3fs) addresses Spaces buckets
through the S3 API.
Example
zenml artifact-store register do_spaces --flavor=digitalocean --path=s3://my-space --region=fra1
Source code in src/zenml/stack/stack_component.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
DigitalOceanSpacesArtifactStoreFlavor
Bases: S3ArtifactStoreFlavor
Flavor of the DigitalOcean Spaces artifact store.
config_class: Type[DigitalOceanSpacesArtifactStoreConfig]
property
The config class of the flavor.
Returns:
| Type | Description |
|---|---|
Type[DigitalOceanSpacesArtifactStoreConfig]
|
The config class of the flavor. |
display_name: str
property
Display name of the flavor.
Returns:
| Type | Description |
|---|---|
str
|
The display name of the flavor. |
implementation_class: Type[DigitalOceanSpacesArtifactStore]
property
Implementation class for this flavor.
Returns:
| Type | Description |
|---|---|
Type[DigitalOceanSpacesArtifactStore]
|
The implementation class for this flavor. |
logo_url: str
property
A URL to represent the flavor in the dashboard.
Returns:
| Type | Description |
|---|---|
str
|
The flavor logo. |
name: str
property
Name of the flavor.
Returns:
| Type | Description |
|---|---|
str
|
The name of the flavor. |
service_connector_requirements: Optional[ServiceConnectorRequirements]
property
Service connector resource requirements for service connectors.
A dedicated DigitalOcean service connector is a planned follow-up; until
it exists, the Spaces artifact store authenticates with the key /
secret Spaces access keys directly, so no connector is advertised.
Returns:
| Type | Description |
|---|---|
Optional[ServiceConnectorRequirements]
|
None, until a DigitalOcean service connector is available. |
digitalocean_container_registry_flavor
DigitalOcean Container Registry (DOCR) flavor.
DigitalOceanContainerRegistryConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseContainerRegistryConfig
Configuration for the DigitalOcean Container Registry.
Source code in src/zenml/stack/stack_component.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
validate_uri(uri: str) -> str
classmethod
Validates that the URI is a DigitalOcean Container Registry URI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri
|
str
|
URI to validate. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The validated URI. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the URI is not a valid DOCR URI. |
Source code in src/zenml/integrations/digitalocean/flavors/digitalocean_container_registry_flavor.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
DigitalOceanContainerRegistryFlavor
Bases: BaseContainerRegistryFlavor
DigitalOcean Container Registry (DOCR) flavor.
config_class: Type[DigitalOceanContainerRegistryConfig]
property
Config class for this flavor.
Returns:
| Type | Description |
|---|---|
Type[DigitalOceanContainerRegistryConfig]
|
The config class. |
display_name: str
property
Display name of the flavor.
Returns:
| Type | Description |
|---|---|
str
|
The display name of the flavor. |
docs_url: Optional[str]
property
A URL to point at docs explaining this flavor.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
A flavor docs url. |
logo_url: str
property
A URL to represent the flavor in the dashboard.
Returns:
| Type | Description |
|---|---|
str
|
The flavor logo. |
name: str
property
Name of the flavor.
Returns:
| Type | Description |
|---|---|
str
|
The name of the flavor. |
sdk_docs_url: Optional[str]
property
A URL to point at SDK docs explaining this flavor.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
A flavor SDK docs url. |
service_connector_requirements: Optional[ServiceConnectorRequirements]
property
Service connector resource requirements for service connectors.
Specifies resource requirements that are used to filter the available service connector types that are compatible with this flavor. Any connector that provides a Docker registry resource can be used.
Returns:
| Type | Description |
|---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors. |