Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dest_dir into pythonpath before loading modules #2692

Merged
merged 13 commits into from
Sep 23, 2024
8 changes: 7 additions & 1 deletion flytekit/bin/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,13 @@ def fast_execute_task_cmd(additional_distribution: str, dest_dir: str, task_exec

# Use the commandline to run the task execute command rather than calling it directly in python code
# since the current runtime bytecode references the older user code, rather than the downloaded distribution.
p = subprocess.Popen(cmd)
env = os.environ.copy()
if dest_dir is not None:
if "PYTHONPATH" in env:
env["PYTHONPATH"] += os.pathsep + os.path.realpath(dest_dir)
else:
env["PYTHONPATH"] = os.path.realpath(dest_dir)
pingsutw marked this conversation as resolved.
Show resolved Hide resolved
p = subprocess.Popen(cmd, env=env)

def handle_sigterm(signum, frame):
logger.info(f"passing signum {signum} [frame={frame}] to subprocess")
Expand Down
Loading