Pipelines
zenml.pipelines
Attributes
__all__ = ['pipeline', 'Schedule', 'PipelineContext', 'get_pipeline_context']
module-attribute
Classes
PipelineContext(pipeline_configuration: PipelineConfiguration)
Provides pipeline configuration context.
Usage example:
from zenml import get_pipeline_context
...
@pipeline(
extra={
"complex_parameter": [
("sklearn.tree", "DecisionTreeClassifier"),
("sklearn.ensemble", "RandomForestClassifier"),
]
}
)
def my_pipeline():
context = get_pipeline_context()
after = []
search_steps_prefix = "hp_tuning_search_"
for i, model_search_configuration in enumerate(
context.extra["complex_parameter"]
):
step_name = f"{search_steps_prefix}{i}"
cross_validation(
model_package=model_search_configuration[0],
model_class=model_search_configuration[1],
id=step_name
)
after.append(step_name)
select_best_model(
search_steps_prefix=search_steps_prefix,
after=after,
)
Initialize the context of the current pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline_configuration
|
PipelineConfiguration
|
The configuration of the pipeline derived from Pipeline class. |
required |
Source code in src/zenml/pipelines/pipeline_context.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
Methods:
Schedule
Bases: BaseModel
Class for defining a pipeline schedule.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
Optional[str]
|
Optional name to give to the schedule. If not set, a default name will be generated based on the pipeline name and the current date and time. |
cron_expression |
Optional[str]
|
Cron expression for the pipeline schedule. If a value for this is set it takes precedence over the start time + interval. |
start_time |
Optional[datetime]
|
When the schedule should start. If this is a datetime object without any timezone, it is treated as a datetime in the local timezone. |
end_time |
Optional[datetime]
|
When the schedule should end. If this is a datetime object without any timezone, it is treated as a datetime in the local timezone. |
interval_second |
Optional[timedelta]
|
datetime timedelta indicating the seconds between two recurring runs for a periodic schedule. |
catchup |
bool
|
Whether the recurring run should catch up if behind schedule. For example, if the recurring run is paused for a while and re-enabled afterward. If catchup=True, the scheduler will catch up on (backfill) each missed interval. Otherwise, it only schedules the latest interval if more than one interval is ready to be scheduled. Usually, if your pipeline handles backfill internally, you should turn catchup off to avoid duplicate backfill. |
run_once_start_time |
Optional[datetime]
|
When to run the pipeline once. If this is a datetime object without any timezone, it is treated as a datetime in the local timezone. |
Functions:
get_pipeline_context() -> PipelineContext
Get the context of the current pipeline.
Returns:
| Type | Description |
|---|---|
PipelineContext
|
The context of the current pipeline. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If no active pipeline is found or if inside a running step. |
Source code in src/zenml/pipelines/pipeline_context.py
26 27 28 29 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 | |
pipeline(_func: Optional[F] = None, *, name: Optional[str] = None, dynamic: Optional[bool] = None, depends_on: Optional[List[BaseStep]] = None, enable_cache: Optional[bool] = None, enable_artifact_metadata: Optional[bool] = None, enable_step_logs: Optional[bool] = None, enable_heartbeat: Optional[bool] = None, environment: Optional[Dict[str, Any]] = None, secrets: Optional[List[Union[UUID, str]]] = None, enable_pipeline_logs: Optional[bool] = None, settings: Optional[Dict[str, SettingsOrDict]] = None, tags: Optional[List[Union[str, Tag]]] = None, extra: Optional[Dict[str, Any]] = None, on_failure: Optional[HookSpecification] = None, on_success: Optional[HookSpecification] = None, on_start: Optional[HookSpecification] = None, on_end: Optional[HookSpecification] = None, on_pause: Optional[HookSpecification] = None, on_resume: Optional[HookSpecification] = None, on_init: Optional[InitHookSpecification] = None, on_init_kwargs: Optional[Dict[str, Any]] = None, on_cleanup: Optional[HookSpecification] = None, model: Optional[Model] = None, retry: Optional[StepRetryConfig] = None, substitutions: Optional[Dict[str, str]] = None, execution_mode: Optional[ExecutionMode] = None, cache_policy: Optional[CachePolicyOrString] = None) -> Union[Pipeline, DynamicPipeline, Callable[[F], Pipeline], Callable[[F], DynamicPipeline]]
pipeline(_func: F) -> Pipeline
pipeline(
*,
name: Optional[str] = None,
dynamic: Literal[True],
depends_on: Optional[List[BaseStep]] = None,
enable_cache: Optional[bool] = None,
enable_artifact_metadata: Optional[bool] = None,
enable_step_logs: Optional[bool] = None,
enable_heartbeat: Optional[bool] = None,
environment: Optional[Dict[str, Any]] = None,
secrets: Optional[List[Union[UUID, str]]] = None,
enable_pipeline_logs: Optional[bool] = None,
settings: Optional[Dict[str, SettingsOrDict]] = None,
tags: Optional[List[Union[str, Tag]]] = None,
extra: Optional[Dict[str, Any]] = None,
on_failure: Optional[HookSpecification] = None,
on_success: Optional[HookSpecification] = None,
on_start: Optional[HookSpecification] = None,
on_end: Optional[HookSpecification] = None,
on_pause: Optional[HookSpecification] = None,
on_resume: Optional[HookSpecification] = None,
on_init: Optional[InitHookSpecification] = None,
on_init_kwargs: Optional[Dict[str, Any]] = None,
on_cleanup: Optional[HookSpecification] = None,
model: Optional[Model] = None,
retry: Optional[StepRetryConfig] = None,
substitutions: Optional[Dict[str, str]] = None,
execution_mode: Optional[ExecutionMode] = None,
cache_policy: Optional[CachePolicyOrString] = None,
) -> Callable[[F], DynamicPipeline]
pipeline(
*,
name: Optional[str] = None,
dynamic: Literal[False] = False,
depends_on: Optional[List[BaseStep]] = None,
enable_cache: Optional[bool] = None,
enable_artifact_metadata: Optional[bool] = None,
enable_step_logs: Optional[bool] = None,
enable_heartbeat: Optional[bool] = None,
environment: Optional[Dict[str, Any]] = None,
secrets: Optional[List[Union[UUID, str]]] = None,
enable_pipeline_logs: Optional[bool] = None,
settings: Optional[Dict[str, SettingsOrDict]] = None,
tags: Optional[List[Union[str, Tag]]] = None,
extra: Optional[Dict[str, Any]] = None,
on_failure: Optional[HookSpecification] = None,
on_success: Optional[HookSpecification] = None,
on_start: Optional[HookSpecification] = None,
on_end: Optional[HookSpecification] = None,
on_pause: Optional[HookSpecification] = None,
on_resume: Optional[HookSpecification] = None,
on_init: Optional[InitHookSpecification] = None,
on_init_kwargs: Optional[Dict[str, Any]] = None,
on_cleanup: Optional[HookSpecification] = None,
model: Optional[Model] = None,
retry: Optional[StepRetryConfig] = None,
substitutions: Optional[Dict[str, str]] = None,
execution_mode: Optional[ExecutionMode] = None,
cache_policy: Optional[CachePolicyOrString] = None,
) -> Callable[[F], Pipeline]
pipeline(
*,
name: Optional[str] = None,
dynamic: None = None,
depends_on: Optional[List[BaseStep]] = None,
enable_cache: Optional[bool] = None,
enable_artifact_metadata: Optional[bool] = None,
enable_step_logs: Optional[bool] = None,
enable_heartbeat: Optional[bool] = None,
environment: Optional[Dict[str, Any]] = None,
secrets: Optional[List[Union[UUID, str]]] = None,
enable_pipeline_logs: Optional[bool] = None,
settings: Optional[Dict[str, SettingsOrDict]] = None,
tags: Optional[List[Union[str, Tag]]] = None,
extra: Optional[Dict[str, Any]] = None,
on_failure: Optional[HookSpecification] = None,
on_success: Optional[HookSpecification] = None,
on_start: Optional[HookSpecification] = None,
on_end: Optional[HookSpecification] = None,
on_pause: Optional[HookSpecification] = None,
on_resume: Optional[HookSpecification] = None,
on_init: Optional[InitHookSpecification] = None,
on_init_kwargs: Optional[Dict[str, Any]] = None,
on_cleanup: Optional[HookSpecification] = None,
model: Optional[Model] = None,
retry: Optional[StepRetryConfig] = None,
substitutions: Optional[Dict[str, str]] = None,
execution_mode: Optional[ExecutionMode] = None,
cache_policy: Optional[CachePolicyOrString] = None,
) -> Callable[[F], Pipeline]
Decorator to create a pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
_func
|
Optional[F]
|
The decorated function. |
None
|
name
|
Optional[str]
|
The name of the pipeline. If left empty, the name of the decorated function will be used as a fallback. |
None
|
dynamic
|
Optional[bool]
|
Whether this is a dynamic pipeline or not. |
None
|
depends_on
|
Optional[List[BaseStep]]
|
The steps that this pipeline depends on. |
None
|
enable_cache
|
Optional[bool]
|
Whether to use caching or not. |
None
|
enable_artifact_metadata
|
Optional[bool]
|
Whether to enable artifact metadata or not. |
None
|
enable_step_logs
|
Optional[bool]
|
If step logs should be enabled for this pipeline. |
None
|
enable_heartbeat
|
Optional[bool]
|
If heartbeat should be enabled for this pipeline. |
None
|
environment
|
Optional[Dict[str, Any]]
|
Environment variables to set when running this pipeline. |
None
|
secrets
|
Optional[List[Union[UUID, str]]]
|
Secrets to set as environment variables when running this pipeline. |
None
|
enable_pipeline_logs
|
Optional[bool]
|
If pipeline logs should be enabled for this pipeline. |
None
|
settings
|
Optional[Dict[str, SettingsOrDict]]
|
Settings for this pipeline. |
None
|
tags
|
Optional[List[Union[str, Tag]]]
|
Tags to apply to runs of the pipeline. |
None
|
extra
|
Optional[Dict[str, Any]]
|
Extra configurations for this pipeline. |
None
|
on_failure
|
Optional[HookSpecification]
|
Hook run when the pipeline fails. A callable taking an
optional |
None
|
on_success
|
Optional[HookSpecification]
|
Hook run when the pipeline succeeds. A no-arg callable, or a source path to one. Static pipelines propagate it to each step as a default. Dynamic pipelines run it once at the run level. |
None
|
on_start
|
Optional[HookSpecification]
|
Hook run when the pipeline starts. A no-arg callable, or a source path to one. Static pipelines propagate it to each step as a default. Dynamic pipelines run it once at the run level. |
None
|
on_end
|
Optional[HookSpecification]
|
Hook run when the pipeline ends. A callable taking an optional
|
None
|
on_pause
|
Optional[HookSpecification]
|
Hook run when the run pauses. A no-arg callable, or a source path to one. Static pipelines ignore it. Dynamic pipelines run it once at the run level. |
None
|
on_resume
|
Optional[HookSpecification]
|
Hook run when a paused run resumes. A no-arg callable, or a source path to one. Static pipelines ignore it. Dynamic pipelines run it once at the run level. |
None
|
on_init
|
Optional[InitHookSpecification]
|
Callback function to run on initialization of the pipeline. Can
be a function with no arguments, or a source path to such a function
(e.g. |
None
|
on_init_kwargs
|
Optional[Dict[str, Any]]
|
Arguments for the init hook. |
None
|
on_cleanup
|
Optional[HookSpecification]
|
Callback function to run on cleanup of the pipeline. Can be a
function with no arguments, or a source path to such a function
(e.g. |
None
|
model
|
Optional[Model]
|
configuration of the model in the Model Control Plane. |
None
|
retry
|
Optional[StepRetryConfig]
|
Retry configuration for the pipeline steps. |
None
|
substitutions
|
Optional[Dict[str, str]]
|
Extra substitutions for pipeline run, model and artifact name placeholders. |
None
|
execution_mode
|
Optional[ExecutionMode]
|
The execution mode to use for the pipeline. |
None
|
cache_policy
|
Optional[CachePolicyOrString]
|
Cache policy for this pipeline. |
None
|
Returns:
| Type | Description |
|---|---|
Union[Pipeline, DynamicPipeline, Callable[[F], Pipeline], Callable[[F], DynamicPipeline]]
|
A pipeline instance. |
Source code in src/zenml/pipelines/pipeline_decorator.py
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 | |
Modules
build_utils
Pipeline build utilities.
Classes
Functions:
allows_download_from_code_repository(snapshot: PipelineSnapshotBase) -> bool
Checks whether a code repository can be used to download code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The snapshot. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Whether a code repository can be used to download code. |
Source code in src/zenml/pipelines/build_utils.py
773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 | |
build_required(snapshot: PipelineSnapshotBase) -> bool
Checks whether a build is required for the snapshot and active stack.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The snapshot for which to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
If a build is required. |
Source code in src/zenml/pipelines/build_utils.py
78 79 80 81 82 83 84 85 86 87 88 | |
code_download_possible(snapshot: PipelineSnapshotBase, code_repository: Optional[BaseCodeRepository] = None) -> bool
Checks whether code download is possible for the snapshot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The snapshot. |
required |
code_repository
|
Optional[BaseCodeRepository]
|
If provided, this code repository can be used to download the code inside the container images. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
Whether code download is possible for the snapshot. |
Source code in src/zenml/pipelines/build_utils.py
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 | |
compute_build_checksum(items: List[BuildConfiguration], stack: Stack, code_repository: Optional[BaseCodeRepository] = None) -> str
Compute an overall checksum for a pipeline build.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
items
|
List[BuildConfiguration]
|
Items of the build. |
required |
stack
|
Stack
|
The stack associated with the build. Will be used to gather its requirements. |
required |
code_repository
|
Optional[BaseCodeRepository]
|
The code repository that will be used to download files inside the build. Will be used for its dependency specification. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
The build checksum. |
Source code in src/zenml/pipelines/build_utils.py
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 | |
compute_stack_checksum(stack: StackResponse) -> str
Compute a stack checksum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stack
|
StackResponse
|
The stack for which to compute the checksum. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The checksum. |
Source code in src/zenml/pipelines/build_utils.py
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 | |
create_pipeline_build(snapshot: PipelineSnapshotBase, pipeline_id: Optional[UUID] = None, code_repository: Optional[BaseCodeRepository] = None) -> Optional[PipelineBuildResponse]
Builds images and registers the output in the server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The pipeline snapshot. |
required |
pipeline_id
|
Optional[UUID]
|
The ID of the pipeline. |
None
|
code_repository
|
Optional[BaseCodeRepository]
|
If provided, this code repository will be used to download inside the build images. |
None
|
Returns:
| Type | Description |
|---|---|
Optional[PipelineBuildResponse]
|
The build output. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If multiple builds with the same key but different settings were specified. |
Source code in src/zenml/pipelines/build_utils.py
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 | |
find_existing_build(snapshot: PipelineSnapshotBase, code_repository: Optional[BaseCodeRepository] = None) -> Optional[PipelineBuildResponse]
Find an existing build for a snapshot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The snapshot for which to find an existing build. |
required |
code_repository
|
Optional[BaseCodeRepository]
|
The code repository that will be used to download files in the images. |
None
|
Returns:
| Type | Description |
|---|---|
Optional[PipelineBuildResponse]
|
The existing build to reuse if found. |
Source code in src/zenml/pipelines/build_utils.py
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 | |
get_docker_settings(snapshot: PipelineSnapshotBase) -> List[DockerSettings]
Get a list of all relevant Docker settings for the snapshot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The snapshot. |
required |
Returns:
| Type | Description |
|---|---|
List[DockerSettings]
|
A list of all relevant Docker settings. |
Source code in src/zenml/pipelines/build_utils.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
log_code_repository_usage(snapshot: PipelineSnapshotBase, local_repo_context: LocalRepositoryContext) -> None
Log what the code repository can (not) be used for given a snapshot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The snapshot. |
required |
local_repo_context
|
LocalRepositoryContext
|
The local repository context. |
required |
Source code in src/zenml/pipelines/build_utils.py
791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 | |
prune_snapshot_before_build(snapshot: PipelineSnapshotBase) -> PipelineSnapshotBase
Prunes the snapshot before building.
This method removes all steps which will anyway be skipped for a replayed run. We will anyway not run these steps so we don't need to build images for them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The snapshot to prune. |
required |
Returns:
| Type | Description |
|---|---|
PipelineSnapshotBase
|
The pruned snapshot. |
Source code in src/zenml/pipelines/build_utils.py
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 | |
requires_download_from_code_repository(snapshot: PipelineSnapshotBase) -> bool
Checks whether the snapshot needs to download code from a repository.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The snapshot. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
If the snapshot needs to download code from a code repository. |
Source code in src/zenml/pipelines/build_utils.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
requires_included_code(snapshot: PipelineSnapshotBase, code_repository: Optional[BaseCodeRepository] = None) -> bool
Checks whether the snapshot requires included code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The snapshot. |
required |
code_repository
|
Optional[BaseCodeRepository]
|
If provided, this code repository can be used to download the code inside the container images. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
If the snapshot requires code included in the container images. |
Source code in src/zenml/pipelines/build_utils.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 119 120 121 | |
reuse_or_create_pipeline_build(snapshot: PipelineSnapshotBase, allow_build_reuse: bool, pipeline_id: Optional[UUID] = None, build: Union[UUID, PipelineBuildBase, None] = None, code_repository: Optional[BaseCodeRepository] = None) -> Optional[PipelineBuildResponse]
Loads or creates a pipeline build.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The pipeline snapshot for which to load or create the build. |
required |
allow_build_reuse
|
bool
|
If True, the build is allowed to reuse an existing build. |
required |
pipeline_id
|
Optional[UUID]
|
Optional ID of the pipeline to reference in the build. |
None
|
build
|
Union[UUID, PipelineBuildBase, None]
|
Optional existing build. If given, the build will be fetched (or registered) in the database. If not given, a new build will be created. |
None
|
code_repository
|
Optional[BaseCodeRepository]
|
If provided, this code repository can be used to download code inside the container images. |
None
|
Returns:
| Type | Description |
|---|---|
Optional[PipelineBuildResponse]
|
The build response. |
Source code in src/zenml/pipelines/build_utils.py
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 | |
should_prevent_build_reuse(snapshot: PipelineSnapshotBase) -> bool
Whether the snapshot prevents a build reuse.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The snapshot. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Whether the snapshot prevents a build reuse. |
Source code in src/zenml/pipelines/build_utils.py
182 183 184 185 186 187 188 189 190 191 192 193 194 | |
should_upload_code(snapshot: PipelineSnapshotBase, build: Optional[PipelineBuildResponse], can_download_from_code_repository: bool) -> bool
Checks whether the current code should be uploaded for the snapshot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The snapshot. |
required |
build
|
Optional[PipelineBuildResponse]
|
The build for the snapshot. |
required |
can_download_from_code_repository
|
bool
|
Whether the code can be downloaded from a code repository. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
Whether the current code should be uploaded for the snapshot. |
Source code in src/zenml/pipelines/build_utils.py
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 | |
verify_custom_build(build: PipelineBuildResponse, snapshot: PipelineSnapshotBase, code_repository: Optional[BaseCodeRepository] = None) -> None
Verify a custom build for a pipeline snapshot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
build
|
PipelineBuildResponse
|
The build to verify. |
required |
snapshot
|
PipelineSnapshotBase
|
The snapshot for which to verify the build. |
required |
code_repository
|
Optional[BaseCodeRepository]
|
Code repository that will be used to download files for the snapshot. |
None
|
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the build can't be used for the snapshot. |
Source code in src/zenml/pipelines/build_utils.py
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 | |
verify_local_repository_context(snapshot: PipelineSnapshotBase, local_repo_context: Optional[LocalRepositoryContext]) -> Optional[BaseCodeRepository]
Verifies the local repository.
If the local repository exists and has no local changes, code download inside the images is possible.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The pipeline snapshot. |
required |
local_repo_context
|
Optional[LocalRepositoryContext]
|
The local repository active at the source root. |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the snapshot requires code download but code download is not possible. |
Returns:
| Type | Description |
|---|---|
Optional[BaseCodeRepository]
|
The code repository from which to download files for the runs of the |
Optional[BaseCodeRepository]
|
snapshot, or None if code download is not possible. |
Source code in src/zenml/pipelines/build_utils.py
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 | |
Modules
compilation_context
Pipeline compilation context.
Classes
PipelineCompilationContext(pipeline: Pipeline)
Bases: BaseContext
Pipeline compilation context.
Initialize the pipeline compilation context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline
|
Pipeline
|
The pipeline that is being compiled. |
required |
Source code in src/zenml/pipelines/compilation_context.py
32 33 34 35 36 37 38 39 40 41 42 | |
pipeline: Pipeline
property
The pipeline that is being compiled.
Returns:
| Type | Description |
|---|---|
Pipeline
|
The pipeline that is being compiled. |
Modules
pipeline_context
Pipeline context class.
Classes
PipelineContext(pipeline_configuration: PipelineConfiguration)
Provides pipeline configuration context.
Usage example:
from zenml import get_pipeline_context
...
@pipeline(
extra={
"complex_parameter": [
("sklearn.tree", "DecisionTreeClassifier"),
("sklearn.ensemble", "RandomForestClassifier"),
]
}
)
def my_pipeline():
context = get_pipeline_context()
after = []
search_steps_prefix = "hp_tuning_search_"
for i, model_search_configuration in enumerate(
context.extra["complex_parameter"]
):
step_name = f"{search_steps_prefix}{i}"
cross_validation(
model_package=model_search_configuration[0],
model_class=model_search_configuration[1],
id=step_name
)
after.append(step_name)
select_best_model(
search_steps_prefix=search_steps_prefix,
after=after,
)
Initialize the context of the current pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline_configuration
|
PipelineConfiguration
|
The configuration of the pipeline derived from Pipeline class. |
required |
Source code in src/zenml/pipelines/pipeline_context.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
Functions:
get_pipeline_context() -> PipelineContext
Get the context of the current pipeline.
Returns:
| Type | Description |
|---|---|
PipelineContext
|
The context of the current pipeline. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If no active pipeline is found or if inside a running step. |
Source code in src/zenml/pipelines/pipeline_context.py
26 27 28 29 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 | |
pipeline_decorator
ZenML pipeline decorator definition.
Classes
Functions:
pipeline(_func: Optional[F] = None, *, name: Optional[str] = None, dynamic: Optional[bool] = None, depends_on: Optional[List[BaseStep]] = None, enable_cache: Optional[bool] = None, enable_artifact_metadata: Optional[bool] = None, enable_step_logs: Optional[bool] = None, enable_heartbeat: Optional[bool] = None, environment: Optional[Dict[str, Any]] = None, secrets: Optional[List[Union[UUID, str]]] = None, enable_pipeline_logs: Optional[bool] = None, settings: Optional[Dict[str, SettingsOrDict]] = None, tags: Optional[List[Union[str, Tag]]] = None, extra: Optional[Dict[str, Any]] = None, on_failure: Optional[HookSpecification] = None, on_success: Optional[HookSpecification] = None, on_start: Optional[HookSpecification] = None, on_end: Optional[HookSpecification] = None, on_pause: Optional[HookSpecification] = None, on_resume: Optional[HookSpecification] = None, on_init: Optional[InitHookSpecification] = None, on_init_kwargs: Optional[Dict[str, Any]] = None, on_cleanup: Optional[HookSpecification] = None, model: Optional[Model] = None, retry: Optional[StepRetryConfig] = None, substitutions: Optional[Dict[str, str]] = None, execution_mode: Optional[ExecutionMode] = None, cache_policy: Optional[CachePolicyOrString] = None) -> Union[Pipeline, DynamicPipeline, Callable[[F], Pipeline], Callable[[F], DynamicPipeline]]
pipeline(_func: F) -> Pipeline
pipeline(
*,
name: Optional[str] = None,
dynamic: Literal[True],
depends_on: Optional[List[BaseStep]] = None,
enable_cache: Optional[bool] = None,
enable_artifact_metadata: Optional[bool] = None,
enable_step_logs: Optional[bool] = None,
enable_heartbeat: Optional[bool] = None,
environment: Optional[Dict[str, Any]] = None,
secrets: Optional[List[Union[UUID, str]]] = None,
enable_pipeline_logs: Optional[bool] = None,
settings: Optional[Dict[str, SettingsOrDict]] = None,
tags: Optional[List[Union[str, Tag]]] = None,
extra: Optional[Dict[str, Any]] = None,
on_failure: Optional[HookSpecification] = None,
on_success: Optional[HookSpecification] = None,
on_start: Optional[HookSpecification] = None,
on_end: Optional[HookSpecification] = None,
on_pause: Optional[HookSpecification] = None,
on_resume: Optional[HookSpecification] = None,
on_init: Optional[InitHookSpecification] = None,
on_init_kwargs: Optional[Dict[str, Any]] = None,
on_cleanup: Optional[HookSpecification] = None,
model: Optional[Model] = None,
retry: Optional[StepRetryConfig] = None,
substitutions: Optional[Dict[str, str]] = None,
execution_mode: Optional[ExecutionMode] = None,
cache_policy: Optional[CachePolicyOrString] = None,
) -> Callable[[F], DynamicPipeline]
pipeline(
*,
name: Optional[str] = None,
dynamic: Literal[False] = False,
depends_on: Optional[List[BaseStep]] = None,
enable_cache: Optional[bool] = None,
enable_artifact_metadata: Optional[bool] = None,
enable_step_logs: Optional[bool] = None,
enable_heartbeat: Optional[bool] = None,
environment: Optional[Dict[str, Any]] = None,
secrets: Optional[List[Union[UUID, str]]] = None,
enable_pipeline_logs: Optional[bool] = None,
settings: Optional[Dict[str, SettingsOrDict]] = None,
tags: Optional[List[Union[str, Tag]]] = None,
extra: Optional[Dict[str, Any]] = None,
on_failure: Optional[HookSpecification] = None,
on_success: Optional[HookSpecification] = None,
on_start: Optional[HookSpecification] = None,
on_end: Optional[HookSpecification] = None,
on_pause: Optional[HookSpecification] = None,
on_resume: Optional[HookSpecification] = None,
on_init: Optional[InitHookSpecification] = None,
on_init_kwargs: Optional[Dict[str, Any]] = None,
on_cleanup: Optional[HookSpecification] = None,
model: Optional[Model] = None,
retry: Optional[StepRetryConfig] = None,
substitutions: Optional[Dict[str, str]] = None,
execution_mode: Optional[ExecutionMode] = None,
cache_policy: Optional[CachePolicyOrString] = None,
) -> Callable[[F], Pipeline]
pipeline(
*,
name: Optional[str] = None,
dynamic: None = None,
depends_on: Optional[List[BaseStep]] = None,
enable_cache: Optional[bool] = None,
enable_artifact_metadata: Optional[bool] = None,
enable_step_logs: Optional[bool] = None,
enable_heartbeat: Optional[bool] = None,
environment: Optional[Dict[str, Any]] = None,
secrets: Optional[List[Union[UUID, str]]] = None,
enable_pipeline_logs: Optional[bool] = None,
settings: Optional[Dict[str, SettingsOrDict]] = None,
tags: Optional[List[Union[str, Tag]]] = None,
extra: Optional[Dict[str, Any]] = None,
on_failure: Optional[HookSpecification] = None,
on_success: Optional[HookSpecification] = None,
on_start: Optional[HookSpecification] = None,
on_end: Optional[HookSpecification] = None,
on_pause: Optional[HookSpecification] = None,
on_resume: Optional[HookSpecification] = None,
on_init: Optional[InitHookSpecification] = None,
on_init_kwargs: Optional[Dict[str, Any]] = None,
on_cleanup: Optional[HookSpecification] = None,
model: Optional[Model] = None,
retry: Optional[StepRetryConfig] = None,
substitutions: Optional[Dict[str, str]] = None,
execution_mode: Optional[ExecutionMode] = None,
cache_policy: Optional[CachePolicyOrString] = None,
) -> Callable[[F], Pipeline]
Decorator to create a pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
_func
|
Optional[F]
|
The decorated function. |
None
|
name
|
Optional[str]
|
The name of the pipeline. If left empty, the name of the decorated function will be used as a fallback. |
None
|
dynamic
|
Optional[bool]
|
Whether this is a dynamic pipeline or not. |
None
|
depends_on
|
Optional[List[BaseStep]]
|
The steps that this pipeline depends on. |
None
|
enable_cache
|
Optional[bool]
|
Whether to use caching or not. |
None
|
enable_artifact_metadata
|
Optional[bool]
|
Whether to enable artifact metadata or not. |
None
|
enable_step_logs
|
Optional[bool]
|
If step logs should be enabled for this pipeline. |
None
|
enable_heartbeat
|
Optional[bool]
|
If heartbeat should be enabled for this pipeline. |
None
|
environment
|
Optional[Dict[str, Any]]
|
Environment variables to set when running this pipeline. |
None
|
secrets
|
Optional[List[Union[UUID, str]]]
|
Secrets to set as environment variables when running this pipeline. |
None
|
enable_pipeline_logs
|
Optional[bool]
|
If pipeline logs should be enabled for this pipeline. |
None
|
settings
|
Optional[Dict[str, SettingsOrDict]]
|
Settings for this pipeline. |
None
|
tags
|
Optional[List[Union[str, Tag]]]
|
Tags to apply to runs of the pipeline. |
None
|
extra
|
Optional[Dict[str, Any]]
|
Extra configurations for this pipeline. |
None
|
on_failure
|
Optional[HookSpecification]
|
Hook run when the pipeline fails. A callable taking an
optional |
None
|
on_success
|
Optional[HookSpecification]
|
Hook run when the pipeline succeeds. A no-arg callable, or a source path to one. Static pipelines propagate it to each step as a default. Dynamic pipelines run it once at the run level. |
None
|
on_start
|
Optional[HookSpecification]
|
Hook run when the pipeline starts. A no-arg callable, or a source path to one. Static pipelines propagate it to each step as a default. Dynamic pipelines run it once at the run level. |
None
|
on_end
|
Optional[HookSpecification]
|
Hook run when the pipeline ends. A callable taking an optional
|
None
|
on_pause
|
Optional[HookSpecification]
|
Hook run when the run pauses. A no-arg callable, or a source path to one. Static pipelines ignore it. Dynamic pipelines run it once at the run level. |
None
|
on_resume
|
Optional[HookSpecification]
|
Hook run when a paused run resumes. A no-arg callable, or a source path to one. Static pipelines ignore it. Dynamic pipelines run it once at the run level. |
None
|
on_init
|
Optional[InitHookSpecification]
|
Callback function to run on initialization of the pipeline. Can
be a function with no arguments, or a source path to such a function
(e.g. |
None
|
on_init_kwargs
|
Optional[Dict[str, Any]]
|
Arguments for the init hook. |
None
|
on_cleanup
|
Optional[HookSpecification]
|
Callback function to run on cleanup of the pipeline. Can be a
function with no arguments, or a source path to such a function
(e.g. |
None
|
model
|
Optional[Model]
|
configuration of the model in the Model Control Plane. |
None
|
retry
|
Optional[StepRetryConfig]
|
Retry configuration for the pipeline steps. |
None
|
substitutions
|
Optional[Dict[str, str]]
|
Extra substitutions for pipeline run, model and artifact name placeholders. |
None
|
execution_mode
|
Optional[ExecutionMode]
|
The execution mode to use for the pipeline. |
None
|
cache_policy
|
Optional[CachePolicyOrString]
|
Cache policy for this pipeline. |
None
|
Returns:
| Type | Description |
|---|---|
Union[Pipeline, DynamicPipeline, Callable[[F], Pipeline], Callable[[F], DynamicPipeline]]
|
A pipeline instance. |
Source code in src/zenml/pipelines/pipeline_decorator.py
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 | |
pipeline_definition
Definition of a ZenML pipeline.
Classes
Pipeline(*, name: str, entrypoint: F, enable_cache: Optional[bool] = None, enable_artifact_metadata: Optional[bool] = None, enable_artifact_visualization: Optional[bool] = None, enable_step_logs: Optional[bool] = None, enable_heartbeat: Optional[bool] = None, environment: Optional[Dict[str, Any]] = None, secrets: Optional[List[Union[UUID, str]]] = None, enable_pipeline_logs: Optional[bool] = None, settings: Optional[Mapping[str, SettingsOrDict]] = None, tags: Optional[List[Union[str, Tag]]] = None, extra: Optional[Dict[str, Any]] = None, on_failure: Optional[HookSpecification] = None, on_success: Optional[HookSpecification] = None, on_start: Optional[HookSpecification] = None, on_end: Optional[HookSpecification] = None, on_pause: Optional[HookSpecification] = None, on_resume: Optional[HookSpecification] = None, on_init: Optional[InitHookSpecification] = None, on_init_kwargs: Optional[Dict[str, Any]] = None, on_cleanup: Optional[HookSpecification] = None, model: Optional[Model] = None, retry: Optional[StepRetryConfig] = None, substitutions: Optional[Dict[str, str]] = None, execution_mode: Optional[ExecutionMode] = None, cache_policy: Optional[CachePolicyOrString] = None, **kwargs: Any)
ZenML pipeline class.
Initializes a pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the pipeline. |
required |
entrypoint
|
F
|
The entrypoint function of the pipeline. |
required |
enable_cache
|
Optional[bool]
|
If caching should be enabled for this pipeline. |
None
|
enable_artifact_metadata
|
Optional[bool]
|
If artifact metadata should be enabled for this pipeline. |
None
|
enable_artifact_visualization
|
Optional[bool]
|
If artifact visualization should be enabled for this pipeline. |
None
|
enable_step_logs
|
Optional[bool]
|
If step logs should be enabled for this pipeline. |
None
|
enable_heartbeat
|
Optional[bool]
|
If heartbeat should be enabled for this pipeline. |
None
|
environment
|
Optional[Dict[str, Any]]
|
Environment variables to set when running this pipeline. |
None
|
secrets
|
Optional[List[Union[UUID, str]]]
|
Secrets to set as environment variables when running this pipeline. |
None
|
enable_pipeline_logs
|
Optional[bool]
|
If pipeline logs should be enabled for this pipeline. |
None
|
settings
|
Optional[Mapping[str, SettingsOrDict]]
|
Settings for this pipeline. |
None
|
tags
|
Optional[List[Union[str, Tag]]]
|
Tags to apply to runs of this pipeline. |
None
|
extra
|
Optional[Dict[str, Any]]
|
Extra configurations for this pipeline. |
None
|
on_failure
|
Optional[HookSpecification]
|
Hook run when the pipeline fails. A callable taking
an optional |
None
|
on_success
|
Optional[HookSpecification]
|
Hook run when the pipeline succeeds. A no-arg callable, or a source path to one. Static pipelines propagate it to each step as a default. Dynamic pipelines run it once at the run level. |
None
|
on_start
|
Optional[HookSpecification]
|
Hook run when the pipeline starts. A no-arg callable, or a source path to one. Static pipelines propagate it to each step as a default. Dynamic pipelines run it once at the run level. |
None
|
on_end
|
Optional[HookSpecification]
|
Hook run when the pipeline ends. A callable taking an
optional |
None
|
on_pause
|
Optional[HookSpecification]
|
Hook run when the run pauses. A no-arg callable, or a source path to one. Static pipelines ignore it. Dynamic pipelines run it once at the run level. |
None
|
on_resume
|
Optional[HookSpecification]
|
Hook run when a paused run resumes. A no-arg callable, or a source path to one. Static pipelines ignore it. Dynamic pipelines run it once at the run level. |
None
|
on_init
|
Optional[InitHookSpecification]
|
Callback function to run on initialization of the pipeline.
Can be a function with no arguments, or a source path to such a
function (e.g. |
None
|
on_init_kwargs
|
Optional[Dict[str, Any]]
|
Arguments for the init hook. |
None
|
on_cleanup
|
Optional[HookSpecification]
|
Callback function to run on cleanup of the pipeline. Can
be a function with no arguments, or a source path to such a
function with no arguments (e.g. |
None
|
model
|
Optional[Model]
|
configuration of the model in the Model Control Plane. |
None
|
retry
|
Optional[StepRetryConfig]
|
Retry configuration for the pipeline steps. |
None
|
substitutions
|
Optional[Dict[str, str]]
|
Extra substitutions for pipeline run, model and artifact name placeholders. |
None
|
execution_mode
|
Optional[ExecutionMode]
|
The execution mode of the pipeline. |
None
|
cache_policy
|
Optional[CachePolicyOrString]
|
Cache policy for this pipeline. |
None
|
**kwargs
|
Any
|
Additional keyword arguments. |
{}
|
Source code in src/zenml/pipelines/pipeline_definition.py
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 | |
configuration: PipelineConfiguration
property
The configuration of the pipeline.
Returns:
| Type | Description |
|---|---|
PipelineConfiguration
|
The configuration of the pipeline. |
enable_cache: Optional[bool]
property
If caching is enabled for the pipeline.
Returns:
| Type | Description |
|---|---|
Optional[bool]
|
If caching is enabled for the pipeline. |
enable_heartbeat: Optional[bool]
property
If heartbeat is enabled for the pipeline.
Returns:
| Type | Description |
|---|---|
Optional[bool]
|
If heartbeat is enabled for the pipeline. |
invocations: Dict[str, StepInvocation]
property
Returns the step invocations of this pipeline.
This dictionary will only be populated once the pipeline has been called.
Returns:
| Type | Description |
|---|---|
Dict[str, StepInvocation]
|
The step invocations. |
is_dynamic: bool
property
If the pipeline is dynamic.
Returns:
| Type | Description |
|---|---|
bool
|
If the pipeline is dynamic. |
is_prepared: bool
property
If the pipeline is prepared.
Prepared means that the pipeline entrypoint has been called and the pipeline is fully defined.
Returns:
| Type | Description |
|---|---|
bool
|
If the pipeline is prepared. |
missing_parameters: List[str]
property
List of missing parameters for the pipeline entrypoint.
Returns:
| Type | Description |
|---|---|
List[str]
|
List of missing parameters for the pipeline entrypoint. |
model: PipelineResponse
property
Gets the registered pipeline model for this instance.
Returns:
| Type | Description |
|---|---|
PipelineResponse
|
The registered pipeline model. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the pipeline has not been registered yet. |
name: str
property
The name of the pipeline.
Returns:
| Type | Description |
|---|---|
str
|
The name of the pipeline. |
required_parameters: List[str]
property
List of required parameters for the pipeline entrypoint.
Returns:
| Type | Description |
|---|---|
List[str]
|
List of required parameters for the pipeline entrypoint. |
source_code: str
property
The source code of this pipeline.
Returns:
| Type | Description |
|---|---|
str
|
The source code of this pipeline. |
source_object: Any
property
The source object of this pipeline.
Returns:
| Type | Description |
|---|---|
Any
|
The source object of this pipeline. |
add_step_invocation(step: BaseStep, input_artifacts: Dict[str, Union[StepArtifact, List[StepArtifact]]], external_artifacts: Dict[str, Union[ExternalArtifact, ArtifactVersionResponse]], model_artifacts_or_metadata: Dict[str, ModelVersionDataLazyLoader], client_lazy_loaders: Dict[str, ClientLazyLoader], parameters: Dict[str, Any], default_parameters: Dict[str, Any], upstream_steps: Set[str], custom_id: Optional[str] = None, allow_id_suffix: bool = True) -> str
Adds a step invocation to the pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
step
|
BaseStep
|
The step for which to add an invocation. |
required |
input_artifacts
|
Dict[str, Union[StepArtifact, List[StepArtifact]]]
|
The input artifacts for the invocation. |
required |
external_artifacts
|
Dict[str, Union[ExternalArtifact, ArtifactVersionResponse]]
|
The external artifacts for the invocation. |
required |
model_artifacts_or_metadata
|
Dict[str, ModelVersionDataLazyLoader]
|
The model artifacts or metadata for the invocation. |
required |
client_lazy_loaders
|
Dict[str, ClientLazyLoader]
|
The client lazy loaders for the invocation. |
required |
parameters
|
Dict[str, Any]
|
The parameters for the invocation. |
required |
default_parameters
|
Dict[str, Any]
|
The default parameters for the invocation. |
required |
upstream_steps
|
Set[str]
|
The upstream steps for the invocation. |
required |
custom_id
|
Optional[str]
|
Custom ID to use for the invocation. |
None
|
allow_id_suffix
|
bool
|
Whether a suffix can be appended to the invocation ID. |
True
|
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the method is called on an inactive pipeline or if the invocation was called with an artifact from a different pipeline. |
Returns:
| Type | Description |
|---|---|
str
|
The step invocation ID. |
Source code in src/zenml/pipelines/pipeline_definition.py
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 | |
build(settings: Optional[Mapping[str, SettingsOrDict]] = None, step_configurations: Optional[Mapping[str, StepConfigurationUpdateOrDict]] = None, config_path: Optional[str] = None) -> Optional[PipelineBuildResponse]
Builds Docker images for the pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings
|
Optional[Mapping[str, SettingsOrDict]]
|
Settings for the pipeline. |
None
|
step_configurations
|
Optional[Mapping[str, StepConfigurationUpdateOrDict]]
|
Configurations for steps of the pipeline. |
None
|
config_path
|
Optional[str]
|
Path to a yaml configuration file. This file will
be parsed as a
|
None
|
Returns:
| Type | Description |
|---|---|
Optional[PipelineBuildResponse]
|
The build output. |
Source code in src/zenml/pipelines/pipeline_definition.py
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 | |
configure(enable_cache: Optional[bool] = None, enable_artifact_metadata: Optional[bool] = None, enable_artifact_visualization: Optional[bool] = None, enable_step_logs: Optional[bool] = None, enable_heartbeat: Optional[bool] = None, environment: Optional[Dict[str, Any]] = None, secrets: Optional[Sequence[Union[UUID, str]]] = None, enable_pipeline_logs: Optional[bool] = None, settings: Optional[Mapping[str, SettingsOrDict]] = None, tags: Optional[List[Union[str, Tag]]] = None, extra: Optional[Dict[str, Any]] = None, on_failure: Optional[HookSpecification] = None, on_success: Optional[HookSpecification] = None, on_start: Optional[HookSpecification] = None, on_end: Optional[HookSpecification] = None, on_pause: Optional[HookSpecification] = None, on_resume: Optional[HookSpecification] = None, on_init: Optional[InitHookSpecification] = None, on_init_kwargs: Optional[Dict[str, Any]] = None, on_cleanup: Optional[HookSpecification] = None, model: Optional[Model] = None, retry: Optional[StepRetryConfig] = None, parameters: Optional[Dict[str, Any]] = None, substitutions: Optional[Dict[str, str]] = None, execution_mode: Optional[ExecutionMode] = None, cache_policy: Optional[CachePolicyOrString] = None, merge: bool = True) -> Self
Configures the pipeline.
Configuration merging example:
* merge==True:
pipeline.configure(extra={"key1": 1})
pipeline.configure(extra={"key2": 2}, merge=True)
pipeline.configuration.extra # {"key1": 1, "key2": 2}
* merge==False:
pipeline.configure(extra={"key1": 1})
pipeline.configure(extra={"key2": 2}, merge=False)
pipeline.configuration.extra # {"key2": 2}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enable_cache
|
Optional[bool]
|
If caching should be enabled for this pipeline. |
None
|
enable_artifact_metadata
|
Optional[bool]
|
If artifact metadata should be enabled for this pipeline. |
None
|
enable_artifact_visualization
|
Optional[bool]
|
If artifact visualization should be enabled for this pipeline. |
None
|
enable_step_logs
|
Optional[bool]
|
If step logs should be enabled for this pipeline. |
None
|
enable_heartbeat
|
Optional[bool]
|
If heartbeat should be enabled for this pipeline. |
None
|
environment
|
Optional[Dict[str, Any]]
|
Environment variables to set when running this pipeline. |
None
|
secrets
|
Optional[Sequence[Union[UUID, str]]]
|
Secrets to set as environment variables when running this pipeline. |
None
|
enable_pipeline_logs
|
Optional[bool]
|
If pipeline logs should be enabled for this pipeline. |
None
|
settings
|
Optional[Mapping[str, SettingsOrDict]]
|
Settings for this pipeline. |
None
|
tags
|
Optional[List[Union[str, Tag]]]
|
Tags to apply to runs of this pipeline. |
None
|
extra
|
Optional[Dict[str, Any]]
|
Extra configurations for this pipeline. |
None
|
on_failure
|
Optional[HookSpecification]
|
Hook run when the pipeline fails. A callable taking
an optional |
None
|
on_success
|
Optional[HookSpecification]
|
Hook run when the pipeline succeeds. A no-arg callable, or a source path to one. Static pipelines propagate it to each step as a default. Dynamic pipelines run it once at the run level. |
None
|
on_start
|
Optional[HookSpecification]
|
Hook run when the pipeline starts. A no-arg callable, or a source path to one. Static pipelines propagate it to each step as a default. Dynamic pipelines run it once at the run level. |
None
|
on_end
|
Optional[HookSpecification]
|
Hook run when the pipeline ends. A callable taking an
optional |
None
|
on_pause
|
Optional[HookSpecification]
|
Hook run when the run pauses. A no-arg callable, or a source path to one. Static pipelines ignore it. Dynamic pipelines run it once at the run level. |
None
|
on_resume
|
Optional[HookSpecification]
|
Hook run when a paused run resumes. A no-arg callable, or a source path to one. Static pipelines ignore it. Dynamic pipelines run it once at the run level. |
None
|
on_init
|
Optional[InitHookSpecification]
|
Callback function to run on initialization of the pipeline.
Can be a function with no arguments, or a source path to such a
function (e.g. |
None
|
on_init_kwargs
|
Optional[Dict[str, Any]]
|
Arguments for the init hook. |
None
|
on_cleanup
|
Optional[HookSpecification]
|
Callback function to run on cleanup of the pipeline. Can
be a function with no arguments, or a source path to such a
function with no arguments (e.g. |
None
|
model
|
Optional[Model]
|
configuration of the model version in the Model Control Plane. |
None
|
retry
|
Optional[StepRetryConfig]
|
Retry configuration for the pipeline steps. |
None
|
parameters
|
Optional[Dict[str, Any]]
|
input parameters for the pipeline. |
None
|
substitutions
|
Optional[Dict[str, str]]
|
Extra substitutions for pipeline run, model and artifact name placeholders. |
None
|
execution_mode
|
Optional[ExecutionMode]
|
The execution mode of the pipeline. |
None
|
cache_policy
|
Optional[CachePolicyOrString]
|
Cache policy for this pipeline. |
None
|
merge
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
Self
|
The pipeline instance that this method was called on. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If on_init_kwargs is provided but on_init is not and the init hook source is found in the current pipeline configuration. |
Source code in src/zenml/pipelines/pipeline_definition.py
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 | |
copy() -> Self
Copies the pipeline.
Returns:
| Type | Description |
|---|---|
Self
|
The pipeline copy. |
Source code in src/zenml/pipelines/pipeline_definition.py
1641 1642 1643 1644 1645 1646 1647 | |
create_run_template(name: str, **kwargs: Any) -> RunTemplateResponse
DEPRECATED: Create a run template for the pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the run template. |
required |
**kwargs
|
Any
|
Keyword arguments for the client method to create a run template. |
{}
|
Returns:
| Type | Description |
|---|---|
RunTemplateResponse
|
The created run template. |
Source code in src/zenml/pipelines/pipeline_definition.py
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 | |
create_snapshot(name: str, description: Optional[str] = None, replace: Optional[bool] = None, tags: Optional[List[str]] = None) -> PipelineSnapshotResponse
Create a snapshot of the pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the snapshot. |
required |
description
|
Optional[str]
|
The description of the snapshot. |
None
|
replace
|
Optional[bool]
|
Whether to replace the existing snapshot with the same name. |
None
|
tags
|
Optional[List[str]]
|
The tags to add to the snapshot. |
None
|
Returns:
| Type | Description |
|---|---|
PipelineSnapshotResponse
|
The created snapshot. |
Source code in src/zenml/pipelines/pipeline_definition.py
1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 | |
deploy(deployment_name: str, timeout: Optional[int] = None, *args: Any, **kwargs: Any) -> DeploymentResponse
Deploy the pipeline for online inference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
deployment_name
|
str
|
The name to use for the deployment. |
required |
timeout
|
Optional[int]
|
The maximum time in seconds to wait for the pipeline to be deployed. |
None
|
*args
|
Any
|
Pipeline entrypoint input arguments. |
()
|
**kwargs
|
Any
|
Pipeline entrypoint input keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
DeploymentResponse
|
The deployment response. |
Source code in src/zenml/pipelines/pipeline_definition.py
875 876 877 878 879 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 | |
log_pipeline_snapshot_metadata(snapshot: PipelineSnapshotResponse) -> None
staticmethod
Displays logs based on the snapshot model upon running a pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotResponse
|
The model for the pipeline snapshot |
required |
Source code in src/zenml/pipelines/pipeline_definition.py
1195 1196 1197 1198 1199 1200 1201 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 | |
prepare(*args: Any, **kwargs: Any) -> None
Prepares the pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
Any
|
Pipeline entrypoint input arguments. |
()
|
**kwargs
|
Any
|
Pipeline entrypoint input keyword arguments. |
{}
|
Source code in src/zenml/pipelines/pipeline_definition.py
657 658 659 660 661 662 663 664 665 666 667 668 669 670 | |
register() -> PipelineResponse
Register the pipeline in the server.
Returns:
| Type | Description |
|---|---|
PipelineResponse
|
The registered pipeline model. |
Source code in src/zenml/pipelines/pipeline_definition.py
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 | |
replay(pipeline: Union[UUID, str, None] = None, pipeline_run: Union[UUID, str, None] = None, skip: Union[Set[str], Sequence[str], None] = None, skip_successful_steps: bool = False, input_overrides: Optional[Mapping[str, Any]] = None, step_input_overrides: Optional[Mapping[str, Mapping[str, Any]]] = None, debug: bool = False) -> PipelineRunResponse
Replay the pipeline.
The run to replay gets determined as follows: - If you specify a pipeline run, that specific pipeline run is replayed. - If you specify a pipeline, the last run of that pipeline is replayed. - If you don't specify anything, the last run of the pipeline with the name of this pipeline instance is replayed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline
|
Union[UUID, str, None]
|
The pipeline to replay. |
None
|
pipeline_run
|
Union[UUID, str, None]
|
The pipeline run to replay. |
None
|
skip
|
Union[Set[str], Sequence[str], None]
|
The steps to skip when replaying the pipeline. Steps that have any unskipped upstream steps can not be skipped. |
None
|
skip_successful_steps
|
bool
|
Whether to skip successful steps of the original run when replaying the pipeline. |
False
|
input_overrides
|
Optional[Mapping[str, Any]]
|
Input overrides for the pipeline. |
None
|
step_input_overrides
|
Optional[Mapping[str, Mapping[str, Any]]]
|
Input overrides for replayed step inputs.
Keys must be step invocation IDs and values must map input names
to either plain Python values, |
None
|
debug
|
bool
|
Whether to run the pipeline in debug mode. In debug mode, the pipeline is executed using a local orchestrator, while keeping the remaining components of your active stack. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If no pipeline run can be found for the pipeline. |
Returns:
| Type | Description |
|---|---|
PipelineRunResponse
|
The replayed pipeline run. |
Source code in src/zenml/pipelines/pipeline_definition.py
1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 | |
resolve() -> Source
Resolves the pipeline.
Returns:
| Type | Description |
|---|---|
Source
|
The pipeline source. |
Source code in src/zenml/pipelines/pipeline_definition.py
321 322 323 324 325 326 327 | |
with_options(run_name: Optional[str] = None, schedule: Optional[Schedule] = None, build: Union[str, UUID, PipelineBuildBase, None] = None, step_configurations: Optional[Mapping[str, StepConfigurationUpdateOrDict]] = None, steps: Optional[Mapping[str, StepConfigurationUpdateOrDict]] = None, config_path: Optional[str] = None, unlisted: bool = False, prevent_build_reuse: bool = False, **kwargs: Any) -> Pipeline
Copies the pipeline and applies the given configurations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_name
|
Optional[str]
|
Name of the pipeline run. |
None
|
schedule
|
Optional[Schedule]
|
Optional schedule to use for the run. |
None
|
build
|
Union[str, UUID, PipelineBuildBase, None]
|
Optional build to use for the run. |
None
|
step_configurations
|
Optional[Mapping[str, StepConfigurationUpdateOrDict]]
|
Configurations for steps of the pipeline. |
None
|
steps
|
Optional[Mapping[str, StepConfigurationUpdateOrDict]]
|
Configurations for steps of the pipeline. This is equivalent
to |
None
|
config_path
|
Optional[str]
|
Path to a yaml configuration file. This file will
be parsed as a
|
None
|
unlisted
|
bool
|
DEPRECATED. This option is no longer supported. |
False
|
prevent_build_reuse
|
bool
|
DEPRECATED: Use
|
False
|
**kwargs
|
Any
|
Pipeline configuration options. These will be passed
to the |
{}
|
Returns:
| Type | Description |
|---|---|
Pipeline
|
The copied pipeline instance. |
Source code in src/zenml/pipelines/pipeline_definition.py
1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 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 | |
write_run_configuration_template(path: str, stack: Optional[Stack] = None) -> None
Writes a run configuration yaml template.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The path where the template will be written. |
required |
stack
|
Optional[Stack]
|
The stack for which the template should be generated. If not given, the active stack will be used. |
None
|
Source code in src/zenml/pipelines/pipeline_definition.py
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 | |
Functions:
Modules
run_utils
Utility functions for running pipelines.
Classes
Functions:
create_placeholder_run(snapshot: PipelineSnapshotResponse, orchestrator_run_id: Optional[str] = None, logs: Optional[LogsRequest] = None, trigger_info: Optional[PipelineRunTriggerInfo] = None, original_run_id: Optional[UUID] = None, parent_run_id: Optional[UUID] = None, child_key: Optional[str] = None) -> PipelineRunResponse
Create a placeholder run for the snapshot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotResponse
|
The snapshot for which to create the placeholder run. |
required |
orchestrator_run_id
|
Optional[str]
|
The orchestrator run ID for the run. |
None
|
logs
|
Optional[LogsRequest]
|
The logs for the run. |
None
|
trigger_info
|
Optional[PipelineRunTriggerInfo]
|
The trigger information for the run. |
None
|
original_run_id
|
Optional[UUID]
|
The original run ID for a replayed run. |
None
|
parent_run_id
|
Optional[UUID]
|
Parent run ID for nested child pipeline runs. |
None
|
child_key
|
Optional[str]
|
Stable per-parent identifier of the child pipeline call that produced this child run. |
None
|
Returns:
| Type | Description |
|---|---|
PipelineRunResponse
|
The placeholder run. |
Source code in src/zenml/pipelines/run_utils.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
get_all_sources_from_value(value: Any) -> List[Source]
Get all source objects from a value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
Any
|
The value from which to get all the source objects. |
required |
Returns:
| Type | Description |
|---|---|
List[Source]
|
List of source objects for the given value. |
Source code in src/zenml/pipelines/run_utils.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | |
get_default_run_name(pipeline_name: str) -> str
Gets the default name for a pipeline run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline_name
|
str
|
Name of the pipeline which will be run. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Run name. |
Source code in src/zenml/pipelines/run_utils.py
64 65 66 67 68 69 70 71 72 73 | |
upload_notebook_cell_code_if_necessary(snapshot: PipelineSnapshotBase, stack: Stack) -> None
Upload notebook cell code if necessary.
This function checks if any of the steps of the pipeline that will be executed in a different process are defined in a notebook. If that is the case, it will extract that notebook cell code into python files and upload an archive of all the necessary files to the artifact store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
snapshot
|
PipelineSnapshotBase
|
The snapshot. |
required |
stack
|
Stack
|
The stack on which the snapshot will happen. |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the code for one of the steps that will run out of process cannot be extracted into a python file. |
Source code in src/zenml/pipelines/run_utils.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | |
validate_run_config_is_runnable_from_server(run_configuration: PipelineRunConfiguration, is_dynamic: bool) -> None
Validates that the run configuration can be used to run from the server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_configuration
|
PipelineRunConfiguration
|
The run configuration to validate. |
required |
is_dynamic
|
bool
|
Whether the snapshot to run is dynamic. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If there are values in the run configuration that are not allowed when running a pipeline from the server. |
Source code in src/zenml/pipelines/run_utils.py
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 | |
validate_stack_is_runnable_from_server(zen_store: BaseZenStore, stack: StackResponse) -> None
Validate if a stack model is runnable from the server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
zen_store
|
BaseZenStore
|
ZenStore to use for listing flavors. |
required |
stack
|
StackResponse
|
The stack to validate. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the stack has components of a custom flavor or local components. |
Source code in src/zenml/pipelines/run_utils.py
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 | |
wait_for_pipeline_run_to_finish(run_id: UUID) -> PipelineRunResponse
Waits until a pipeline run is finished.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run_id
|
UUID
|
ID of the run for which to wait. |
required |
Returns:
| Type | Description |
|---|---|
PipelineRunResponse
|
Model of the finished run. |
Source code in src/zenml/pipelines/run_utils.py
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 | |