Skip to content

Commit 6c7574d

Browse files
authored
Update dynamic pipeline default execution mode (#4317)
* Update dynamic pipeline default execution mode * Docs
1 parent 6248efd commit 6c7574d

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

docs/book/how-to/steps-pipelines/dynamic_pipelines.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ When you call `.load()` on an artifact in a dynamic pipeline, it synchronously l
327327
- Mapping is currently supported only over artifacts produced within the same pipeline run (mapping over raw data or external artifacts is not supported).
328328
- Chunk size for mapped collection loading defaults to 1 and is not yet configurable.
329329

330+
### Execution mode
331+
332+
Currently only the `STOP_ON_FAILURE` execution mode is supported for dynamic pipelines, and will be used as a default.
333+
330334
## Best Practices
331335

332336
1. **Use `runtime="isolated"` for parallel steps**: This ensures better resource isolation and prevents interference between concurrent step executions.

src/zenml/orchestrators/base_orchestrator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,10 @@ def _validate_execution_mode(
636636
Raises:
637637
ValueError: If the execution mode is not supported.
638638
"""
639+
if snapshot.is_dynamic:
640+
# We can't validate execution modes for dynamic pipelines yet
641+
return
642+
639643
execution_mode = snapshot.pipeline_configuration.execution_mode
640644

641645
if execution_mode not in self.supported_execution_modes:

src/zenml/pipelines/dynamic/pipeline_definition.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
from zenml.client import Client
2828
from zenml.config.source import Source
29+
from zenml.enums import ExecutionMode
2930
from zenml.execution.pipeline.utils import (
3031
should_prevent_pipeline_execution,
3132
)
@@ -48,18 +49,20 @@ class DynamicPipeline(Pipeline):
4849

4950
def __init__(
5051
self,
51-
*args: Any,
52+
*,
5253
depends_on: Optional[List["BaseStep"]] = None,
5354
**kwargs: Any,
5455
) -> None:
5556
"""Initialize the pipeline.
5657
5758
Args:
58-
*args: Pipeline constructor arguments.
5959
depends_on: The steps that the pipeline depends on.
6060
**kwargs: Pipeline constructor keyword arguments.
6161
"""
62-
super().__init__(*args, **kwargs)
62+
# This is the only execution mode that is currently supported for
63+
# dynamic pipelines, so we default to it.
64+
kwargs.setdefault("execution_mode", ExecutionMode.STOP_ON_FAILURE)
65+
super().__init__(**kwargs)
6366
self._depends_on = depends_on or []
6467
self._validate_depends_on(self._depends_on)
6568

src/zenml/pipelines/pipeline_definition.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class Pipeline:
130130

131131
def __init__(
132132
self,
133+
*,
133134
name: str,
134135
entrypoint: F,
135136
enable_cache: Optional[bool] = None,

0 commit comments

Comments
 (0)