Azure
zenml.integrations.azure
Initialization of the ZenML Azure integration.
The Azure integration submodule provides a way to run ZenML pipelines in a cloud
environment. Specifically, it allows the use of cloud artifact stores,
and an io
module to handle file operations on Azure Blob Storage.
The Azure Step Operator integration submodule provides a way to run ZenML steps
in AzureML.
Attributes
AZURE = 'azure'
module-attribute
AZUREML_ORCHESTRATOR_FLAVOR = 'azureml'
module-attribute
AZUREML_STEP_OPERATOR_FLAVOR = 'azureml'
module-attribute
AZURE_ARTIFACT_STORE_FLAVOR = 'azure'
module-attribute
AZURE_CONNECTOR_TYPE = 'azure'
module-attribute
AZURE_RESOURCE_TYPE = 'azure-generic'
module-attribute
BLOB_RESOURCE_TYPE = 'blob-container'
module-attribute
Classes
AzureIntegration
Bases: Integration
Definition of Azure integration for ZenML.
Functions
activate() -> None
classmethod
Activate the Azure integration.
Source code in src/zenml/integrations/azure/__init__.py
59 60 61 62 |
|
flavors() -> List[Type[Flavor]]
classmethod
Declares the flavors for the integration.
Returns:
Type | Description |
---|---|
List[Type[Flavor]]
|
List of stack component flavors for this integration. |
Source code in src/zenml/integrations/azure/__init__.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
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. |
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
Functions
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
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
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
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
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
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
|
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
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 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 |
|
Integration
Base class for integration in ZenML.
Functions
activate() -> None
classmethod
Abstract method to activate the integration.
Source code in src/zenml/integrations/integration.py
175 176 177 |
|
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
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 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 132 133 |
|
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
179 180 181 182 183 184 185 186 |
|
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
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
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
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
plugin_flavors() -> List[Type[BasePluginFlavor]]
classmethod
Abstract method to declare new plugin flavors.
Returns:
Type | Description |
---|---|
List[Type[BasePluginFlavor]]
|
A list of new plugin flavors. |
Source code in src/zenml/integrations/integration.py
188 189 190 191 192 193 194 195 |
|
Modules
artifact_stores
Initialization of the Azure Artifact Store integration.
Classes
AzureArtifactStore(*args: Any, **kwargs: Any)
Bases: BaseArtifactStore
, AuthenticationMixin
Artifact Store for Microsoft Azure based artifacts.
Source code in src/zenml/artifact_stores/base_artifact_store.py
430 431 432 433 434 435 436 437 438 439 440 441 442 |
|
config: AzureArtifactStoreConfig
property
Returns the AzureArtifactStoreConfig
config.
Returns:
Type | Description |
---|---|
AzureArtifactStoreConfig
|
The configuration. |
filesystem: adlfs.AzureBlobFileSystem
property
The adlfs filesystem to access this artifact store.
Returns:
Type | Description |
---|---|
AzureBlobFileSystem
|
The adlfs filesystem to access this artifact store. |
copyfile(src: PathType, dst: PathType, overwrite: bool = False) -> None
Copy a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
src
|
PathType
|
The path to copy from. |
required |
dst
|
PathType
|
The path to copy to. |
required |
overwrite
|
bool
|
If a file already exists at the destination, this
method will overwrite it if overwrite= |
False
|
Raises:
Type | Description |
---|---|
FileExistsError
|
If a file already exists at the destination
and overwrite is not set to |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
|
exists(path: PathType) -> bool
Check whether a path exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the path exists, False otherwise. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
189 190 191 192 193 194 195 196 197 198 |
|
get_credentials() -> Optional[AzureSecretSchema]
Returns the credentials for the Azure Artifact Store if configured.
Returns:
Type | Description |
---|---|
Optional[AzureSecretSchema]
|
The credentials. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the connector is not configured with Azure service principal credentials. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
55 56 57 58 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 95 96 97 98 99 100 101 102 103 104 105 |
|
glob(pattern: PathType) -> List[PathType]
Return all paths that match the given glob pattern.
The glob pattern may include: - '' to match any number of characters - '?' to match a single character - '[...]' to match one of the characters inside the brackets - '' as the full name of a path component to match to search in subdirectories of any depth (e.g. '/some_dir/*/some_file)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pattern
|
PathType
|
The glob pattern to match, see details above. |
required |
Returns:
Type | Description |
---|---|
List[PathType]
|
A list of paths that match the given glob pattern. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
|
isdir(path: PathType) -> bool
Check whether a path is a directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the path is a directory, False otherwise. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
221 222 223 224 225 226 227 228 229 230 |
|
listdir(path: PathType) -> List[PathType]
Return a list of files in a directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to list. |
required |
Returns:
Type | Description |
---|---|
List[PathType]
|
A list of files in the given directory. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
|
makedirs(path: PathType) -> None
Create a directory at the given path.
If needed also create missing parent directories.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to create. |
required |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
261 262 263 264 265 266 267 268 269 |
|
mkdir(path: PathType) -> None
Create a directory at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to create. |
required |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
271 272 273 274 275 276 277 |
|
open(path: PathType, mode: str = 'r') -> Any
Open a file at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
Path of the file to open. |
required |
mode
|
str
|
Mode in which to open the file. Currently, only 'rb' and 'wb' to read and write binary files are supported. |
'r'
|
Returns:
Type | Description |
---|---|
Any
|
A file-like object. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
150 151 152 153 154 155 156 157 158 159 160 161 |
|
remove(path: PathType) -> None
Remove the file at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to remove. |
required |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
279 280 281 282 283 284 285 |
|
rename(src: PathType, dst: PathType, overwrite: bool = False) -> None
Rename source file to destination file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
src
|
PathType
|
The path of the file to rename. |
required |
dst
|
PathType
|
The path to rename the source file to. |
required |
overwrite
|
bool
|
If a file already exists at the destination, this
method will overwrite it if overwrite= |
False
|
Raises:
Type | Description |
---|---|
FileExistsError
|
If a file already exists at the destination
and overwrite is not set to |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
|
rmtree(path: PathType) -> None
Remove the given directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path of the directory to remove. |
required |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
313 314 315 316 317 318 319 |
|
size(path: PathType) -> int
Get the size of a file in bytes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to the file. |
required |
Returns:
Type | Description |
---|---|
int
|
The size of the file in bytes. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
332 333 334 335 336 337 338 339 340 341 |
|
stat(path: PathType) -> Dict[str, Any]
Return stat info for the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to get stat info for. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Stat info. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
321 322 323 324 325 326 327 328 329 330 |
|
walk(top: PathType, topdown: bool = True, onerror: Optional[Callable[..., None]] = None) -> Iterable[Tuple[PathType, List[PathType], List[PathType]]]
Return an iterator that walks the contents of the given directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
top
|
PathType
|
Path of directory to walk. |
required |
topdown
|
bool
|
Unused argument to conform to interface. |
True
|
onerror
|
Optional[Callable[..., None]]
|
Unused argument to conform to interface. |
None
|
Yields:
Type | Description |
---|---|
Iterable[Tuple[PathType, List[PathType], List[PathType]]]
|
An Iterable of Tuples, each of which contain the path of the current |
Iterable[Tuple[PathType, List[PathType], List[PathType]]]
|
directory path, a list of directories inside the current directory |
Iterable[Tuple[PathType, List[PathType], List[PathType]]]
|
and a list of files inside the current directory. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
|
Modules
azure_artifact_store
Implementation of the Azure Artifact Store integration.
AzureArtifactStore(*args: Any, **kwargs: Any)
Bases: BaseArtifactStore
, AuthenticationMixin
Artifact Store for Microsoft Azure based artifacts.
Source code in src/zenml/artifact_stores/base_artifact_store.py
430 431 432 433 434 435 436 437 438 439 440 441 442 |
|
config: AzureArtifactStoreConfig
property
Returns the AzureArtifactStoreConfig
config.
Returns:
Type | Description |
---|---|
AzureArtifactStoreConfig
|
The configuration. |
filesystem: adlfs.AzureBlobFileSystem
property
The adlfs filesystem to access this artifact store.
Returns:
Type | Description |
---|---|
AzureBlobFileSystem
|
The adlfs filesystem to access this artifact store. |
copyfile(src: PathType, dst: PathType, overwrite: bool = False) -> None
Copy a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
src
|
PathType
|
The path to copy from. |
required |
dst
|
PathType
|
The path to copy to. |
required |
overwrite
|
bool
|
If a file already exists at the destination, this
method will overwrite it if overwrite= |
False
|
Raises:
Type | Description |
---|---|
FileExistsError
|
If a file already exists at the destination
and overwrite is not set to |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
|
exists(path: PathType) -> bool
Check whether a path exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the path exists, False otherwise. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
189 190 191 192 193 194 195 196 197 198 |
|
get_credentials() -> Optional[AzureSecretSchema]
Returns the credentials for the Azure Artifact Store if configured.
Returns:
Type | Description |
---|---|
Optional[AzureSecretSchema]
|
The credentials. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the connector is not configured with Azure service principal credentials. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
55 56 57 58 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 95 96 97 98 99 100 101 102 103 104 105 |
|
glob(pattern: PathType) -> List[PathType]
Return all paths that match the given glob pattern.
The glob pattern may include: - '' to match any number of characters - '?' to match a single character - '[...]' to match one of the characters inside the brackets - '' as the full name of a path component to match to search in subdirectories of any depth (e.g. '/some_dir/*/some_file)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pattern
|
PathType
|
The glob pattern to match, see details above. |
required |
Returns:
Type | Description |
---|---|
List[PathType]
|
A list of paths that match the given glob pattern. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
|
isdir(path: PathType) -> bool
Check whether a path is a directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the path is a directory, False otherwise. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
221 222 223 224 225 226 227 228 229 230 |
|
listdir(path: PathType) -> List[PathType]
Return a list of files in a directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to list. |
required |
Returns:
Type | Description |
---|---|
List[PathType]
|
A list of files in the given directory. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
|
makedirs(path: PathType) -> None
Create a directory at the given path.
If needed also create missing parent directories.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to create. |
required |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
261 262 263 264 265 266 267 268 269 |
|
mkdir(path: PathType) -> None
Create a directory at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to create. |
required |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
271 272 273 274 275 276 277 |
|
open(path: PathType, mode: str = 'r') -> Any
Open a file at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
Path of the file to open. |
required |
mode
|
str
|
Mode in which to open the file. Currently, only 'rb' and 'wb' to read and write binary files are supported. |
'r'
|
Returns:
Type | Description |
---|---|
Any
|
A file-like object. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
150 151 152 153 154 155 156 157 158 159 160 161 |
|
remove(path: PathType) -> None
Remove the file at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to remove. |
required |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
279 280 281 282 283 284 285 |
|
rename(src: PathType, dst: PathType, overwrite: bool = False) -> None
Rename source file to destination file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
src
|
PathType
|
The path of the file to rename. |
required |
dst
|
PathType
|
The path to rename the source file to. |
required |
overwrite
|
bool
|
If a file already exists at the destination, this
method will overwrite it if overwrite= |
False
|
Raises:
Type | Description |
---|---|
FileExistsError
|
If a file already exists at the destination
and overwrite is not set to |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
|
rmtree(path: PathType) -> None
Remove the given directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path of the directory to remove. |
required |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
313 314 315 316 317 318 319 |
|
size(path: PathType) -> int
Get the size of a file in bytes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to the file. |
required |
Returns:
Type | Description |
---|---|
int
|
The size of the file in bytes. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
332 333 334 335 336 337 338 339 340 341 |
|
stat(path: PathType) -> Dict[str, Any]
Return stat info for the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
PathType
|
The path to get stat info for. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Stat info. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
321 322 323 324 325 326 327 328 329 330 |
|
walk(top: PathType, topdown: bool = True, onerror: Optional[Callable[..., None]] = None) -> Iterable[Tuple[PathType, List[PathType], List[PathType]]]
Return an iterator that walks the contents of the given directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
top
|
PathType
|
Path of directory to walk. |
required |
topdown
|
bool
|
Unused argument to conform to interface. |
True
|
onerror
|
Optional[Callable[..., None]]
|
Unused argument to conform to interface. |
None
|
Yields:
Type | Description |
---|---|
Iterable[Tuple[PathType, List[PathType], List[PathType]]]
|
An Iterable of Tuples, each of which contain the path of the current |
Iterable[Tuple[PathType, List[PathType], List[PathType]]]
|
directory path, a list of directories inside the current directory |
Iterable[Tuple[PathType, List[PathType], List[PathType]]]
|
and a list of files inside the current directory. |
Source code in src/zenml/integrations/azure/artifact_stores/azure_artifact_store.py
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
|
azureml_utils
AzureML definitions.
Classes
Functions
check_settings_and_compute_configuration(parameter: str, settings: AzureMLComputeSettings, compute: Compute) -> None
Utility function comparing a parameter between settings and compute.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameter
|
str
|
the name of the parameter. |
required |
settings
|
AzureMLComputeSettings
|
The AzureML orchestrator settings. |
required |
compute
|
Compute
|
The compute instance or cluster from AzureML. |
required |
Source code in src/zenml/integrations/azure/azureml_utils.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
create_or_get_compute(client: MLClient, settings: AzureMLComputeSettings, default_compute_name: str) -> Optional[str]
Creates or fetches the compute target if defined in the settings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
MLClient
|
the AzureML client. |
required |
settings
|
AzureMLComputeSettings
|
the settings for the orchestrator. |
required |
default_compute_name
|
str
|
the default name for the compute target, if one is not provided in the settings. |
required |
Returns:
Type | Description |
---|---|
Optional[str]
|
None, if the orchestrator is using serverless compute or |
Optional[str]
|
str, the name of the compute target (instance or cluster). |
Raises:
Type | Description |
---|---|
RuntimeError
|
if the fetched compute target is unsupported or the mode defined in the setting does not match the type of the compute target. |
Source code in src/zenml/integrations/azure/azureml_utils.py
57 58 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 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 132 133 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 174 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 |
|
flavors
Azure integration flavors.
Classes
AzureArtifactStoreConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseArtifactStoreConfig
, AuthenticationConfigMixin
Configuration class for Azure Artifact Store.
Source code in src/zenml/stack/stack_component.py
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 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 |
|
AzureArtifactStoreFlavor
Bases: BaseArtifactStoreFlavor
Azure Artifact Store flavor.
config_class: Type[AzureArtifactStoreConfig]
property
Returns AzureArtifactStoreConfig config class.
Returns:
Type | Description |
---|---|
Type[AzureArtifactStoreConfig]
|
The config class. |
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[AzureArtifactStore]
property
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.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
AzureMLOrchestratorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseOrchestratorConfig
, AzureMLOrchestratorSettings
Configuration for the AzureML orchestrator.
Source code in src/zenml/stack/stack_component.py
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 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 |
|
is_remote: bool
property
Checks if this stack component is running remotely.
This designation is used to determine if the stack component can be used with a local ZenML database or if it requires a remote ZenML server.
Returns:
Type | Description |
---|---|
bool
|
True if this config is for a remote component, False otherwise. |
is_schedulable: bool
property
Whether the orchestrator is schedulable or not.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator is schedulable or not. |
is_synchronous: bool
property
Whether the orchestrator runs synchronously or not.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator runs synchronously or not. |
AzureMLOrchestratorFlavor
Bases: BaseOrchestratorFlavor
Flavor for the AzureML orchestrator.
config_class: Type[AzureMLOrchestratorConfig]
property
Returns AzureMLOrchestratorConfig config class.
Returns:
Type | Description |
---|---|
Type[AzureMLOrchestratorConfig]
|
The config class. |
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[AzureMLOrchestrator]
property
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.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
AzureMLOrchestratorSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: AzureMLComputeSettings
Settings for the AzureML orchestrator.
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 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 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 |
|
AzureMLStepOperatorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseStepOperatorConfig
, AzureMLStepOperatorSettings
Config for the AzureML step operator.
Attributes:
Name | Type | Description |
---|---|---|
subscription_id |
str
|
The Azure account's subscription ID |
resource_group |
str
|
The resource group to which the AzureML workspace is deployed. |
workspace_name |
str
|
The name of the AzureML Workspace. |
tenant_id |
Optional[str]
|
The Azure Tenant ID. |
service_principal_id |
Optional[str]
|
The ID for the service principal that is created to allow apps to access secure resources. |
service_principal_password |
Optional[str]
|
Password for the service principal. |
Source code in src/zenml/stack/stack_component.py
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 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 |
|
is_remote: bool
property
Checks if this stack component is running remotely.
This designation is used to determine if the stack component can be used with a local ZenML database or if it requires a remote ZenML server.
Returns:
Type | Description |
---|---|
bool
|
True if this config is for a remote component, False otherwise. |
AzureMLStepOperatorFlavor
Bases: BaseStepOperatorFlavor
Flavor for the AzureML step operator.
config_class: Type[AzureMLStepOperatorConfig]
property
Returns AzureMLStepOperatorConfig config class.
Returns:
Type | Description |
---|---|
Type[AzureMLStepOperatorConfig]
|
The config class. |
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[AzureMLStepOperator]
property
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.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
AzureMLStepOperatorSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: AzureMLComputeSettings
Settings for the AzureML step operator.
Attributes:
Name | Type | Description |
---|---|---|
compute_target_name |
Optional[str]
|
The name of the configured ComputeTarget.
Deprecated in favor of |
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 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 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 |
|
Modules
azure_artifact_store_flavor
Azure artifact store flavor.
AzureArtifactStoreConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseArtifactStoreConfig
, AuthenticationConfigMixin
Configuration class for Azure Artifact Store.
Source code in src/zenml/stack/stack_component.py
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 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 |
|
AzureArtifactStoreFlavor
Bases: BaseArtifactStoreFlavor
Azure Artifact Store flavor.
config_class: Type[AzureArtifactStoreConfig]
property
Returns AzureArtifactStoreConfig config class.
Returns:
Type | Description |
---|---|
Type[AzureArtifactStoreConfig]
|
The config class. |
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[AzureArtifactStore]
property
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.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
azureml
AzureML definitions.
AzureMLComputeSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseSettings
Settings for the AzureML compute.
These settings adjust the compute resources that will be used by the pipeline execution.
There are three possible use cases for this implementation:
1. Serverless compute (default behavior):
- The `mode` is set to `serverless` (default behavior).
- All the other parameters become irrelevant and will throw a
warning if set.
2. Compute instance:
- The `mode` is set to `compute-instance`.
- In this case, users have to provide a `compute-name`.
- If a compute instance exists with this name, this instance
will be used and all the other parameters become irrelevant
and will throw a warning if set.
- If a compute instance does not already exist, ZenML will
create it. You can use the parameters `compute_size` and
`idle_type_before_shutdown_minutes` for this operation.
3. Compute cluster:
- The `mode` is set to `compute-cluster`.
- In this case, users have to provide a `compute-name`.
- If a compute cluster exists with this name, this instance
will be used and all the other parameters become irrelevant
and will throw a warning if set.
- If a compute cluster does not already exist, ZenML will
create it. You can set the additional parameters for this
operation.
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 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 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 |
|
azureml_settings_validator() -> AzureMLComputeSettings
Checks whether the right configuration is set based on mode.
Returns:
Type | Description |
---|---|
AzureMLComputeSettings
|
the instance itself. |
Raises:
Type | Description |
---|---|
AssertionError
|
if a name is not provided when working with instances and clusters. |
Source code in src/zenml/integrations/azure/flavors/azureml.py
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 132 133 134 135 136 137 138 139 |
|
AzureMLComputeTypes
azureml_orchestrator_flavor
Implementation of the AzureML Orchestrator flavor.
AzureMLOrchestratorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseOrchestratorConfig
, AzureMLOrchestratorSettings
Configuration for the AzureML orchestrator.
Source code in src/zenml/stack/stack_component.py
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 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 |
|
is_remote: bool
property
Checks if this stack component is running remotely.
This designation is used to determine if the stack component can be used with a local ZenML database or if it requires a remote ZenML server.
Returns:
Type | Description |
---|---|
bool
|
True if this config is for a remote component, False otherwise. |
is_schedulable: bool
property
Whether the orchestrator is schedulable or not.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator is schedulable or not. |
is_synchronous: bool
property
Whether the orchestrator runs synchronously or not.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator runs synchronously or not. |
AzureMLOrchestratorFlavor
Bases: BaseOrchestratorFlavor
Flavor for the AzureML orchestrator.
config_class: Type[AzureMLOrchestratorConfig]
property
Returns AzureMLOrchestratorConfig config class.
Returns:
Type | Description |
---|---|
Type[AzureMLOrchestratorConfig]
|
The config class. |
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[AzureMLOrchestrator]
property
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.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
AzureMLOrchestratorSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: AzureMLComputeSettings
Settings for the AzureML orchestrator.
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 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 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 |
|
azureml_step_operator_flavor
AzureML step operator flavor.
AzureMLStepOperatorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseStepOperatorConfig
, AzureMLStepOperatorSettings
Config for the AzureML step operator.
Attributes:
Name | Type | Description |
---|---|---|
subscription_id |
str
|
The Azure account's subscription ID |
resource_group |
str
|
The resource group to which the AzureML workspace is deployed. |
workspace_name |
str
|
The name of the AzureML Workspace. |
tenant_id |
Optional[str]
|
The Azure Tenant ID. |
service_principal_id |
Optional[str]
|
The ID for the service principal that is created to allow apps to access secure resources. |
service_principal_password |
Optional[str]
|
Password for the service principal. |
Source code in src/zenml/stack/stack_component.py
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 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 |
|
is_remote: bool
property
Checks if this stack component is running remotely.
This designation is used to determine if the stack component can be used with a local ZenML database or if it requires a remote ZenML server.
Returns:
Type | Description |
---|---|
bool
|
True if this config is for a remote component, False otherwise. |
AzureMLStepOperatorFlavor
Bases: BaseStepOperatorFlavor
Flavor for the AzureML step operator.
config_class: Type[AzureMLStepOperatorConfig]
property
Returns AzureMLStepOperatorConfig config class.
Returns:
Type | Description |
---|---|
Type[AzureMLStepOperatorConfig]
|
The config class. |
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[AzureMLStepOperator]
property
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.
Returns:
Type | Description |
---|---|
Optional[ServiceConnectorRequirements]
|
Requirements for compatible service connectors, if a service |
Optional[ServiceConnectorRequirements]
|
connector is required for this flavor. |
AzureMLStepOperatorSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: AzureMLComputeSettings
Settings for the AzureML step operator.
Attributes:
Name | Type | Description |
---|---|---|
compute_target_name |
Optional[str]
|
The name of the configured ComputeTarget.
Deprecated in favor of |
Source code in src/zenml/config/secret_reference_mixin.py
30 31 32 33 34 35 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 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 |
|
orchestrators
AzureML orchestrator.
Classes
AzureMLOrchestrator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: ContainerizedOrchestrator
Orchestrator responsible for running pipelines on AzureML.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
config: AzureMLOrchestratorConfig
property
Returns the AzureMLOrchestratorConfig
config.
Returns:
Type | Description |
---|---|
AzureMLOrchestratorConfig
|
The configuration. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the AzureML orchestrator.
Returns:
Type | Description |
---|---|
Optional[Type[BaseSettings]]
|
The settings class. |
validator: Optional[StackValidator]
property
Validates the stack.
In the remote case, checks that the stack contains a container registry, image builder and only remote components.
Returns:
Type | Description |
---|---|
Optional[StackValidator]
|
A |
compute_metadata(job: Any) -> Iterator[Dict[str, MetadataType]]
Generate run metadata based on the generated AzureML PipelineJob.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job
|
Any
|
The corresponding PipelineJob object. |
required |
Yields:
Type | Description |
---|---|
Dict[str, MetadataType]
|
A dictionary of metadata related to the pipeline run. |
Source code in src/zenml/integrations/azure/orchestrators/azureml_orchestrator.py
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 |
|
fetch_status(run: PipelineRunResponse) -> ExecutionStatus
Refreshes the status of a specific pipeline run.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
run
|
PipelineRunResponse
|
The run that was executed by this orchestrator. |
required |
Returns:
Type | Description |
---|---|
ExecutionStatus
|
the actual status of the pipeline execution. |
Raises:
Type | Description |
---|---|
AssertionError
|
If the run was not executed by to this orchestrator. |
ValueError
|
If it fetches an unknown state or if we can not fetch the orchestrator run ID. |
Source code in src/zenml/integrations/azure/orchestrators/azureml_orchestrator.py
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 |
|
get_orchestrator_run_id() -> str
Returns the run id of the active orchestrator run.
Important: This needs to be a unique ID and return the same value for all steps of a pipeline run.
Returns:
Type | Description |
---|---|
str
|
The orchestrator run id. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the run id cannot be read from the environment. |
Source code in src/zenml/integrations/azure/orchestrators/azureml_orchestrator.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
get_pipeline_run_metadata(run_id: UUID) -> Dict[str, MetadataType]
Get general component-specific metadata for a pipeline run.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
run_id
|
UUID
|
The ID of the pipeline run. |
required |
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
A dictionary of metadata. |
Source code in src/zenml/integrations/azure/orchestrators/azureml_orchestrator.py
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
|
prepare_or_run_pipeline(deployment: PipelineDeploymentResponse, stack: Stack, environment: Dict[str, str], placeholder_run: Optional[PipelineRunResponse] = None) -> Iterator[Dict[str, MetadataType]]
Prepares or runs a pipeline on AzureML.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
PipelineDeploymentResponse
|
The deployment to prepare or run. |
required |
stack
|
Stack
|
The stack to run on. |
required |
environment
|
Dict[str, str]
|
Environment variables to set in the orchestration environment. |
required |
placeholder_run
|
Optional[PipelineRunResponse]
|
An optional placeholder run for the deployment. |
None
|
Raises:
Type | Description |
---|---|
RuntimeError
|
If the creation of the schedule fails. |
Yields:
Type | Description |
---|---|
Dict[str, MetadataType]
|
A dictionary of metadata related to the pipeline run. |
Source code in src/zenml/integrations/azure/orchestrators/azureml_orchestrator.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 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 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
|
Modules
azureml_orchestrator
Implementation of the AzureML Orchestrator.
AzureMLOrchestrator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: ContainerizedOrchestrator
Orchestrator responsible for running pipelines on AzureML.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
config: AzureMLOrchestratorConfig
property
Returns the AzureMLOrchestratorConfig
config.
Returns:
Type | Description |
---|---|
AzureMLOrchestratorConfig
|
The configuration. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the AzureML orchestrator.
Returns:
Type | Description |
---|---|
Optional[Type[BaseSettings]]
|
The settings class. |
validator: Optional[StackValidator]
property
Validates the stack.
In the remote case, checks that the stack contains a container registry, image builder and only remote components.
Returns:
Type | Description |
---|---|
Optional[StackValidator]
|
A |
compute_metadata(job: Any) -> Iterator[Dict[str, MetadataType]]
Generate run metadata based on the generated AzureML PipelineJob.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
job
|
Any
|
The corresponding PipelineJob object. |
required |
Yields:
Type | Description |
---|---|
Dict[str, MetadataType]
|
A dictionary of metadata related to the pipeline run. |
Source code in src/zenml/integrations/azure/orchestrators/azureml_orchestrator.py
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 |
|
fetch_status(run: PipelineRunResponse) -> ExecutionStatus
Refreshes the status of a specific pipeline run.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
run
|
PipelineRunResponse
|
The run that was executed by this orchestrator. |
required |
Returns:
Type | Description |
---|---|
ExecutionStatus
|
the actual status of the pipeline execution. |
Raises:
Type | Description |
---|---|
AssertionError
|
If the run was not executed by to this orchestrator. |
ValueError
|
If it fetches an unknown state or if we can not fetch the orchestrator run ID. |
Source code in src/zenml/integrations/azure/orchestrators/azureml_orchestrator.py
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 |
|
get_orchestrator_run_id() -> str
Returns the run id of the active orchestrator run.
Important: This needs to be a unique ID and return the same value for all steps of a pipeline run.
Returns:
Type | Description |
---|---|
str
|
The orchestrator run id. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the run id cannot be read from the environment. |
Source code in src/zenml/integrations/azure/orchestrators/azureml_orchestrator.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
get_pipeline_run_metadata(run_id: UUID) -> Dict[str, MetadataType]
Get general component-specific metadata for a pipeline run.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
run_id
|
UUID
|
The ID of the pipeline run. |
required |
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
A dictionary of metadata. |
Source code in src/zenml/integrations/azure/orchestrators/azureml_orchestrator.py
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
|
prepare_or_run_pipeline(deployment: PipelineDeploymentResponse, stack: Stack, environment: Dict[str, str], placeholder_run: Optional[PipelineRunResponse] = None) -> Iterator[Dict[str, MetadataType]]
Prepares or runs a pipeline on AzureML.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
PipelineDeploymentResponse
|
The deployment to prepare or run. |
required |
stack
|
Stack
|
The stack to run on. |
required |
environment
|
Dict[str, str]
|
Environment variables to set in the orchestration environment. |
required |
placeholder_run
|
Optional[PipelineRunResponse]
|
An optional placeholder run for the deployment. |
None
|
Raises:
Type | Description |
---|---|
RuntimeError
|
If the creation of the schedule fails. |
Yields:
Type | Description |
---|---|
Dict[str, MetadataType]
|
A dictionary of metadata related to the pipeline run. |
Source code in src/zenml/integrations/azure/orchestrators/azureml_orchestrator.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 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 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
|
azureml_orchestrator_entrypoint_config
Entrypoint configuration for ZenML AzureML pipeline steps.
AzureMLEntrypointConfiguration(arguments: List[str])
Bases: StepEntrypointConfiguration
Entrypoint configuration for ZenML AzureML pipeline steps.
Source code in src/zenml/entrypoints/base_entrypoint_configuration.py
60 61 62 63 64 65 66 |
|
get_entrypoint_arguments(**kwargs: Any) -> List[str]
classmethod
Gets all arguments that the entrypoint command should be called with.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Kwargs, can include the environmental variables. |
{}
|
Returns:
Type | Description |
---|---|
List[str]
|
The superclass arguments as well as arguments for environmental |
List[str]
|
variables. |
Source code in src/zenml/integrations/azure/orchestrators/azureml_orchestrator_entrypoint_config.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
get_entrypoint_options() -> Set[str]
classmethod
Gets all options required for running with this configuration.
Returns:
Type | Description |
---|---|
Set[str]
|
The superclass options as well as an option for the |
Set[str]
|
environmental variables. |
Source code in src/zenml/integrations/azure/orchestrators/azureml_orchestrator_entrypoint_config.py
32 33 34 35 36 37 38 39 40 |
|
run() -> None
Runs the step.
Source code in src/zenml/integrations/azure/orchestrators/azureml_orchestrator_entrypoint_config.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
service_connectors
Azure Service Connector.
Classes
AzureServiceConnector(**kwargs: Any)
Bases: ServiceConnector
Azure service connector.
Source code in src/zenml/service_connectors/service_connector.py
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 |
|
subscription: Tuple[str, str]
property
Get the Azure subscription ID and name.
Returns:
Type | Description |
---|---|
Tuple[str, str]
|
The Azure subscription ID and name. |
Raises:
Type | Description |
---|---|
AuthorizationException
|
If the Azure subscription could not be determined or doesn't match the configured subscription ID. |
tenant_id: str
property
Get the Azure tenant ID.
Returns:
Type | Description |
---|---|
str
|
The Azure tenant ID. |
Raises:
Type | Description |
---|---|
AuthorizationException
|
If the Azure tenant ID could not be determined or doesn't match the configured tenant ID. |
get_azure_credential(auth_method: str, resource_type: Optional[str] = None, resource_id: Optional[str] = None) -> Tuple[TokenCredential, Optional[datetime.datetime]]
Get an Azure credential for the specified resource.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth_method
|
str
|
The authentication method to use. |
required |
resource_type
|
Optional[str]
|
The resource type to get a credential for. |
None
|
resource_id
|
Optional[str]
|
The resource ID to get a credential for. |
None
|
Returns:
Type | Description |
---|---|
TokenCredential
|
An Azure credential for the specified resource and its expiration |
Optional[datetime]
|
timestamp, if applicable. |
Source code in src/zenml/integrations/azure/service_connectors/azure_service_connector.py
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 |
|
Modules
azure_service_connector
Azure Service Connector.
AzureAccessToken
AzureAccessTokenConfig
AzureAuthenticationMethods
AzureBaseConfig
AzureClientConfig
AzureClientSecret
AzureServiceConnector(**kwargs: Any)
Bases: ServiceConnector
Azure service connector.
Source code in src/zenml/service_connectors/service_connector.py
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 |
|
subscription: Tuple[str, str]
property
Get the Azure subscription ID and name.
Returns:
Type | Description |
---|---|
Tuple[str, str]
|
The Azure subscription ID and name. |
Raises:
Type | Description |
---|---|
AuthorizationException
|
If the Azure subscription could not be determined or doesn't match the configured subscription ID. |
tenant_id: str
property
Get the Azure tenant ID.
Returns:
Type | Description |
---|---|
str
|
The Azure tenant ID. |
Raises:
Type | Description |
---|---|
AuthorizationException
|
If the Azure tenant ID could not be determined or doesn't match the configured tenant ID. |
get_azure_credential(auth_method: str, resource_type: Optional[str] = None, resource_id: Optional[str] = None) -> Tuple[TokenCredential, Optional[datetime.datetime]]
Get an Azure credential for the specified resource.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth_method
|
str
|
The authentication method to use. |
required |
resource_type
|
Optional[str]
|
The resource type to get a credential for. |
None
|
resource_id
|
Optional[str]
|
The resource ID to get a credential for. |
None
|
Returns:
Type | Description |
---|---|
TokenCredential
|
An Azure credential for the specified resource and its expiration |
Optional[datetime]
|
timestamp, if applicable. |
Source code in src/zenml/integrations/azure/service_connectors/azure_service_connector.py
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 |
|
AzureServicePrincipalConfig
ZenMLAzureTokenCredential(token: str, expires_at: datetime.datetime)
Bases: TokenCredential
ZenML Azure token credential.
This class is used to provide a pre-configured token credential to Azure clients. Tokens are generated from other Azure credentials and are served to Azure clients to authenticate requests.
Initialize ZenML Azure token credential.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token
|
str
|
The token to use for authentication |
required |
expires_at
|
datetime
|
The expiration time of the token |
required |
Source code in src/zenml/integrations/azure/service_connectors/azure_service_connector.py
168 169 170 171 172 173 174 175 176 177 178 |
|
get_token(*scopes: str, **kwargs: Any) -> Any
Get token.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*scopes
|
str
|
Scopes |
()
|
**kwargs
|
Any
|
Keyword arguments |
{}
|
Returns:
Type | Description |
---|---|
Any
|
Token |
Source code in src/zenml/integrations/azure/service_connectors/azure_service_connector.py
180 181 182 183 184 185 186 187 188 189 190 |
|
step_operators
Initialization of AzureML Step Operator integration.
Classes
AzureMLStepOperator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: BaseStepOperator
Step operator to run a step on AzureML.
This class defines code that can set up an AzureML environment and run the ZenML entrypoint command in it.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
config: AzureMLStepOperatorConfig
property
Returns the AzureMLStepOperatorConfig
config.
Returns:
Type | Description |
---|---|
AzureMLStepOperatorConfig
|
The configuration. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the AzureML step operator.
Returns:
Type | Description |
---|---|
Optional[Type[BaseSettings]]
|
The settings class. |
validator: Optional[StackValidator]
property
Validates the stack.
Returns:
Type | Description |
---|---|
Optional[StackValidator]
|
A validator that checks that the stack contains a remote container |
Optional[StackValidator]
|
registry and a remote artifact store. |
get_docker_builds(deployment: PipelineDeploymentBase) -> List[BuildConfiguration]
Gets the Docker builds required for the component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
PipelineDeploymentBase
|
The pipeline deployment for which to get the builds. |
required |
Returns:
Type | Description |
---|---|
List[BuildConfiguration]
|
The required Docker builds. |
Source code in src/zenml/integrations/azure/step_operators/azureml_step_operator.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
launch(info: StepRunInfo, entrypoint_command: List[str], environment: Dict[str, str]) -> None
Launches a step on AzureML.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
info
|
StepRunInfo
|
Information about the step run. |
required |
entrypoint_command
|
List[str]
|
Command that executes the step. |
required |
environment
|
Dict[str, str]
|
Environment variables to set in the step operator environment. |
required |
Source code in src/zenml/integrations/azure/step_operators/azureml_step_operator.py
162 163 164 165 166 167 168 169 170 171 172 173 174 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 |
|
Modules
azureml_step_operator
Implementation of the ZenML AzureML Step Operator.
AzureMLStepOperator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, labels: Optional[Dict[str, Any]] = None, connector_requirements: Optional[ServiceConnectorRequirements] = None, connector: Optional[UUID] = None, connector_resource_id: Optional[str] = None, *args: Any, **kwargs: Any)
Bases: BaseStepOperator
Step operator to run a step on AzureML.
This class defines code that can set up an AzureML environment and run the ZenML entrypoint command in it.
Source code in src/zenml/stack/stack_component.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
config: AzureMLStepOperatorConfig
property
Returns the AzureMLStepOperatorConfig
config.
Returns:
Type | Description |
---|---|
AzureMLStepOperatorConfig
|
The configuration. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the AzureML step operator.
Returns:
Type | Description |
---|---|
Optional[Type[BaseSettings]]
|
The settings class. |
validator: Optional[StackValidator]
property
Validates the stack.
Returns:
Type | Description |
---|---|
Optional[StackValidator]
|
A validator that checks that the stack contains a remote container |
Optional[StackValidator]
|
registry and a remote artifact store. |
get_docker_builds(deployment: PipelineDeploymentBase) -> List[BuildConfiguration]
Gets the Docker builds required for the component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
PipelineDeploymentBase
|
The pipeline deployment for which to get the builds. |
required |
Returns:
Type | Description |
---|---|
List[BuildConfiguration]
|
The required Docker builds. |
Source code in src/zenml/integrations/azure/step_operators/azureml_step_operator.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
launch(info: StepRunInfo, entrypoint_command: List[str], environment: Dict[str, str]) -> None
Launches a step on AzureML.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
info
|
StepRunInfo
|
Information about the step run. |
required |
entrypoint_command
|
List[str]
|
Command that executes the step. |
required |
environment
|
Dict[str, str]
|
Environment variables to set in the step operator environment. |
required |
Source code in src/zenml/integrations/azure/step_operators/azureml_step_operator.py
162 163 164 165 166 167 168 169 170 171 172 173 174 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 |
|