Skip to content

Commit 07423be

Browse files
committed
fix moatless source
1 parent 90d58fb commit 07423be

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

moatless/runner/docker_runner.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ async def start_job(
271271
elif effective_memory_limit:
272272
# If memory limit is set but swap limit is not, default to twice the memory limit
273273
cmd.extend(["--memory-swap", effective_memory_limit])
274+
275+
# Add ulimit for file descriptors to prevent "Too many open files" errors
276+
cmd.extend(["--ulimit", "nofile=65536:65536"])
274277

275278
# Add Docker labels for easier container identification and querying
276279
job_labels = create_labels(project_id, trajectory_id)
@@ -292,6 +295,9 @@ async def start_job(
292295
if self.moatless_source_dir:
293296
logger.info(f"Mounting {self.moatless_source_dir}:/opt/moatless/moatless")
294297
cmd.extend(["-v", f"{self.moatless_source_dir}:/opt/moatless/moatless"])
298+
# Also mount the lockfile to ensure dependency compatibility
299+
cmd.extend(["-v", f"{self.moatless_source_dir}/uv.lock:/opt/moatless/uv.lock"])
300+
cmd.extend(["-v", f"{self.moatless_source_dir}/pyproject.toml:/opt/moatless/pyproject.toml"])
295301
cmd.extend(["-e", "PYTHONPATH=/opt/moatless/moatless:$PYTHONPATH"])
296302

297303
args = create_job_args(project_id, trajectory_id, job_func, node_id)
@@ -311,6 +317,10 @@ async def start_job(
311317
self.logger.info(f"Will run update-moatless.sh with branch {branch_to_use}")
312318
run_command += f"/opt/moatless/docker/update-moatless.sh --branch {branch_to_use} && "
313319

320+
# If using local source, sync dependencies first (not frozen) to use local lockfile
321+
if self.moatless_source_dir:
322+
run_command += "cd /opt/moatless && uv sync --compile-bytecode --all-extras && "
323+
314324
# Add the main job command
315325
run_command += f"date '+%Y-%m-%d %H:%M:%S' && echo 'Starting job at ' $(date '+%Y-%m-%d %H:%M:%S') && uv run - <<EOF\n{args}\nEOF"
316326

0 commit comments

Comments
 (0)