fix(hpc/sync): create remote project dir before parallel push rsyncs - #29
Merged
Merged
Conversation
On the first push to a new remote project, push() launched the CODE_DIRS
rsyncs in parallel before anything had created ${HPC_BASE}/${PROJECT_NAME}.
rsync only creates the final path level, so all of them died with
"mkdir failed: No such file or directory". The later [root files] rsync
then created the base dir, so dataset/ synced and push exited 0 — the
failure stayed silent until sbatch could not find hpc/batch_gpu.
Reported against autolens_assistant (job 330464 postmortem, 2026-07-16);
this repo carries the same push() and the same defect.
Two changes:
- ssh mkdir -p the remote project dir before the parallel rsyncs, matching
what pull/pull_logs/push_data_init already do. Skipped under --dry-run so
`status` stays side-effect free.
- Collect the background PIDs and wait on each one. Plain `wait` returns its
own status, so a failed backgrounded rsync was swallowed even under
`set -e`. push() now names the failing directory and returns 1, so
push-submit aborts instead of submitting against an incomplete tree.
Verified against a local fake-HPC harness (real rsync, stubbed ssh):
first push previously exited 0 without hpc/batch_gpu and now transfers the
full tree; an injected transfer failure now exits 1 and stops push-submit
before sbatch; re-push, --no-data and status are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
On the first push to a new remote project,
push()launched theCODE_DIRSrsyncs in parallel before anything had created${HPC_BASE}/${PROJECT_NAME}. rsync only creates the final path level, so every one of them died withmkdir failed: No such file or directory.The later
[root files]rsync then created the base dir as a side effect, sodataset/synced fine and the whole command exited 0. The failure stayed silent untilsbatchcould not findhpc/batch_gpu.Originally reported against
autolens_assistant(job 330464 postmortem, 2026-07-16). This repo'shpc/syncis byte-identical to the file the bug was reported against (blob1560e64), so it carries the same defect.Reproduced against this repo's unmodified script with a local fake-HPC harness (real rsync, stubbed ssh): first push exits 0 with
hpc/batch_gpumissing.The fix
Both changes are confined to
push().ssh mkdir -pthe remote project dir before the parallel rsyncs, matching whatpull,pull_logsandpush_data_initalready do. Skipped under--dry-runsostatusstays side-effect free.waitreturns its own status, so a failed backgrounded rsync was swallowed even underset -euo pipefail. The background PIDs are now collected and waited on individually;push()names the failing directory and returns 1, sopush-submitaborts instead of submitting against an incomplete tree.Verification
hpc/batch_gpumissingpush-submitwith a failuresbatchsbatch--no-datastatus(dry-run)statusexiting 1 is pre-existing on both fresh and existing remotes; the baseline was checked and is unchanged by this diff. The file mode (100755) is preserved.Related
Matching PRs:
autolens_assistant(the original report) andautogalaxy_assistant.autocti_assistanthas nohpc/syncand is unaffected.Generated by Claude Code