From 2d07b1f254399386fad13d64eb07e25cc77e8a7b Mon Sep 17 00:00:00 2001 From: Paul Dittamo Date: Wed, 5 Aug 2026 17:37:51 -0700 Subject: [PATCH] Fall back to _F_PATH_REWRITE env var for actor tasks in rusty.run_task Regular tasks pick up accelerated-inputs path rewriting because the runtime entrypoint reads the _F_PATH_REWRITE pod env var. Actor tasks enter through rusty.run_task instead, which only honors the path_rewrite_cfg kwarg - and workers that don't forward it silently leave actors reading inputs from remote storage even when the local mirror is mounted. Default the kwarg from the pod env var, mirroring _bin/runtime.py. An explicitly passed kwarg still takes precedence, and the existing mount-existence check keeps every skew combination safe (missing mount or absent config degrades to remote reads, today's behavior). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MsS7fjndEwkicFKLcguRpi --- src/flyte/_internal/runtime/rusty.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/flyte/_internal/runtime/rusty.py b/src/flyte/_internal/runtime/rusty.py index 54622a713..f214d214c 100644 --- a/src/flyte/_internal/runtime/rusty.py +++ b/src/flyte/_internal/runtime/rusty.py @@ -1,4 +1,5 @@ import asyncio +import os import time from datetime import datetime from typing import List, Optional, Tuple @@ -14,6 +15,8 @@ from flyte._utils import adjust_sys_path from flyte.models import ActionID, CheckpointPaths, CodeBundle, PathRewrite, RawDataPath +_F_PATH_REWRITE = "_F_PATH_REWRITE" + async def download_tgz(destination: str, version: str, tgz: str) -> CodeBundle: """ @@ -141,6 +144,11 @@ async def run_task( f" at {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(start_time))}" ) + if path_rewrite_cfg is None: + # Workers may not forward the path-rewrite config as an argument; fall back + # to the pod env var, same as the standard runtime entrypoint. + path_rewrite_cfg = os.getenv(_F_PATH_REWRITE, None) + path_rewrite = PathRewrite.from_str(path_rewrite_cfg) if path_rewrite_cfg else None if path_rewrite: import flyte.storage as storage