Aws
zenml.integrations.aws
Integrates multiple AWS Tools as Stack Components.
The AWS integration provides a way for our users to manage their secrets through AWS, a way to use the aws container registry. Additionally, the Sagemaker integration submodule provides a way to run ZenML steps in Sagemaker.
Attributes
AWS = 'aws'
module-attribute
AWS_CONNECTOR_TYPE = 'aws'
module-attribute
AWS_CONTAINER_REGISTRY_FLAVOR = 'aws'
module-attribute
AWS_DEPLOYER_FLAVOR = 'aws'
module-attribute
AWS_IMAGE_BUILDER_FLAVOR = 'aws'
module-attribute
AWS_RESOURCE_TYPE = 'aws-generic'
module-attribute
AWS_SAGEMAKER_ORCHESTRATOR_FLAVOR = 'sagemaker'
module-attribute
AWS_SAGEMAKER_STEP_OPERATOR_FLAVOR = 'sagemaker'
module-attribute
AWS_SECRET_MANAGER_FLAVOR = 'aws'
module-attribute
S3_RESOURCE_TYPE = 's3-bucket'
module-attribute
Classes
AWSIntegration
Bases: Integration
Definition of AWS integration for ZenML.
Functions
activate() -> None
classmethod
Activate the AWS integration.
Source code in src/zenml/integrations/aws/__init__.py
51 52 53 54 |
|
flavors() -> List[Type[Flavor]]
classmethod
Declare the stack component flavors for the AWS integration.
Returns:
Type | Description |
---|---|
List[Type[Flavor]]
|
List of stack component flavors for this integration. |
Source code in src/zenml/integrations/aws/__init__.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
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 261 262 263 264 |
|
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
140 141 142 |
|
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
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 |
|
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
144 145 146 147 148 149 150 151 |
|
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
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
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
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
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
153 154 155 156 157 158 159 160 |
|
Modules
container_registries
Initialization of AWS Container Registry integration.
Classes
AWSContainerRegistry(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, environment: Optional[Dict[str, str]] = None, secrets: Optional[List[UUID]] = None, 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: BaseContainerRegistry
Class for AWS Container Registry.
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 386 387 388 389 390 391 392 393 |
|
config: AWSContainerRegistryConfig
property
Returns the AWSContainerRegistryConfig
config.
Returns:
Type | Description |
---|---|
AWSContainerRegistryConfig
|
The configuration. |
post_registration_message: Optional[str]
property
Optional message printed after the stack component is registered.
Returns:
Type | Description |
---|---|
Optional[str]
|
Info message regarding docker repositories in AWS. |
prepare_image_push(image_name: str) -> None
Logs warning message if trying to push an image for which no repository exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_name
|
str
|
Name of the docker image that will be pushed. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If the docker image name is invalid. |
Source code in src/zenml/integrations/aws/container_registries/aws_container_registry.py
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 |
|
Modules
aws_container_registry
Implementation of the AWS container registry integration.
AWSContainerRegistry(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, environment: Optional[Dict[str, str]] = None, secrets: Optional[List[UUID]] = None, 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: BaseContainerRegistry
Class for AWS Container Registry.
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 386 387 388 389 390 391 392 393 |
|
config: AWSContainerRegistryConfig
property
Returns the AWSContainerRegistryConfig
config.
Returns:
Type | Description |
---|---|
AWSContainerRegistryConfig
|
The configuration. |
post_registration_message: Optional[str]
property
Optional message printed after the stack component is registered.
Returns:
Type | Description |
---|---|
Optional[str]
|
Info message regarding docker repositories in AWS. |
prepare_image_push(image_name: str) -> None
Logs warning message if trying to push an image for which no repository exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_name
|
str
|
Name of the docker image that will be pushed. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If the docker image name is invalid. |
Source code in src/zenml/integrations/aws/container_registries/aws_container_registry.py
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 |
|
deployers
Initialization for the AWS deployer.
Classes
AWSDeployer(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, environment: Optional[Dict[str, str]] = None, secrets: Optional[List[UUID]] = None, 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: ContainerizedDeployer
Deployer responsible for deploying pipelines on AWS App Runner.
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 386 387 388 389 390 391 392 393 |
|
app_runner_client: Any
property
Get the App Runner client.
Returns:
Type | Description |
---|---|
Any
|
The App Runner client. |
config: AWSDeployerConfig
property
Returns the AWSDeployerConfig
config.
Returns:
Type | Description |
---|---|
AWSDeployerConfig
|
The configuration. |
logs_client: Any
property
Get the CloudWatch Logs client.
Returns:
Type | Description |
---|---|
Any
|
The CloudWatch Logs client. |
region: str
property
Get the AWS region.
Returns:
Type | Description |
---|---|
str
|
The AWS region. |
secrets_manager_client: Any
property
Get the Secrets Manager client.
Returns:
Type | Description |
---|---|
Any
|
The Secrets Manager client. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the AWS deployer.
Returns:
Type | Description |
---|---|
Optional[Type[BaseSettings]]
|
The settings class. |
validator: Optional[StackValidator]
property
Ensures there is an image builder in the stack.
Returns:
Type | Description |
---|---|
Optional[StackValidator]
|
A |
do_deprovision_deployment(deployment: DeploymentResponse, timeout: int) -> Optional[DeploymentOperationalState]
Deprovision an App Runner deployment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
DeploymentResponse
|
The deployment to deprovision. |
required |
timeout
|
int
|
The maximum time in seconds to wait for the pipeline deployment to be deprovisioned. |
required |
Returns:
Type | Description |
---|---|
Optional[DeploymentOperationalState]
|
The operational state of the deprovisioned deployment, or None if |
Optional[DeploymentOperationalState]
|
deletion is completed immediately. |
Raises:
Type | Description |
---|---|
DeploymentNotFoundError
|
If the deployment is not found. |
DeploymentDeprovisionError
|
If the deprovision fails. |
DeployerError
|
If an unexpected error occurs. |
RuntimeError
|
If the service ARN is not found in the deployment metadata. |
Source code in src/zenml/integrations/aws/deployers/aws_deployer.py
1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 |
|
do_get_deployment_state(deployment: DeploymentResponse) -> DeploymentOperationalState
Get information about an App Runner deployment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
DeploymentResponse
|
The deployment to get information about. |
required |
Returns:
Type | Description |
---|---|
DeploymentOperationalState
|
The operational state of the deployment. |
Raises:
Type | Description |
---|---|
DeploymentNotFoundError
|
If the deployment is not found. |
RuntimeError
|
If the service ARN is not found in the deployment metadata. |
Source code in src/zenml/integrations/aws/deployers/aws_deployer.py
1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 |
|
do_get_deployment_state_logs(deployment: DeploymentResponse, follow: bool = False, tail: Optional[int] = None) -> Generator[str, bool, None]
Get the logs of an App Runner deployment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
DeploymentResponse
|
The deployment to get the logs of. |
required |
follow
|
bool
|
If True, stream logs as they are written. |
False
|
tail
|
Optional[int]
|
Only retrieve the last NUM lines of log output. |
None
|
Yields:
Type | Description |
---|---|
str
|
The logs of the deployment. |
Raises:
Type | Description |
---|---|
NotImplementedError
|
If log following is requested. |
DeploymentNotFoundError
|
If the deployment is not found. |
DeploymentLogsNotFoundError
|
If the logs are not found. |
DeployerError
|
If an unexpected error occurs. |
RuntimeError
|
If the service name is not found in the deployment metadata. |
Source code in src/zenml/integrations/aws/deployers/aws_deployer.py
1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 |
|
do_provision_deployment(deployment: DeploymentResponse, stack: Stack, environment: Dict[str, str], secrets: Dict[str, str], timeout: int) -> DeploymentOperationalState
Serve a pipeline as an App Runner service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
DeploymentResponse
|
The deployment to serve. |
required |
stack
|
Stack
|
The stack the pipeline will be deployed on. |
required |
environment
|
Dict[str, str]
|
Environment variables to set. |
required |
secrets
|
Dict[str, str]
|
Secret environment variables to set. |
required |
timeout
|
int
|
The maximum time in seconds to wait for the pipeline deployment to be provisioned. |
required |
Returns:
Type | Description |
---|---|
DeploymentOperationalState
|
The operational state of the provisioned deployment. |
Raises:
Type | Description |
---|---|
DeploymentProvisionError
|
If the deployment fails. |
DeploymentDeprovisionError
|
If the previous deployment fails to deprovision. |
DeployerError
|
If an unexpected error occurs. |
Source code in src/zenml/integrations/aws/deployers/aws_deployer.py
1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 |
|
get_tags(deployment: DeploymentResponse, settings: AWSDeployerSettings) -> List[Dict[str, str]]
Get the tags for a deployment to be used for AWS resources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
DeploymentResponse
|
The deployment. |
required |
settings
|
AWSDeployerSettings
|
The deployer settings. |
required |
Returns:
Type | Description |
---|---|
List[Dict[str, str]]
|
The tags for the deployment. |
Source code in src/zenml/integrations/aws/deployers/aws_deployer.py
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
|
Modules
aws_deployer
Implementation of the AWS App Runner deployer.
AWSDeployer(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, environment: Optional[Dict[str, str]] = None, secrets: Optional[List[UUID]] = None, 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: ContainerizedDeployer
Deployer responsible for deploying pipelines on AWS App Runner.
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 386 387 388 389 390 391 392 393 |
|
app_runner_client: Any
property
Get the App Runner client.
Returns:
Type | Description |
---|---|
Any
|
The App Runner client. |
config: AWSDeployerConfig
property
Returns the AWSDeployerConfig
config.
Returns:
Type | Description |
---|---|
AWSDeployerConfig
|
The configuration. |
logs_client: Any
property
Get the CloudWatch Logs client.
Returns:
Type | Description |
---|---|
Any
|
The CloudWatch Logs client. |
region: str
property
Get the AWS region.
Returns:
Type | Description |
---|---|
str
|
The AWS region. |
secrets_manager_client: Any
property
Get the Secrets Manager client.
Returns:
Type | Description |
---|---|
Any
|
The Secrets Manager client. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the AWS deployer.
Returns:
Type | Description |
---|---|
Optional[Type[BaseSettings]]
|
The settings class. |
validator: Optional[StackValidator]
property
Ensures there is an image builder in the stack.
Returns:
Type | Description |
---|---|
Optional[StackValidator]
|
A |
do_deprovision_deployment(deployment: DeploymentResponse, timeout: int) -> Optional[DeploymentOperationalState]
Deprovision an App Runner deployment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
DeploymentResponse
|
The deployment to deprovision. |
required |
timeout
|
int
|
The maximum time in seconds to wait for the pipeline deployment to be deprovisioned. |
required |
Returns:
Type | Description |
---|---|
Optional[DeploymentOperationalState]
|
The operational state of the deprovisioned deployment, or None if |
Optional[DeploymentOperationalState]
|
deletion is completed immediately. |
Raises:
Type | Description |
---|---|
DeploymentNotFoundError
|
If the deployment is not found. |
DeploymentDeprovisionError
|
If the deprovision fails. |
DeployerError
|
If an unexpected error occurs. |
RuntimeError
|
If the service ARN is not found in the deployment metadata. |
Source code in src/zenml/integrations/aws/deployers/aws_deployer.py
1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 |
|
do_get_deployment_state(deployment: DeploymentResponse) -> DeploymentOperationalState
Get information about an App Runner deployment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
DeploymentResponse
|
The deployment to get information about. |
required |
Returns:
Type | Description |
---|---|
DeploymentOperationalState
|
The operational state of the deployment. |
Raises:
Type | Description |
---|---|
DeploymentNotFoundError
|
If the deployment is not found. |
RuntimeError
|
If the service ARN is not found in the deployment metadata. |
Source code in src/zenml/integrations/aws/deployers/aws_deployer.py
1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 |
|
do_get_deployment_state_logs(deployment: DeploymentResponse, follow: bool = False, tail: Optional[int] = None) -> Generator[str, bool, None]
Get the logs of an App Runner deployment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
DeploymentResponse
|
The deployment to get the logs of. |
required |
follow
|
bool
|
If True, stream logs as they are written. |
False
|
tail
|
Optional[int]
|
Only retrieve the last NUM lines of log output. |
None
|
Yields:
Type | Description |
---|---|
str
|
The logs of the deployment. |
Raises:
Type | Description |
---|---|
NotImplementedError
|
If log following is requested. |
DeploymentNotFoundError
|
If the deployment is not found. |
DeploymentLogsNotFoundError
|
If the logs are not found. |
DeployerError
|
If an unexpected error occurs. |
RuntimeError
|
If the service name is not found in the deployment metadata. |
Source code in src/zenml/integrations/aws/deployers/aws_deployer.py
1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 |
|
do_provision_deployment(deployment: DeploymentResponse, stack: Stack, environment: Dict[str, str], secrets: Dict[str, str], timeout: int) -> DeploymentOperationalState
Serve a pipeline as an App Runner service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
DeploymentResponse
|
The deployment to serve. |
required |
stack
|
Stack
|
The stack the pipeline will be deployed on. |
required |
environment
|
Dict[str, str]
|
Environment variables to set. |
required |
secrets
|
Dict[str, str]
|
Secret environment variables to set. |
required |
timeout
|
int
|
The maximum time in seconds to wait for the pipeline deployment to be provisioned. |
required |
Returns:
Type | Description |
---|---|
DeploymentOperationalState
|
The operational state of the provisioned deployment. |
Raises:
Type | Description |
---|---|
DeploymentProvisionError
|
If the deployment fails. |
DeploymentDeprovisionError
|
If the previous deployment fails to deprovision. |
DeployerError
|
If an unexpected error occurs. |
Source code in src/zenml/integrations/aws/deployers/aws_deployer.py
1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 |
|
get_tags(deployment: DeploymentResponse, settings: AWSDeployerSettings) -> List[Dict[str, str]]
Get the tags for a deployment to be used for AWS resources.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
DeploymentResponse
|
The deployment. |
required |
settings
|
AWSDeployerSettings
|
The deployer settings. |
required |
Returns:
Type | Description |
---|---|
List[Dict[str, str]]
|
The tags for the deployment. |
Source code in src/zenml/integrations/aws/deployers/aws_deployer.py
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
|
AppRunnerDeploymentMetadata
Bases: BaseModel
Metadata for an App Runner deployment.
from_app_runner_service(service: Dict[str, Any], region: str, secret_arn: Optional[str] = None) -> AppRunnerDeploymentMetadata
classmethod
Create metadata from an App Runner service.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
service
|
Dict[str, Any]
|
The App Runner service dictionary from describe_service. |
required |
region
|
str
|
The AWS region. |
required |
secret_arn
|
Optional[str]
|
The AWS Secrets Manager secret ARN for the deployment. |
None
|
Returns:
Type | Description |
---|---|
AppRunnerDeploymentMetadata
|
The metadata for the App Runner service. |
Source code in src/zenml/integrations/aws/deployers/aws_deployer.py
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 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 |
|
from_deployment(deployment: DeploymentResponse) -> AppRunnerDeploymentMetadata
classmethod
Create metadata from a deployment.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
deployment
|
DeploymentResponse
|
The deployment to get the metadata for. |
required |
Returns:
Type | Description |
---|---|
AppRunnerDeploymentMetadata
|
The metadata for the deployment. |
Source code in src/zenml/integrations/aws/deployers/aws_deployer.py
240 241 242 243 244 245 246 247 248 249 250 251 252 |
|
flavors
AWS integration flavors.
Classes
AWSContainerRegistryConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseContainerRegistryConfig
Configuration for AWS Container Registry.
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 |
|
validate_aws_uri(uri: str) -> str
classmethod
Validates that the URI is in the correct format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uri
|
str
|
URI to validate. |
required |
Returns:
Type | Description |
---|---|
str
|
URI in the correct format. |
Raises:
Type | Description |
---|---|
ValueError
|
If the URI contains a slash character. |
Source code in src/zenml/integrations/aws/flavors/aws_container_registry_flavor.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
AWSContainerRegistryFlavor
Bases: BaseContainerRegistryFlavor
AWS Container Registry flavor.
config_class: Type[AWSContainerRegistryConfig]
property
Config class for this flavor.
Returns:
Type | Description |
---|---|
Type[AWSContainerRegistryConfig]
|
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[AWSContainerRegistry]
property
Implementation class.
Returns:
Type | Description |
---|---|
Type[AWSContainerRegistry]
|
The implementation class. |
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. |
AWSDeployerConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseDeployerConfig
, AWSDeployerSettings
Configuration for the AWS App Runner deployer.
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. |
AWSDeployerFlavor
Bases: BaseDeployerFlavor
AWS App Runner deployer flavor.
config_class: Type[AWSDeployerConfig]
property
Returns the AWSDeployerConfig config class.
Returns:
Type | Description |
---|---|
Type[AWSDeployerConfig]
|
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[AWSDeployer]
property
Implementation class for this flavor.
Returns:
Type | Description |
---|---|
Type[AWSDeployer]
|
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 deployer flavor.
Returns:
Type | Description |
---|---|
str
|
Name of the deployer 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. |
AWSImageBuilderConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseImageBuilderConfig
AWS Code Build image builder configuration.
Attributes:
Name | Type | Description |
---|---|---|
code_build_project |
str
|
The name of an existing AWS CodeBuild project to use to build the image. The CodeBuild project must exist in the AWS account and region inferred from the AWS service connector credentials or implicitly from the local AWS config. |
build_image |
str
|
The Docker image to use for the AWS CodeBuild environment. The image must have Docker installed and be able to run Docker commands. The default image is bentolor/docker-dind-awscli. This can be customized to use a mirror, if needed, in case the Dockerhub image is not accessible or rate-limited. |
custom_env_vars |
Optional[Dict[str, str]]
|
Custom environment variables to pass to the AWS CodeBuild build. |
compute_type |
str
|
The compute type to use for the AWS CodeBuild build. The default is BUILD_GENERAL1_SMALL. |
implicit_container_registry_auth |
bool
|
Whether to use implicit authentication to authenticate the AWS Code Build build to the container registry when pushing container images. If set to False, the container registry credentials must be explicitly configured for the container registry stack component or the container registry stack component must be linked to a service connector. NOTE: When implicit_container_registry_auth is set to False, the container registry credentials will be passed to the AWS Code Build build as environment variables. This is not recommended for production use unless your service connector is configured to generate short-lived credentials. |
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 |
|
AWSImageBuilderFlavor
Bases: BaseImageBuilderFlavor
AWS Code Build image builder flavor.
config_class: Type[BaseImageBuilderConfig]
property
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[AWSImageBuilder]
property
logo_url: str
property
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
str
|
The flavor logo. |
name: str
property
The flavor name.
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. |
SagemakerOrchestratorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseOrchestratorConfig
, SagemakerOrchestratorSettings
Config for the Sagemaker orchestrator.
There are three ways to authenticate to AWS:
- By connecting a ServiceConnector
to the orchestrator,
- By configuring explicit AWS credentials aws_access_key_id
,
aws_secret_access_key
, and optional aws_auth_role_arn
,
- If none of the above are provided, unspecified credentials will be
loaded from the default AWS config.
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 synchronous or not.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator runs synchronous or not. |
SagemakerOrchestratorFlavor
Bases: BaseOrchestratorFlavor
Flavor for the Sagemaker orchestrator.
config_class: Type[SagemakerOrchestratorConfig]
property
Returns SagemakerOrchestratorConfig config class.
Returns:
Type | Description |
---|---|
Type[SagemakerOrchestratorConfig]
|
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[SagemakerOrchestrator]
property
Implementation class.
Returns:
Type | Description |
---|---|
Type[SagemakerOrchestrator]
|
The implementation class. |
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. |
SagemakerStepOperatorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseStepOperatorConfig
, SagemakerStepOperatorSettings
Config for the Sagemaker step operator.
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. |
SagemakerStepOperatorFlavor
Bases: BaseStepOperatorFlavor
Flavor for the Sagemaker step operator.
config_class: Type[SagemakerStepOperatorConfig]
property
Returns SagemakerStepOperatorConfig config class.
Returns:
Type | Description |
---|---|
Type[SagemakerStepOperatorConfig]
|
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[SagemakerStepOperator]
property
Implementation class.
Returns:
Type | Description |
---|---|
Type[SagemakerStepOperator]
|
The implementation class. |
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. |
Modules
aws_container_registry_flavor
AWS container registry flavor.
AWSContainerRegistryConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseContainerRegistryConfig
Configuration for AWS Container Registry.
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 |
|
validate_aws_uri(uri: str) -> str
classmethod
Validates that the URI is in the correct format.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uri
|
str
|
URI to validate. |
required |
Returns:
Type | Description |
---|---|
str
|
URI in the correct format. |
Raises:
Type | Description |
---|---|
ValueError
|
If the URI contains a slash character. |
Source code in src/zenml/integrations/aws/flavors/aws_container_registry_flavor.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
AWSContainerRegistryFlavor
Bases: BaseContainerRegistryFlavor
AWS Container Registry flavor.
config_class: Type[AWSContainerRegistryConfig]
property
Config class for this flavor.
Returns:
Type | Description |
---|---|
Type[AWSContainerRegistryConfig]
|
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[AWSContainerRegistry]
property
Implementation class.
Returns:
Type | Description |
---|---|
Type[AWSContainerRegistry]
|
The implementation class. |
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. |
aws_deployer_flavor
AWS App Runner deployer flavor.
AWSDeployerConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseDeployerConfig
, AWSDeployerSettings
Configuration for the AWS App Runner deployer.
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. |
AWSDeployerFlavor
Bases: BaseDeployerFlavor
AWS App Runner deployer flavor.
config_class: Type[AWSDeployerConfig]
property
Returns the AWSDeployerConfig config class.
Returns:
Type | Description |
---|---|
Type[AWSDeployerConfig]
|
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[AWSDeployer]
property
Implementation class for this flavor.
Returns:
Type | Description |
---|---|
Type[AWSDeployer]
|
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 deployer flavor.
Returns:
Type | Description |
---|---|
str
|
Name of the deployer 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. |
AWSDeployerSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseDeployerSettings
Settings for the AWS App Runner deployer.
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 |
|
aws_image_builder_flavor
AWS Code Build image builder flavor.
AWSImageBuilderConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseImageBuilderConfig
AWS Code Build image builder configuration.
Attributes:
Name | Type | Description |
---|---|---|
code_build_project |
str
|
The name of an existing AWS CodeBuild project to use to build the image. The CodeBuild project must exist in the AWS account and region inferred from the AWS service connector credentials or implicitly from the local AWS config. |
build_image |
str
|
The Docker image to use for the AWS CodeBuild environment. The image must have Docker installed and be able to run Docker commands. The default image is bentolor/docker-dind-awscli. This can be customized to use a mirror, if needed, in case the Dockerhub image is not accessible or rate-limited. |
custom_env_vars |
Optional[Dict[str, str]]
|
Custom environment variables to pass to the AWS CodeBuild build. |
compute_type |
str
|
The compute type to use for the AWS CodeBuild build. The default is BUILD_GENERAL1_SMALL. |
implicit_container_registry_auth |
bool
|
Whether to use implicit authentication to authenticate the AWS Code Build build to the container registry when pushing container images. If set to False, the container registry credentials must be explicitly configured for the container registry stack component or the container registry stack component must be linked to a service connector. NOTE: When implicit_container_registry_auth is set to False, the container registry credentials will be passed to the AWS Code Build build as environment variables. This is not recommended for production use unless your service connector is configured to generate short-lived credentials. |
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 |
|
AWSImageBuilderFlavor
Bases: BaseImageBuilderFlavor
AWS Code Build image builder flavor.
config_class: Type[BaseImageBuilderConfig]
property
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[AWSImageBuilder]
property
logo_url: str
property
A url to represent the flavor in the dashboard.
Returns:
Type | Description |
---|---|
str
|
The flavor logo. |
name: str
property
The flavor name.
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. |
sagemaker_orchestrator_flavor
Amazon SageMaker orchestrator flavor.
SagemakerOrchestratorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseOrchestratorConfig
, SagemakerOrchestratorSettings
Config for the Sagemaker orchestrator.
There are three ways to authenticate to AWS:
- By connecting a ServiceConnector
to the orchestrator,
- By configuring explicit AWS credentials aws_access_key_id
,
aws_secret_access_key
, and optional aws_auth_role_arn
,
- If none of the above are provided, unspecified credentials will be
loaded from the default AWS config.
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 synchronous or not.
Returns:
Type | Description |
---|---|
bool
|
Whether the orchestrator runs synchronous or not. |
SagemakerOrchestratorFlavor
Bases: BaseOrchestratorFlavor
Flavor for the Sagemaker orchestrator.
config_class: Type[SagemakerOrchestratorConfig]
property
Returns SagemakerOrchestratorConfig config class.
Returns:
Type | Description |
---|---|
Type[SagemakerOrchestratorConfig]
|
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[SagemakerOrchestrator]
property
Implementation class.
Returns:
Type | Description |
---|---|
Type[SagemakerOrchestrator]
|
The implementation class. |
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. |
SagemakerOrchestratorSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseSettings
Settings for the Sagemaker 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 |
|
validate_model(data: Dict[str, Any]) -> Dict[str, Any]
Check if model is configured correctly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Dict[str, Any]
|
The model data. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The validated model data. |
Raises:
Type | Description |
---|---|
ValueError
|
If the model is configured incorrectly. |
Source code in src/zenml/integrations/aws/flavors/sagemaker_orchestrator_flavor.py
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 |
|
sagemaker_step_operator_flavor
Amazon SageMaker step operator flavor.
SagemakerStepOperatorConfig(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseStepOperatorConfig
, SagemakerStepOperatorSettings
Config for the Sagemaker step operator.
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. |
SagemakerStepOperatorFlavor
Bases: BaseStepOperatorFlavor
Flavor for the Sagemaker step operator.
config_class: Type[SagemakerStepOperatorConfig]
property
Returns SagemakerStepOperatorConfig config class.
Returns:
Type | Description |
---|---|
Type[SagemakerStepOperatorConfig]
|
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[SagemakerStepOperator]
property
Implementation class.
Returns:
Type | Description |
---|---|
Type[SagemakerStepOperator]
|
The implementation class. |
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. |
SagemakerStepOperatorSettings(warn_about_plain_text_secrets: bool = False, **kwargs: Any)
Bases: BaseSettings
Settings for the Sagemaker step operator.
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 |
|
image_builders
Initialization for the AWS image builder.
Classes
AWSImageBuilder(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, environment: Optional[Dict[str, str]] = None, secrets: Optional[List[UUID]] = None, 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: BaseImageBuilder
AWS Code Build image builder implementation.
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 386 387 388 389 390 391 392 393 |
|
code_build_client: Any
property
The authenticated AWS Code Build client to use for interacting with AWS services.
Returns:
Type | Description |
---|---|
Any
|
The authenticated AWS Code Build client. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the AWS Code Build client cannot be created. |
config: AWSImageBuilderConfig
property
The stack component configuration.
Returns:
Type | Description |
---|---|
AWSImageBuilderConfig
|
The configuration. |
is_building_locally: bool
property
Whether the image builder builds the images on the client machine.
Returns:
Type | Description |
---|---|
bool
|
True if the image builder builds locally, False otherwise. |
validator: Optional[StackValidator]
property
Validates the stack for the AWS Code Build Image Builder.
The AWS Code Build Image Builder requires a container registry to push the image to and an S3 Artifact Store to upload the build context, so AWS Code Build can access it.
Returns:
Type | Description |
---|---|
Optional[StackValidator]
|
Stack validator. |
build(image_name: str, build_context: BuildContext, docker_build_options: Dict[str, Any], container_registry: Optional[BaseContainerRegistry] = None) -> str
Builds and pushes a Docker image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_name
|
str
|
Name of the image to build and push. |
required |
build_context
|
BuildContext
|
The build context to use for the image. |
required |
docker_build_options
|
Dict[str, Any]
|
Docker build options. |
required |
container_registry
|
Optional[BaseContainerRegistry]
|
Optional container registry to push to. |
None
|
Returns:
Type | Description |
---|---|
str
|
The Docker image name with digest. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If no container registry is passed. |
RuntimeError
|
If the Cloud Build build fails. |
Source code in src/zenml/integrations/aws/image_builders/aws_image_builder.py
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 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 |
|
Modules
aws_image_builder
AWS Code Build image builder implementation.
AWSImageBuilder(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, environment: Optional[Dict[str, str]] = None, secrets: Optional[List[UUID]] = None, 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: BaseImageBuilder
AWS Code Build image builder implementation.
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 386 387 388 389 390 391 392 393 |
|
code_build_client: Any
property
The authenticated AWS Code Build client to use for interacting with AWS services.
Returns:
Type | Description |
---|---|
Any
|
The authenticated AWS Code Build client. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the AWS Code Build client cannot be created. |
config: AWSImageBuilderConfig
property
The stack component configuration.
Returns:
Type | Description |
---|---|
AWSImageBuilderConfig
|
The configuration. |
is_building_locally: bool
property
Whether the image builder builds the images on the client machine.
Returns:
Type | Description |
---|---|
bool
|
True if the image builder builds locally, False otherwise. |
validator: Optional[StackValidator]
property
Validates the stack for the AWS Code Build Image Builder.
The AWS Code Build Image Builder requires a container registry to push the image to and an S3 Artifact Store to upload the build context, so AWS Code Build can access it.
Returns:
Type | Description |
---|---|
Optional[StackValidator]
|
Stack validator. |
build(image_name: str, build_context: BuildContext, docker_build_options: Dict[str, Any], container_registry: Optional[BaseContainerRegistry] = None) -> str
Builds and pushes a Docker image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_name
|
str
|
Name of the image to build and push. |
required |
build_context
|
BuildContext
|
The build context to use for the image. |
required |
docker_build_options
|
Dict[str, Any]
|
Docker build options. |
required |
container_registry
|
Optional[BaseContainerRegistry]
|
Optional container registry to push to. |
None
|
Returns:
Type | Description |
---|---|
str
|
The Docker image name with digest. |
Raises:
Type | Description |
---|---|
RuntimeError
|
If no container registry is passed. |
RuntimeError
|
If the Cloud Build build fails. |
Source code in src/zenml/integrations/aws/image_builders/aws_image_builder.py
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 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 |
|
orchestrators
AWS Sagemaker orchestrator.
Classes
SagemakerOrchestrator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, environment: Optional[Dict[str, str]] = None, secrets: Optional[List[UUID]] = None, 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 Sagemaker.
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 386 387 388 389 390 391 392 393 |
|
config: SagemakerOrchestratorConfig
property
Returns the SagemakerOrchestratorConfig
config.
Returns:
Type | Description |
---|---|
SagemakerOrchestratorConfig
|
The configuration. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the Sagemaker 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(execution_arn: str, settings: SagemakerOrchestratorSettings) -> Dict[str, MetadataType]
Generate run metadata based on the generated Sagemaker Execution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
execution_arn
|
str
|
The ARN of the pipeline execution. |
required |
settings
|
SagemakerOrchestratorSettings
|
The Sagemaker orchestrator settings. |
required |
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
A dictionary of metadata related to the pipeline run. |
Source code in src/zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py
880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 |
|
fetch_status(run: PipelineRunResponse, include_steps: bool = False) -> Tuple[Optional[ExecutionStatus], Optional[Dict[str, 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 |
include_steps
|
bool
|
Whether to fetch steps |
False
|
Returns:
Type | Description |
---|---|
Optional[ExecutionStatus]
|
A tuple of (pipeline_status, step_statuses_dict). |
Optional[Dict[str, ExecutionStatus]]
|
Step statuses are not supported for SageMaker, so step_statuses_dict will always be None. |
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/aws/orchestrators/sagemaker_orchestrator.py
811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 |
|
generate_schedule_metadata(schedule_arn: str) -> Dict[str, MetadataType]
staticmethod
Attaches metadata to the ZenML Schedules.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schedule_arn
|
str
|
The trigger ARNs that is generated on the AWS side. |
required |
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
a dictionary containing metadata related to the schedule. |
Source code in src/zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py
989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 |
|
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/aws/orchestrators/sagemaker_orchestrator.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
|
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/aws/orchestrators/sagemaker_orchestrator.py
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 |
|
submit_pipeline(snapshot: PipelineSnapshotResponse, stack: Stack, base_environment: Dict[str, str], step_environments: Dict[str, Dict[str, str]], placeholder_run: Optional[PipelineRunResponse] = None) -> Optional[SubmissionResult]
Submits a pipeline to the orchestrator.
This method should only submit the pipeline and not wait for it to complete. If the orchestrator is configured to wait for the pipeline run to complete, a function that waits for the pipeline run to complete can be passed as part of the submission result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
snapshot
|
PipelineSnapshotResponse
|
The pipeline snapshot to submit. |
required |
stack
|
Stack
|
The stack the pipeline will run on. |
required |
base_environment
|
Dict[str, str]
|
Base environment shared by all steps. This should be set if your orchestrator for example runs one container that is responsible for starting all the steps. |
required |
step_environments
|
Dict[str, Dict[str, str]]
|
Environment variables to set when executing specific steps. |
required |
placeholder_run
|
Optional[PipelineRunResponse]
|
An optional placeholder run for the snapshot. |
None
|
Raises:
Type | Description |
---|---|
RuntimeError
|
If there is an error creating or scheduling the pipeline. |
TypeError
|
If the network_config passed is not compatible with the AWS SageMaker NetworkConfig class. |
ValueError
|
If the schedule is not valid. |
Returns:
Type | Description |
---|---|
Optional[SubmissionResult]
|
Optional submission result. |
Source code in src/zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py
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 407 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 444 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 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 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 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 |
|
Modules
sagemaker_orchestrator
Implementation of the SageMaker orchestrator.
SagemakerOrchestrator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, environment: Optional[Dict[str, str]] = None, secrets: Optional[List[UUID]] = None, 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 Sagemaker.
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 386 387 388 389 390 391 392 393 |
|
config: SagemakerOrchestratorConfig
property
Returns the SagemakerOrchestratorConfig
config.
Returns:
Type | Description |
---|---|
SagemakerOrchestratorConfig
|
The configuration. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the Sagemaker 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(execution_arn: str, settings: SagemakerOrchestratorSettings) -> Dict[str, MetadataType]
Generate run metadata based on the generated Sagemaker Execution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
execution_arn
|
str
|
The ARN of the pipeline execution. |
required |
settings
|
SagemakerOrchestratorSettings
|
The Sagemaker orchestrator settings. |
required |
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
A dictionary of metadata related to the pipeline run. |
Source code in src/zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py
880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 |
|
fetch_status(run: PipelineRunResponse, include_steps: bool = False) -> Tuple[Optional[ExecutionStatus], Optional[Dict[str, 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 |
include_steps
|
bool
|
Whether to fetch steps |
False
|
Returns:
Type | Description |
---|---|
Optional[ExecutionStatus]
|
A tuple of (pipeline_status, step_statuses_dict). |
Optional[Dict[str, ExecutionStatus]]
|
Step statuses are not supported for SageMaker, so step_statuses_dict will always be None. |
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/aws/orchestrators/sagemaker_orchestrator.py
811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 |
|
generate_schedule_metadata(schedule_arn: str) -> Dict[str, MetadataType]
staticmethod
Attaches metadata to the ZenML Schedules.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schedule_arn
|
str
|
The trigger ARNs that is generated on the AWS side. |
required |
Returns:
Type | Description |
---|---|
Dict[str, MetadataType]
|
a dictionary containing metadata related to the schedule. |
Source code in src/zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py
989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 |
|
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/aws/orchestrators/sagemaker_orchestrator.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
|
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/aws/orchestrators/sagemaker_orchestrator.py
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 |
|
submit_pipeline(snapshot: PipelineSnapshotResponse, stack: Stack, base_environment: Dict[str, str], step_environments: Dict[str, Dict[str, str]], placeholder_run: Optional[PipelineRunResponse] = None) -> Optional[SubmissionResult]
Submits a pipeline to the orchestrator.
This method should only submit the pipeline and not wait for it to complete. If the orchestrator is configured to wait for the pipeline run to complete, a function that waits for the pipeline run to complete can be passed as part of the submission result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
snapshot
|
PipelineSnapshotResponse
|
The pipeline snapshot to submit. |
required |
stack
|
Stack
|
The stack the pipeline will run on. |
required |
base_environment
|
Dict[str, str]
|
Base environment shared by all steps. This should be set if your orchestrator for example runs one container that is responsible for starting all the steps. |
required |
step_environments
|
Dict[str, Dict[str, str]]
|
Environment variables to set when executing specific steps. |
required |
placeholder_run
|
Optional[PipelineRunResponse]
|
An optional placeholder run for the snapshot. |
None
|
Raises:
Type | Description |
---|---|
RuntimeError
|
If there is an error creating or scheduling the pipeline. |
TypeError
|
If the network_config passed is not compatible with the AWS SageMaker NetworkConfig class. |
ValueError
|
If the schedule is not valid. |
Returns:
Type | Description |
---|---|
Optional[SubmissionResult]
|
Optional submission result. |
Source code in src/zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py
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 407 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 444 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 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 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 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 |
|
dissect_pipeline_execution_arn(pipeline_execution_arn: str) -> Tuple[Optional[str], Optional[str], Optional[str]]
Extract region name, pipeline name, and execution id from the ARN.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pipeline_execution_arn
|
str
|
the pipeline execution ARN |
required |
Returns:
Type | Description |
---|---|
Tuple[Optional[str], Optional[str], Optional[str]]
|
Region Name, Pipeline Name, Execution ID in order |
Source code in src/zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py
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 |
|
dissect_schedule_arn(schedule_arn: str) -> Tuple[Optional[str], Optional[str]]
Extracts the region and the name from an EventBridge schedule ARN.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
schedule_arn
|
str
|
The ARN of the EventBridge schedule. |
required |
Returns:
Type | Description |
---|---|
Tuple[Optional[str], Optional[str]]
|
Region Name, Schedule Name (including the group name) |
Raises:
Type | Description |
---|---|
ValueError
|
If the input is not a properly formatted ARN. |
Source code in src/zenml/integrations/aws/orchestrators/sagemaker_orchestrator.py
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 |
|
sagemaker_orchestrator_entrypoint_config
Entrypoint configuration for ZenML Sagemaker pipeline steps.
SagemakerEntrypointConfiguration(arguments: List[str])
Bases: StepEntrypointConfiguration
Entrypoint configuration for ZenML Sagemaker pipeline steps.
The only purpose of this entrypoint configuration is to reconstruct the environment variables that exceed the maximum length of 256 characters allowed for Sagemaker Processor steps from their individual components.
Source code in src/zenml/entrypoints/base_entrypoint_configuration.py
60 61 62 63 64 65 66 |
|
run() -> None
Runs the step.
Source code in src/zenml/integrations/aws/orchestrators/sagemaker_orchestrator_entrypoint_config.py
32 33 34 35 36 37 38 39 |
|
service_connectors
AWS Service Connector.
Classes
AWSServiceConnector(**kwargs: Any)
Bases: ServiceConnector
AWS service connector.
Source code in src/zenml/service_connectors/service_connector.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 |
|
account_id: str
property
Get the AWS account ID.
Returns:
Type | Description |
---|---|
str
|
The AWS account ID. |
Raises:
Type | Description |
---|---|
AuthorizationException
|
If the AWS account ID could not be determined. |
get_boto3_session(auth_method: str, resource_type: Optional[str] = None, resource_id: Optional[str] = None) -> Tuple[boto3.Session, Optional[datetime.datetime]]
Get a boto3 session 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 boto3 session for. |
None
|
resource_id
|
Optional[str]
|
The resource ID to get a boto3 session for. |
None
|
Returns:
Type | Description |
---|---|
Session
|
A boto3 session for the specified resource and its expiration |
Optional[datetime]
|
timestamp, if applicable. |
Source code in src/zenml/integrations/aws/service_connectors/aws_service_connector.py
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 |
|
get_ecr_client() -> BaseClient
Get an ECR client.
Raises:
Type | Description |
---|---|
ValueError
|
If the service connector is not able to instantiate an ECR client. |
Returns:
Type | Description |
---|---|
BaseClient
|
An ECR client. |
Source code in src/zenml/integrations/aws/service_connectors/aws_service_connector.py
734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 |
|
Modules
aws_service_connector
AWS Service Connector.
The AWS Service Connector implements various authentication methods for AWS services:
- Explicit AWS secret key (access key, secret key)
- Explicit AWS STS tokens (access key, secret key, session token)
- IAM roles (i.e. generating temporary STS tokens on the fly by assuming an IAM role)
- IAM user federation tokens
- STS Session tokens
AWSAuthenticationMethods
AWSBaseConfig
AWSImplicitConfig
AWSSecretKey
AWSSecretKeyConfig
AWSServiceConnector(**kwargs: Any)
Bases: ServiceConnector
AWS service connector.
Source code in src/zenml/service_connectors/service_connector.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 |
|
account_id: str
property
Get the AWS account ID.
Returns:
Type | Description |
---|---|
str
|
The AWS account ID. |
Raises:
Type | Description |
---|---|
AuthorizationException
|
If the AWS account ID could not be determined. |
get_boto3_session(auth_method: str, resource_type: Optional[str] = None, resource_id: Optional[str] = None) -> Tuple[boto3.Session, Optional[datetime.datetime]]
Get a boto3 session 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 boto3 session for. |
None
|
resource_id
|
Optional[str]
|
The resource ID to get a boto3 session for. |
None
|
Returns:
Type | Description |
---|---|
Session
|
A boto3 session for the specified resource and its expiration |
Optional[datetime]
|
timestamp, if applicable. |
Source code in src/zenml/integrations/aws/service_connectors/aws_service_connector.py
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 |
|
get_ecr_client() -> BaseClient
Get an ECR client.
Raises:
Type | Description |
---|---|
ValueError
|
If the service connector is not able to instantiate an ECR client. |
Returns:
Type | Description |
---|---|
BaseClient
|
An ECR client. |
Source code in src/zenml/integrations/aws/service_connectors/aws_service_connector.py
734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 |
|
AWSSessionPolicy
FederationTokenAuthenticationConfig
IAMRoleAuthenticationConfig
STSToken
STSTokenConfig
SessionTokenAuthenticationConfig
step_operators
Initialization of the Sagemaker Step Operator.
Classes
SagemakerStepOperator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, environment: Optional[Dict[str, str]] = None, secrets: Optional[List[UUID]] = None, 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 Sagemaker.
This class defines code that builds an image with the ZenML entrypoint to run using Sagemaker's Estimator.
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 386 387 388 389 390 391 392 393 |
|
config: SagemakerStepOperatorConfig
property
Returns the SagemakerStepOperatorConfig
config.
Returns:
Type | Description |
---|---|
SagemakerStepOperatorConfig
|
The configuration. |
entrypoint_config_class: Type[StepOperatorEntrypointConfiguration]
property
Returns the entrypoint configuration class for this step operator.
Returns:
Type | Description |
---|---|
Type[StepOperatorEntrypointConfiguration]
|
The entrypoint configuration class for this step operator. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the SageMaker 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(snapshot: PipelineSnapshotBase) -> List[BuildConfiguration]
Gets the Docker builds required for the component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The pipeline snapshot for which to get the builds. |
required |
Returns:
Type | Description |
---|---|
List[BuildConfiguration]
|
The required Docker builds. |
Source code in src/zenml/integrations/aws/step_operators/sagemaker_step_operator.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
launch(info: StepRunInfo, entrypoint_command: List[str], environment: Dict[str, str]) -> None
Launches a step on SageMaker.
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 |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the connector returns an object that is not a
|
Source code in src/zenml/integrations/aws/step_operators/sagemaker_step_operator.py
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 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 |
|
Modules
sagemaker_step_operator
Implementation of the Sagemaker Step Operator.
SagemakerStepOperator(name: str, id: UUID, config: StackComponentConfig, flavor: str, type: StackComponentType, user: Optional[UUID], created: datetime, updated: datetime, environment: Optional[Dict[str, str]] = None, secrets: Optional[List[UUID]] = None, 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 Sagemaker.
This class defines code that builds an image with the ZenML entrypoint to run using Sagemaker's Estimator.
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 386 387 388 389 390 391 392 393 |
|
config: SagemakerStepOperatorConfig
property
Returns the SagemakerStepOperatorConfig
config.
Returns:
Type | Description |
---|---|
SagemakerStepOperatorConfig
|
The configuration. |
entrypoint_config_class: Type[StepOperatorEntrypointConfiguration]
property
Returns the entrypoint configuration class for this step operator.
Returns:
Type | Description |
---|---|
Type[StepOperatorEntrypointConfiguration]
|
The entrypoint configuration class for this step operator. |
settings_class: Optional[Type[BaseSettings]]
property
Settings class for the SageMaker 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(snapshot: PipelineSnapshotBase) -> List[BuildConfiguration]
Gets the Docker builds required for the component.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The pipeline snapshot for which to get the builds. |
required |
Returns:
Type | Description |
---|---|
List[BuildConfiguration]
|
The required Docker builds. |
Source code in src/zenml/integrations/aws/step_operators/sagemaker_step_operator.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
launch(info: StepRunInfo, entrypoint_command: List[str], environment: Dict[str, str]) -> None
Launches a step on SageMaker.
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 |
Raises:
Type | Description |
---|---|
RuntimeError
|
If the connector returns an object that is not a
|
Source code in src/zenml/integrations/aws/step_operators/sagemaker_step_operator.py
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 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 |
|
sagemaker_step_operator_entrypoint_config
Entrypoint configuration for ZenML Sagemaker step operator.
SagemakerEntrypointConfiguration(arguments: List[str])
Bases: StepOperatorEntrypointConfiguration
Entrypoint configuration for ZenML Sagemaker step operator.
The only purpose of this entrypoint configuration is to reconstruct the environment variables that exceed the maximum length of 512 characters allowed for Sagemaker Estimator steps from their individual components.
Source code in src/zenml/entrypoints/base_entrypoint_configuration.py
60 61 62 63 64 65 66 |
|
run() -> None
Runs the step.
Source code in src/zenml/integrations/aws/step_operators/sagemaker_step_operator_entrypoint_config.py
32 33 34 35 36 37 38 39 |
|