Skip to content

Streaming archive generation for large datasets #138

Closed

Description

@neuromechanist

Problem

The current generate-archive GitHub Actions workflow downloads all dataset files to the runner's local disk (git annex get .), zips them, then uploads the zip to S3. This fails for large datasets (50-100+ GB) because GitHub Actions runners have ~14 GB free disk.

Solution

Replace the download-zip-upload approach with streaming archive generation: read each file directly from S3, feed it through a zip encoder, and stream the zip output directly to S3 via multipart upload. Memory and disk usage stay constant regardless of dataset size.

Approach

Use a Node.js script in the GitHub Actions workflow that:

  1. Checks out the repo at the version tag (metadata only, no git-annex get)
  2. Lists all files in the tree, resolves git-annex keys to S3 URLs
  3. Streams each file from S3 through a zip encoder (archiver library)
  4. Pipes zip chunks to S3 multipart upload (@aws-sdk/client-s3 + Upload)
  5. Result: s3://nemar/{dataset_id}/archives/v{version}.zip

Why this works for free

Published datasets are public repos. GitHub Actions minutes are free and unlimited for public repositories on the Team plan.

Files to modify

  • backend/src/services/github.ts - Update generate-archive workflow template
  • New: inline Node.js script in the workflow (or a script file committed to the .github org repo)

Acceptance criteria

  • Archive generation works for datasets larger than 14 GB
  • No local disk usage beyond the repo checkout (metadata/symlinks only)
  • Zip is streamed directly to S3
  • Existing trigger mechanism (repository_dispatch) unchanged

Activity

  1. added
    enhancement
    on Feb 13, 2026
  2. neuromechanist commented on Feb 24, 2026

    @neuromechanist
    ContributorAuthor

    Streaming archive generation is implemented and working. The remaining issue (S3 10,000 part limit for very large datasets like nm000103) is tracked in #180.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions