Skip to content

Commit

Permalink
add working_dir in map task
Browse files Browse the repository at this point in the history
Signed-off-by: Nelson Chen <[email protected]>
  • Loading branch information
arbaobao committed Aug 19, 2024
1 parent 152d033 commit 4afb6ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flytekit/bin/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pathlib
import signal
import subprocess
import sys
import tempfile
import traceback
from sys import exit
Expand Down Expand Up @@ -376,8 +377,6 @@ def _execute_task(
dynamic_addl_distro,
dynamic_dest_dir,
) as ctx:
import sys

working_dir = os.getcwd()
if all(os.path.realpath(path) != working_dir for path in sys.path):
sys.path.append(working_dir)
Expand Down Expand Up @@ -429,6 +428,9 @@ def _execute_map_task(
with setup_execution(
raw_output_data_prefix, checkpoint_path, prev_checkpoint, dynamic_addl_distro, dynamic_dest_dir
) as ctx:
working_dir = os.getcwd()
if all(os.path.realpath(path) != working_dir for path in sys.path):
sys.path.append(working_dir)
task_index = _compute_array_job_index()
mtr = load_object_from_module(resolver)()
map_task = mtr.load_task(loader_args=resolver_args, max_concurrency=max_concurrency)
Expand Down

0 comments on commit 4afb6ae

Please sign in to comment.