Example #1
0
    def build(pipeline, environment_config, mode=None, step_keys_to_execute=None):
        """Here we build a new ExecutionPlan from a pipeline definition and the environment config.

        To do this, we iterate through the pipeline's solids in topological order, and hand off the
        execution steps for each solid to a companion _PlanBuilder object.

        Once we've processed the entire pipeline, we invoke _PlanBuilder.build() to construct the
        ExecutionPlan object.
        """
        check.inst_param(pipeline, "pipeline", IPipeline)
        check.inst_param(environment_config, "environment_config", EnvironmentConfig)
        check.opt_str_param(mode, "mode")
        check.opt_list_param(step_keys_to_execute, "step_keys_to_execute", of_type=str)

        step_handles_to_execute = (
            [StepHandle.from_key(key) for key in step_keys_to_execute]
            if step_keys_to_execute
            else None
        )

        plan_builder = _PlanBuilder(
            pipeline,
            environment_config,
            mode=mode,
            step_handles_to_execute=step_handles_to_execute,
        )

        # Finally, we build and return the execution plan
        return plan_builder.build()
Example #2
0
 def build_subset_plan(self, step_keys_to_execute):
     check.list_param(step_keys_to_execute, "step_keys_to_execute", of_type=str)
     step_handles_to_execute = [StepHandle.from_key(key) for key in step_keys_to_execute]
     return ExecutionPlan(
         self.pipeline,
         self.step_dict,
         step_handles_to_execute,
         self.artifacts_persisted,
         self.environment_config,
     )