Skip to content

ci: add nightly job to sync source mirror with pkgs in builtin - #6069

Merged
tgamblin merged 3 commits into
spack:developfrom
alecbcs:ci/add-scheduled-mirror-update
Aug 26, 2026
Merged

ci: add nightly job to sync source mirror with pkgs in builtin#6069
tgamblin merged 3 commits into
spack:developfrom
alecbcs:ci/add-scheduled-mirror-update

Conversation

@alecbcs

@alecbcs alecbcs commented Aug 12, 2026

Copy link
Copy Markdown
Member

Add a minimal nightly GitHub Actions CI/CD job that compares the state of the package repository to the mirrored source cache and mirrors any artifacts that are missing from the cache. (As of the time of posting there are 439 missing package versions that would be uploaded by this workflow.)

Signed-off-by: Alec Scott <alec@llnl.gov>
@alecbcs
alecbcs requested a review from scheibelp August 12, 2026 22:22
@spackbot-triage spackbot-triage Bot added the ci Related to CI/CD workflows and pipelines label Aug 12, 2026

@scheibelp scheibelp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other points (not requests for this PR):

  • (request for later) If a patch/resource is dropped, this doesn't catch that: if we already placed the "main" version tarball in a mirror, and a resource was missed, then this job will also miss that (I see though that patches/resources generally are included, just not in this rare case). I think this can be addressed later.
  • (not a request) What about wrong checksums (i.e. if someone specifies the wrong checksum for a version)? I think the behavior would be OK: this script will collect every wrong checksum, download the version (which should fail, but spack mirror generally proceeds on in this case). We'd want to clean those up though.

Comment thread .github/workflows/bin/find-missing-mirror-specs.py
Signed-off-by: Alec Scott <alec@llnl.gov>
Signed-off-by: Alec Scott <alec@llnl.gov>
@alecbcs
alecbcs requested a review from scheibelp August 26, 2026 16:13
@tgamblin
tgamblin self-requested a review August 26, 2026 16:54
@tgamblin

Copy link
Copy Markdown
Member

@scheibelp are your review comments addressed?

@tgamblin
tgamblin merged commit 96e4f3a into spack:develop Aug 26, 2026
33 checks passed
tgamblin added a commit that referenced this pull request Aug 26, 2026
tgamblin added a commit that referenced this pull request Aug 27, 2026
Re-adds the nightly source mirror sync from #6069 (reverted in #6245).

Nothing about mirroring sources requires concretization: URLs and
sha256 checksums for version tarballs, resources, and patches are all
known statically from `package.py` files. The
`find-missing-mirror-artifacts.py` script here:

1. lists every sha256-addressed artifact in the builtin repo:
   - version tarballs
   - resources
   - URL patches (in packages and from dependencies)

   while skipping manual-download and non-redistributable packages;

2. compares digests against a listing of the mirror's content-addressed
   `_source-cache/archive/` prefix; and

3. emits one TSV line per missing artifact with its:
   - `sha256`
   - exact mirror path, computed with Spack's `default_mirror_layout()`
   - its candidate URLs in order of preference.

A GitHub Actions workflow then downloads each artifact with curl,
verifies the sha256, and uploads artifacts to S3 one at a time.
disk usage is bounded and individual fetch failures only skip that
artifact until the next nightly run.

Co-authored-by: Alec Scott <alec@llnl.gov>
Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>

* sync-src-mirror: fetch with spack instead of curl

Merge the download/verify/upload loop into the finder script and fetch
with spack's own fetch strategies via Stage.fetch()/check(). This
honors per-package fetch_options, reuses spack's checksum and redirect
handling, and drops the TSV/bash handoff. Uploads still go through
`aws s3 cp`, one artifact at a time, so disk stays bounded.

Without --upload-to, the script just lists missing artifacts, which
makes it easy to run locally.

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>

---------

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
Co-authored-by: Alec Scott <alec@llnl.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Related to CI/CD workflows and pipelines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants