Skip to content

Fix autoresearch: bake into /opt to survive volume mount#108

Merged
max4c merged 1 commit intomainfrom
dj/containers-v1
Mar 10, 2026
Merged

Fix autoresearch: bake into /opt to survive volume mount#108
max4c merged 1 commit intomainfrom
dj/containers-v1

Conversation

@max4c
Copy link
Contributor

@max4c max4c commented Mar 10, 2026

Summary

  • The network volume mounts over /workspace at runtime, wiping out the baked-in autoresearch repo, deps, and prepared data
  • Fix: clone to /opt/autoresearch instead, and use the base image's /pre_start.sh hook to copy to /workspace/autoresearch on first boot
  • Only copies if /workspace/autoresearch/pyproject.toml doesn't exist (so it's a no-op on subsequent boots with a persistent volume)

Test plan

  • Build image locally and verify /opt/autoresearch/ has the repo + .venv/ + prepared data
  • Launch pod with volume at /workspace, verify /pre_start.sh populates /workspace/autoresearch/
  • Verify uv run train.py starts training successfully
  • Stop and restart pod — verify data persists from volume (no re-copy)

🤖 Generated with Claude Code

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>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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 && \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@max4c max4c merged commit f0cb59c into main Mar 10, 2026
6 checks passed
@max4c max4c deleted the dj/containers-v1 branch March 10, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants