|
47 | 47 | ENV_ZENML_RUN_SINGLE_STEPS_WITHOUT_STACK, |
48 | 48 | handle_bool_env_var, |
49 | 49 | ) |
| 50 | +from zenml.enums import StepRuntime |
50 | 51 | from zenml.exceptions import StepInterfaceError |
51 | 52 | from zenml.logger import get_logger |
52 | 53 | from zenml.materializers.base_materializer import BaseMaterializer |
@@ -131,7 +132,7 @@ def __init__( |
131 | 132 | retry: Optional[StepRetryConfig] = None, |
132 | 133 | substitutions: Optional[Dict[str, str]] = None, |
133 | 134 | cache_policy: Optional[CachePolicyOrString] = None, |
134 | | - in_process: Optional[bool] = None, |
| 135 | + runtime: Optional[StepRuntime] = None, |
135 | 136 | ) -> None: |
136 | 137 | """Initializes a step. |
137 | 138 |
|
@@ -165,8 +166,10 @@ def __init__( |
165 | 166 | retry: Configuration for retrying the step in case of failure. |
166 | 167 | substitutions: Extra placeholders to use in the name template. |
167 | 168 | cache_policy: Cache policy for this step. |
168 | | - in_process: Whether to run the step in process. This is only |
169 | | - applicable for dynamic pipelines. |
| 169 | + runtime: The step runtime. If not configured, the step will |
| 170 | + run inline unless a step operator or docker/resource settings |
| 171 | + are configured. This is only applicable for dynamic |
| 172 | + pipelines. |
170 | 173 | """ |
171 | 174 | from zenml.config.step_configurations import PartialStepConfiguration |
172 | 175 |
|
@@ -233,7 +236,7 @@ def __init__( |
233 | 236 | retry=retry, |
234 | 237 | substitutions=substitutions, |
235 | 238 | cache_policy=cache_policy, |
236 | | - in_process=in_process, |
| 239 | + runtime=runtime, |
237 | 240 | ) |
238 | 241 |
|
239 | 242 | notebook_utils.try_to_save_notebook_cell_code(self.source_object) |
@@ -717,7 +720,7 @@ def configure( |
717 | 720 | retry: Optional[StepRetryConfig] = None, |
718 | 721 | substitutions: Optional[Dict[str, str]] = None, |
719 | 722 | cache_policy: Optional[CachePolicyOrString] = None, |
720 | | - in_process: Optional[bool] = None, |
| 723 | + runtime: Optional[StepRuntime] = None, |
721 | 724 | merge: bool = True, |
722 | 725 | ) -> T: |
723 | 726 | """Configures the step. |
@@ -761,8 +764,8 @@ def configure( |
761 | 764 | retry: Configuration for retrying the step in case of failure. |
762 | 765 | substitutions: Extra placeholders to use in the name template. |
763 | 766 | cache_policy: Cache policy for this step. |
764 | | - in_process: Whether to run the step in process. This is only |
765 | | - applicable for dynamic pipelines. |
| 767 | + runtime: The step runtime. This is only applicable for dynamic |
| 768 | + pipelines. |
766 | 769 | merge: If `True`, will merge the given dictionary configurations |
767 | 770 | like `parameters` and `settings` with existing |
768 | 771 | configurations. If `False` the given configurations will |
@@ -841,7 +844,7 @@ def _convert_to_tuple(value: Any) -> Tuple[Source, ...]: |
841 | 844 | "retry": retry, |
842 | 845 | "substitutions": substitutions, |
843 | 846 | "cache_policy": cache_policy, |
844 | | - "in_process": in_process, |
| 847 | + "runtime": runtime, |
845 | 848 | } |
846 | 849 | ) |
847 | 850 | config = StepConfigurationUpdate(**values) |
@@ -870,7 +873,7 @@ def with_options( |
870 | 873 | retry: Optional[StepRetryConfig] = None, |
871 | 874 | substitutions: Optional[Dict[str, str]] = None, |
872 | 875 | cache_policy: Optional[CachePolicyOrString] = None, |
873 | | - in_process: Optional[bool] = None, |
| 876 | + runtime: Optional[StepRuntime] = None, |
874 | 877 | merge: bool = True, |
875 | 878 | ) -> "BaseStep": |
876 | 879 | """Copies the step and applies the given configurations. |
@@ -904,8 +907,8 @@ def with_options( |
904 | 907 | retry: Configuration for retrying the step in case of failure. |
905 | 908 | substitutions: Extra placeholders for the step name. |
906 | 909 | cache_policy: Cache policy for this step. |
907 | | - in_process: Whether to run the step in process. This is only |
908 | | - applicable for dynamic pipelines. |
| 910 | + runtime: The step runtime. This is only applicable for dynamic |
| 911 | + pipelines. |
909 | 912 | merge: If `True`, will merge the given dictionary configurations |
910 | 913 | like `parameters` and `settings` with existing |
911 | 914 | configurations. If `False` the given configurations will |
@@ -935,7 +938,7 @@ def with_options( |
935 | 938 | retry=retry, |
936 | 939 | substitutions=substitutions, |
937 | 940 | cache_policy=cache_policy, |
938 | | - in_process=in_process, |
| 941 | + runtime=runtime, |
939 | 942 | merge=merge, |
940 | 943 | ) |
941 | 944 | return step_copy |
|
0 commit comments