Skip to content

Commit

Permalink
Generate decks at local execution (#1699)
Browse files Browse the repository at this point in the history
* Output deck at local execution
  • Loading branch information
pingsutw authored Jun 26, 2023
1 parent 0b64f21 commit 3b064dc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions flytekit/core/base_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ def dispatch_execute(

# Invoked before the task is executed
new_user_params = self.pre_execute(ctx.user_space_params)
from flytekit.deck.deck import _output_deck

# Create another execution context with the new user params, but let's keep the same working dir
with FlyteContextManager.with_context(
Expand Down Expand Up @@ -601,6 +602,10 @@ def dispatch_execute(
for k, v in native_outputs_as_map.items():
output_deck.append(TypeEngine.to_html(ctx, v, self.get_type_for_output_var(k, v)))

if ctx.execution_state and ctx.execution_state.mode == ExecutionState.Mode.LOCAL_WORKFLOW_EXECUTION:
# When we run the workflow remotely, flytekit outputs decks at the end of _dispatch_execute
_output_deck(self.name.split(".")[-1], new_user_params)

outputs_literal_map = _literal_models.LiteralMap(literals=literals)
# After the execute has been successfully completed
return outputs_literal_map
Expand Down

0 comments on commit 3b064dc

Please sign in to comment.