Skip to content

Commit 98131cf

Browse files
bitboyrorbotnarialexzhang13
authored
fix: ensure docker env uses shared workspace dir (#48)
* fix: ensure docker env uses shared workspace dir * linter fixes --------- Co-authored-by: rbotnari <rbotnari@axway.com> Co-authored-by: Alex Zhang <alex.lx.zhang@gmail.com>
1 parent 18a9368 commit 98131cf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎rlm/environments/docker_repl.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ def __init__(
197197
self.proxy_server: HTTPServer | None = None
198198
self.proxy_thread: threading.Thread | None = None
199199
self.proxy_port: int = 0
200-
self.temp_dir = tempfile.mkdtemp(prefix="docker_repl_")
200+
base_dir = os.environ.get(
201+
"RLM_DOCKER_WORKSPACE_DIR", os.path.join(os.getcwd(), ".rlm_workspace")
202+
)
203+
os.makedirs(base_dir, exist_ok=True)
204+
self.temp_dir = tempfile.mkdtemp(prefix="docker_repl_", dir=base_dir)
201205
self.pending_calls: list[RLMChatCompletion] = []
202206
self._calls_lock = threading.Lock()
203207

0 commit comments

Comments
 (0)