edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
lane remoterun: scripts/remote-run.sh
Goal
Run heavy cargo commands on the two remote-user servers (host a, host b) instead of this
machine, per lane remoterun. Shell scripting only; no Rust code changed.
Base sha: 6120482d (main).
What changed
scripts/remote-run.sh(new). Usage:scripts/remote-run.sh <lane> [--host auto|a|b] [--with-edith] [--clean] -- <command...>- Source tree =
git rev-parse --show-toplevelof the cwd (works in worktrees). - rsync to
~/lanes/<lane>/edith_codecs/with-a --delete, excludingtarget/,/fixtures/,/.git. Remotegit init -qif.gitis missing (the.cargorunner needsgit rev-parse --show-toplevel). Remote symlinkfixtures -> ~/fixturesif absent (dangling is fine). --with-edithalso syncs$EDITH_TREE(default/home/user/Documents/Code/Rust/edith) to~/lanes/<lane>/edith/(excludingtarget/,/assets/,/.git) and runs there. Its path deps../../../edith_codecsresolve to~/lanes/<lane>/edith_codecs.- Host choice:
autotries a then b, each under the remoteflock -n 9on~/.remote-slot(exit 75 when busy). Retries every 20 s for 10 min, then runs locally withCARGO_TARGET_DIR=~/.cache/tgt-<lane> TMPDIR=~/.cache/tmp-<lane> CARGO_BUILD_JOBS=4. Explicit--hostretries the same way and then exits 75 (busy) or 255 (unreachable). - Remote env:
CARGO_TARGET_DIR=~/.cache/tgt-<lane>,TMPDIR=~/tmp/<lane>,CARGO_BUILD_JOBS=4,EC_MEMGUARD_MAX=6G(a localEC_*value wins). All localEC_*variables are forwarded. - The remote script is passed on stdin to
bash -c "$(cat)", so no quoting reaches fish. - stderr prints
remote-run: host=a|b|localwhen a run starts. Exit code is the remote's. --cleanremoves~/lanes/<lane>,~/.cache/tgt-<lane>,~/tmp/<lane>on both hosts, and~/.cache/tgt-<lane>,~/.cache/tmp-<lane>locally.
- Source tree =
scripts/memguard-runner.sh: allMemoryMax=10GbecameMemoryMax=${EC_MEMGUARD_MAX:-10G}(5 occurrences), header comment updated.
Verify commands and results
Run from ~/.cache/wt/remoterun on branch lane/remoterun.
scripts/remote-run.sh remoterun-selftest --host a -- bash -c 'hostname; nproc; ls fixtures/ ; git rev-parse --show-toplevel'PASS.host=a,fedora-8gb-nbg1-2, nproc 4, fixtures listingvectors, toplevel/home/user/lanes/remoterun-selftest/edith_codecs.- Same with
--host b. PASS.host=b,fedora-8gb-nbg1-3, nproc 4,vectors, same toplevel. scripts/remote-run.sh remoterun-selftest -- cargo build -p ec-core(auto). PASS.host=a,Compiling ec-core v0.1.0,Finished dev profile, exit 0.scripts/remote-run.sh remoterun-selftest --host a -- bash -c 'exit 3'. PASS. Returned 3.scripts/remote-run.sh remoterun-selftest --clean. PASS. Remote lane dir, tgt and tmp removed on both hosts, local tgt/tmp removed.~/fixturesstill present on host a.
Not exercised: the busy-slot retry loop, the 10-minute timeout, the local fallback, and
--with-edith. The edith layout was checked by reading the path-dep rule, not by building.
Known limits
- Exit 75 is used for "slot busy", so a command that itself exits 75 is treated as busy and retried on the next host. Documented in the script header.
--with-edithwith the local fallback runs in$EDITH_TREE, which may not be this worktree.- Remote
fixturessymlink is made only inedith_codecs, not inedith.