Fix autoresearch: bake into /opt to survive volume mount#108
Conversation
The network volume mounts over /workspace at runtime, wiping out the baked-in repo. Clone to /opt/autoresearch instead and use /pre_start.sh to copy it to /workspace on first boot. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ad96308fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| RUN uv run prepare.py | ||
|
|
||
| # Copy to /workspace on first boot (volume mount overlays /workspace at runtime) | ||
| RUN echo '#!/bin/bash\nif [ ! -f /workspace/autoresearch/pyproject.toml ]; then\n cp -a /opt/autoresearch /workspace/autoresearch\nfi' > /pre_start.sh && \ |
There was a problem hiding this comment.
Generate /pre_start.sh with real newlines
Because this image is built from runpod/base (see official-templates/base/Dockerfile:4, which sets SHELL to Bash), this RUN echo '...\n...' is executed by Bash; Bash only interprets \n with echo -e (help echo: "-e enable interpretation of backslash escapes"). As written, /pre_start.sh is emitted as one line with literal \n, so when /start.sh runs it, the copy command never executes and /workspace/autoresearch is not populated on first boot with a mounted /workspace volume.
Useful? React with 👍 / 👎.
Summary
/workspaceat runtime, wiping out the baked-in autoresearch repo, deps, and prepared data/opt/autoresearchinstead, and use the base image's/pre_start.shhook to copy to/workspace/autoresearchon first boot/workspace/autoresearch/pyproject.tomldoesn't exist (so it's a no-op on subsequent boots with a persistent volume)Test plan
/opt/autoresearch/has the repo +.venv/+ prepared data/workspace, verify/pre_start.shpopulates/workspace/autoresearch/uv run train.pystarts training successfully🤖 Generated with Claude Code