diff --git a/Dockerfile.dev b/Dockerfile.dev index 7b32939d39..760648d110 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -50,8 +50,5 @@ RUN SETUPTOOLS_SCM_PRETEND_VERSION_FOR_FLYTEKIT=$PSEUDO_VERSION \ && chown flytekit: /home \ && : - -ENV PYTHONPATH="/flytekit:/flytekit/plugins/flytekit-k8s-pod:/flytekit/plugins/flytekit-deck-standard:" - # Switch to the 'flytekit' user for better security. USER flytekit diff --git a/flytekit/bin/entrypoint.py b/flytekit/bin/entrypoint.py index e13650ee63..edbd0c10ea 100644 --- a/flytekit/bin/entrypoint.py +++ b/flytekit/bin/entrypoint.py @@ -6,6 +6,7 @@ import pathlib import signal import subprocess +import sys import tempfile import traceback from sys import exit @@ -376,6 +377,9 @@ def _execute_task( 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) resolver_obj = load_object_from_module(resolver) # Use the resolver to load the actual task object _task_def = resolver_obj.load_task(loader_args=resolver_args) @@ -424,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)