Skip to content

Generate + serve compact summary.json alongside manifest.json (small artifact for path-only views) #558

Closed

Description

@neuromechanist

Motivation

The publicly-served data.nemar.org/<id>/<version>/manifest.json is 10+ MB for typical BIDS-EEG datasets because the worker injects a presigned S3 URL into every file entry on each request (~500-800 bytes × 14k files). The website needs only paths + readme pointer + totals to render the detail page, but pays the full bandwidth + worker CPU cost every time.

Companion website issue: nemarOrg/website#29 (consumer side, fallback-safe).

Proposal

Emit a compact summary at manifest creation time, store as a separate S3 object, serve via a new lightweight route.

Artifact

s3://nemar/<id>/version/v<X.Y.Z>-summary.json   (typically 50-200 KB regardless of dataset size)
{
  "schema_version": "1.0",
  "dataset_id": "on005261",
  "version": "1.0.0",
  "doi": "10.82901/nemar.on005261.v1.0.0",
  "concept_doi": "10.82901/nemar.on005261",
  "created": "2026-05-18T...Z",
  "totals": { "files": 14536, "bytes": 241618664825, "subjects": 17 },
  "modalities": ["meg", "beh"],
  "subjects": ["sub-01", "sub-02", ...],
  "readme": { "path": "README.md" } | null,
  "paths": ["README.md", "dataset_description.json", "sub-01/meg/...", ...]
}

Critically:

  • No presigned URLs — the summary is path-only. Downloads use the existing data.nemar.org file routes that already sign on demand.
  • No per-entry checksum/size — totals only. Sufficient for the page's needs.

Implementation tasks

  1. Generation: extend the manifest builder (/tmp/manifest_recover.py is the prototype used today for the 5 stuck-datasets recovery; this logic moves into the central publish workflow per Centralize manifest+archive generation: workflow_dispatch on one central repo (zero YAML in dataset repos) #557) to also emit summary alongside manifest. Same aws s3 cp plumbing.

  2. Serving: add GET /<id>/<version>/summary.json route in backend/src/routes/data.ts. Reads s3://nemar/<id>/version/v<X.Y.Z>-summary.json and serves with Cache-Control: public, max-age=300, s-maxage=86400, stale-while-revalidate=86400. Static-passthrough cacheable since there are no per-request fields.

  3. Backfill: one-shot script invocation against the 5 recently-recovered datasets (nm000103, nm000106, nm000166, on004362, on005261) so the website's fast path activates for them immediately.

Dependencies

Acceptance

  • Every new publish writes both v<X.Y.Z>.json and v<X.Y.Z>-summary.json to S3
  • data.nemar.org/<id>/<version>/summary.json returns 200 with the documented shape
  • Backfill run for the 5 recovered datasets succeeds; their summary.json files exist and are < 500 KB each
  • Existing manifest.json route unchanged (tooling that wants per-file presigned URLs keeps working)
  • No new infrastructure (no daemon, no queue, no external host)

Activity

  1. added
    P2
    feature
    on May 19, 2026
  2. neuromechanist commented on May 19, 2026

    @neuromechanist
    ContributorAuthor

    Implementation landed in #563 (commit 8b2510d on dev).

    Done:

    Remaining (post-secrets-setup, ops task):

    • Run bash scripts/backfill-summaries.sh after secrets are configured on nemarOrg/nemar-cli, to emit summary.json for nm000103/nm000106/nm000166/on004362/on005261

    Keep open until the backfill ops step runs and the 5 summaries are verified at https://data.nemar.org/<id>/<version>/summary.json.

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

    P2feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions