Skip to content

Use per-run temp dirs for mounts instead of fixed /mnt paths - #10

Merged
yarikoptic merged 1 commit into
masterfrom
claude/tender-turing-ec1gdn
Sep 24, 2026
Merged

yarikoptic merged 1 commit into
masterfrom
claude/tender-turing-ec1gdn

Conversation

@yarikoptic-gitmate

Copy link
Copy Markdown

Summary

Changes all three backends (eval-under-nfs, eval-under-loop, eval-under-beegfs) to default to per-run mountpoints under $TMPDIR instead of fixed /mnt/<backend> paths. This eliminates collisions between concurrent runs, removes the need for pre-existing /mnt directories, and makes leftover mounts self-describing.

Key Changes

  • Default mountpoint derivation: Each backend now derives MNT from a MNT_BASE created via mktemp -u, generating sibling paths like ~/.tmp/eval-under-nfs-B3UXj.orig (backing) and ~/.tmp/eval-under-nfs-B3UXj.nfs (mount). The old fixed defaults (/mnt/nfs, /mnt/loop, /mnt/beegfs) are no longer used unless explicitly passed via --mount-point or EVAL_UNDER_MOUNT.

  • Selective teardown: Added MNT_CREATED flag to track whether the current run created the mountpoint. Teardown now only removes the mountpoint if this run created it, preserving pre-existing directories passed via --mount-point.

  • Updated documentation:

    • Help text for --mount-point now explains the new default behavior with concrete examples
    • Added rationale for why the old fixed paths were problematic (collisions, root requirement, opacity)
    • Updated README with examples of the new per-run directory layout
    • Updated GOTCHAS.md to use generic <mount> placeholder instead of hardcoded /mnt/beegfs
    • Updated contributor guidelines in README to document the new pattern for future backends
  • Consistent implementation across backends: All three backends follow the same pattern for consistency and maintainability.

Implementation Details

  • MNT_BASE is created once per run using mktemp -u (reserves name without creating directory)
  • Actual mountpoint directory is created by the backend's mount_*() function, which also sets MNT_CREATED=1 if the directory didn't pre-exist
  • Explicit --mount-point still works as before and takes precedence over the derived default
  • Backing state (NFS export dir, loop image, BeeGFS data root) remains on its own path to avoid self-referential mounts

https://claude.ai/code/session_011udwBohkmsizgX1nGUDUBG

Every backend mounted on a fixed path (/mnt/nfs, /mnt/loop,
/mnt/beegfs) while the backing state it creates -- the exported .orig
dir, the loop .img -- lived under $TMPDIR. So a run told to work in
~/.tmp still handed the wrapped command TMPDIR=/mnt/nfs: concurrent
runs collided on one mountpoint, the directory needed root under /mnt
just to exist, and nothing in the path said which run owned the mount.

Derive the mountpoint from the same `mktemp -u` base as the backing
state instead, as a sibling suffixed with the backend name:

  ~/.tmp/eval-under-nfs-B3UXj.orig   exported backing dir
  ~/.tmp/eval-under-nfs-B3UXj.nfs    where this run mounts it

--mount-point / EVAL_UNDER_MOUNT still pin the mount to a fixed path
when one is actually wanted. Teardown now removes the mountpoint only
if this run created it, so an explicitly given directory that predates
us is unmounted rather than deleted.

beegfs --data-root stays /beegfs: it is bind-mounted into the
containers and has to sit on a local filesystem with working extended
attributes, which $TMPDIR (tmpfs on plenty of systems) does not
guarantee. Rationale now spelled out in its --help entry.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011udwBohkmsizgX1nGUDUBG

Copy link
Copy Markdown
Author

CI: every red cell so far is the matrix baseline, not this change

Checked each failing cell of run 35807756537 against master's last scheduled run, 35590469985, which ran on eb99fc6 — this PR's base:

Cell This PR master baseline
Loop ext4 / git-annex test fail fail
Loop vfat / git-annex test fail fail
Loop vfat / git testsuite fail fail
Loop vfat / stress-ng fail fail
Loop vfat / pjdfstest fail fail
NFS (localhost) / pjdfstest fail fail
BeeGFS 7.4.6 / pjdfstest fail fail
BeeGFS 8.1.0 / pjdfstest fail fail

Not just the same conclusions — the same findings:

  • NFS / pjdfstest reproduces the breakdown GOTCHAS records for that cell exactly: chown/00.t 106 of 1280 failing plus the "TODO passed" batch, chmod/00.t 1, unlink/14.t 1, across 238 files / 8798 assertions. The suite ran to completion on the relocated mount, which is the thing worth knowing here.
  • Loop ext4 / git-annex test fails identically to master: 8 out of 13 tests failed, every one of them not enough free space, need ~78-82 MB more ... annex.diskreserve on get/copy against the 100 MB backing image.

The cells this change could plausibly have broken — where the mount moved out of /mnt/<backend> — are green: NFS / git-annex test, NFS / stress-ng, all three Loop ext4 suites, BeeGFS stress-ng on both versions.

Still running: NFS / git testsuite, BeeGFS 7.4.6 + 8.1.0 / git testsuite (green on master, so they are the ones left to confirm) and BeeGFS git-annex test on both versions (red on master). I'll follow up only if one of the baseline-green cells comes back red.

No re-run spent on the above: these are deterministic, documented filesystem findings reproduced assertion-for-assertion on the base branch, so a re-run has nothing to disambiguate.


Generated by Claude Code

@yarikoptic
yarikoptic merged commit aa98679 into master Sep 24, 2026
13 of 23 checks passed
yarikoptic-gitmate pushed a commit that referenced this pull request Sep 24, 2026
master's PR #10 replaced every backend's fixed /mnt/<backend> with a
per-run directory derived from the same mktemp base as the backend's
backing state. This branch added a backend while that was landing, so
git merged bin/eval-under-sshfs cleanly and left it on /mnt/sshfs --
textually fine, and wrong: the README this merge brings in states that a
backend mounts next to its backing state "never a fixed /mnt/<backend>",
and its "Adding a new backend" contract names $MNT_BASE.<backend>
outright. The merge is only done once the new backend obeys it.

So eval-under-sshfs now derives both paths from one mktemp -u base:

  /tmp/eval-under-sshfs-B3UXj.scratch  host key, sshd conf, backing dir
  /tmp/eval-under-sshfs-B3UXj.sshfs    where this run mounts it

and teardown removes the mountpoint only when this run created it, so an
explicit --mount-point that predates us is unmounted rather than
deleted -- same rule the other backends now follow. The 755 on the
scratch dir (mktemp -d would give 700) now says why it is there: sshd
reads its config as root while the mount runs as the invoking user.

README's conflict was two additions to the same spot, not a
disagreement: master's mountpoint explanation follows the CLI flag list
it belongs to, then the Reproducing-a-report section.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E1fDiGVWKywpbhVps5hzQK
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.

3 participants