Repository navigation
Phase 1: Server-side, resumable, sharded import transfer - #757
Merged
neuromechanist merged 2 commits intoJun 16, 2026
Merged
neuromechanist merged 2 commits into
neuromechanist merged 2 commits into
Conversation
Replace the curl|aws-s3-cp client-stream (every byte through the runner, blew the 6h cap on 9TB ds004395) with server-side s3://openneuro.org -> s3://nemar copies, plus resume (skip already-present objects) and key-sharding across matrix jobs. - new src/lib/s3-server-copy.ts: parseS3Url, serverSideS3Copy (+curl fallback), batchServerSideCopy (bounded retry), listExistingObjects, filterAlreadyCopied (resume), keyInShard, S3 manifest staging. - import-openneuro.ts: split importOpenNeuro into prepareImport / copyShard / finalizeImport (state via S3 staging across jobs; uuid reused on the finalize re-clone); single-process driver unchanged. - admin.ts: --phase prepare|copy|finalize and --shard i/N. - onboard-openneuro.yml: prepare -> copy(matrix shard, 350m, max-parallel) -> finalize, per-dataset isolation via !cancelled() + finalize re-list verification. - tests: pure unit (parse/shard/resume) + real cross-region copy integration (self-skips without AWS creds) + workflow structure. Part of #749. Closes #750.
- curlStreamCopy: set -o pipefail so a curl failure can't upload a 0-byte object and exit 0 (false success). - listExistingObjects: guard against a truncated page (auto-pagination disabled) -> throw instead of a silent partial destination view. - finalize: assert finalize uuid == manifest.nemarUuid; make git-annex key-registration failures fatal (was non-fatal -> uncloneable blobs). - getJson: descriptive error on corrupt/truncated staging JSON. - cleanupStaging: warn on non-zero exit instead of swallowing. - workflow: derive the copy shard list from env.SHARDS in parse-ids (single source of truth; removes SHARDS/matrix drift). - tests: batchServerSideCopy real copied+failed[] paths, partial expectedSizes skip, workflow needs-graph wiring. Addresses code-review + silent-failure + test-coverage findings on #757.
Contributor
Author
/review-pr (3 Sonnet subagents: code-review, silent-failure-hunter, pr-test-analyzer)All findings addressed in c51bfc6.
Tests added: No findings skipped. |
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR757Version: 🤖 Updated on each push. |
neuromechanist
merged commit Jun 16, 2026
afb8b33
into
feature/issue-749-epic-import-robustness
1 check passed
This was referenced Jun 16, 2026
This branch was previously deployed
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.
Summary
Replaces the OpenNeuro->NEMAR data-transfer mechanics so large imports complete unattended:
aws s3 cp s3://openneuro.org/... s3://nemar/..., cross-account + cross-region) so bytes never transit the GitHub runner. Verified end-to-end (real cross-region copy, ETag match). This killed the 9 TB ds004395 import at the 6h runner cap.Changes
src/lib/s3-server-copy.ts(new):parseS3Url,serverSideS3Copy(+ curl fallback),batchServerSideCopy(bounded retry, no mid-stream exit),listExistingObjects,filterAlreadyCopied,parseShardArg/keyInShard, S3 manifest staging.src/lib/import-openneuro.ts: splitimportOpenNeurointoprepareImport/copyShard/finalizeImport+ a thin single-process driver (unchanged--local). State passes via S3 staging; the nemar-s3 UUID is reused on the finalize re-clone (configureS3Remote init->enable).src/commands/admin.ts:--phase prepare|copy|finalizeand--shard i/N..github/dataset-workflows/onboard-openneuro.yml:prepare -> copy (matrix shard, 350m, max-parallel 20) -> finalize; per-dataset isolation viaif: !cancelled()+ finalize re-list verification.Test plan
test/s3-server-copy.test.ts, 18): URL parsing, shard partition, resume filter.test/import-openneuro-s3-copy.integration.test.ts): actual cross-region server-side copy intoxx000001sandbox + resume-skip + cleanup. Self-skips without AWS env creds; verified passing against live S3 locally.test/onboard-workflow.test.ts).tsc+biomeclean;import-openneuro.test.ts38/38.Notes
TEST_API_URL), so it isn't auto-routed by the tiering grep; wiring it into integration-dev withAWS_*env is a small follow-up (self-skips safely meanwhile).nemarDatasets/.githubcopy at rollout.Closes #750
Part of epic #749