Skip to content

Download PETSc from Zenodo, with the DataverseNL mirror as the fallback - #965

Merged
timlichtenberg merged 9 commits into
mainfrom
tl/petsc-zenodo
Oct 8, 2026
Merged

timlichtenberg merged 9 commits into
mainfrom
tl/petsc-zenodo

Conversation

@timlichtenberg

Copy link
Copy Markdown
Member

Description

tools/get_petsc.sh downloads the PETSc 3.19.0 source archive from Zenodo (record 15805756) instead of OSF, checks its SHA-256, and falls back to the DataverseNL copy of the same archive (doi:10.34894/BZDJPU) when Zenodo does not serve it. When neither source serves the pinned file, the script stops and names both. Closes #856.

  • The URL, the mirror and the SHA-256 live in pyproject.toml under [tool.proteus.modules.petsc] and are read through tools/_module_pins.py. PETSC_URL and PETSC_MIRROR_URL override the two sources.
  • The pins are read before the previous installation is removed; an unreadable pin (no Python 3.11 or newer on PATH) stops the script with that cause and leaves the old build in place.
  • fetch_verified in tools/_get_common.sh tries each source in order with connect and stall timeouts and accepts a file only when its SHA-256 matches. A failed download reaches the troubleshooting text, which names the pins and the overrides.
  • The module-pins guide has a PETSc case: the three values change together, and SPIDER's copy of the script changes in the same window. The same change for SPIDER is Download PETSc from Zenodo, with the DataverseNL mirror as the fallback SPIDER#20.

Validation of changes

tests/tools/test_install_scripts.py passes (111). The tests run the download block with stub tools and check the order of the sources, both overrides, an empty pin, an unreadable pin and the troubleshooting text; accepting a file with any checksum makes 5 of them fail. With the real pins, the Zenodo download has the pinned SHA-256, and with PETSC_URL pointed at a missing file the archive comes from DataverseNL with the same SHA-256 (11,618 files).

Tested on macOS (Apple Silicon) with Python 3.12.

Checklist

  • I have followed the contributing guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors
  • I have checked that the tests still pass on my computer
  • I have updated the docs, as appropriate
  • I have added tests for these changes, as appropriate
  • I have checked that all dependencies have been updated, as required

get_petsc.sh fetches the PETSc 3.19.0 source archive from Zenodo 15805756 instead of OSF, falls back to the DataverseNL mirror when Zenodo fails, and accepts only a file with the pinned SHA-256. The sources and the hash are pinned in pyproject.toml [tool.proteus.modules.petsc]; the mirror field stays empty until the mirror is published, and PETSC_URL and PETSC_MIRROR_URL override the sources. The download helper fetch_verified lives in tools/_get_common.sh.
The PETSc archive is mirrored as DataverseNL 10.34894/BZDJPU (one file, petsc.zip, same bytes as Zenodo 15805756), so get_petsc.sh falls back to that file when the Zenodo download fails or its SHA-256 does not match.
fetch_verified returns 1 instead of exiting, so the ERR trap of get_petsc.sh prints its troubleshooting text, including the PETSC_URL and PETSC_MIRROR_URL overrides. An empty SHA-256 pin stops before any download, and curl gives up on a connection or a stalled transfer so the next source is tried. The tests pin the Zenodo-then-mirror order, the overrides and the skip of an empty source; the optional-modules page describes the Zenodo download.
get_petsc.sh reads url, mirror and sha256 before it removes the previous installation and stops with the cause when one cannot be read, which needs python 3.11 or newer. The pin page gains a PETSc case (the three values change together, SPIDER holds its own copy, and the mirror can be checked alone with PETSC_URL broken). The test file is formatted with ruff 0.15.18 and its step strings name the current download.
@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.65%. Comparing base (bb96451) to head (5ab3ecc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #965      +/-   ##
==========================================
- Coverage   93.97%   93.65%   -0.33%     
==========================================
  Files         128      128              
  Lines       20891    20891              
  Branches     3515     3666     +151     
==========================================
- Hits        19633    19566      -67     
- Misses        908      914       +6     
- Partials      350      411      +61     
Flag Coverage Δ
nightly 93.62% <ø> (+0.08%) ⬆️
unit-tests 92.27% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

fetch_verified stops before any download, naming shasum and sha256sum, when neither is installed, instead of failing inside the hash step; the test covers it next to the blank-pin case.
@timlichtenberg
timlichtenberg merged commit ed24232 into main Oct 8, 2026
41 checks passed
@timlichtenberg
timlichtenberg deleted the tl/petsc-zenodo branch October 8, 2026 05:09
timlichtenberg added a commit to FormingWorlds/SPIDER that referenced this pull request Oct 8, 2026
…ck (#20)

tools/get_petsc.sh downloads the PETSc 3.19.0 source archive from Zenodo (record 15805756) instead of OSF, checks its SHA-256, and falls back to the DataverseNL copy of the same archive (doi:10.34894/BZDJPU) when Zenodo does not serve it. When neither source serves the pinned file, or the pin is empty, the script stops and names the cause. PETSC_URL and PETSC_MIRROR_URL override the two sources, and curl has connect and stall timeouts.

The URL, the mirror and the hash are the same as in PROTEUS (FormingWorlds/PROTEUS#965); the two copies change together.
IKisvardai added a commit that referenced this pull request Oct 9, 2026
Brings in the prescribed orbital migration (#937), the CALLIOPE cold-start
seed (#958), the fwl-io dataset fetch and stellar spectra changes (#960,
#964, #967, #968), the PETSc download (#965), Zalmoxis Anderson acceleration
with fwl-aragog 26.10.08 (#971) and the CI changes (#955, #970). The schema
invariant tests keep both the trapping and the migration validators, and the
golden trajectory is main's re-recorded one with the trapping columns added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PETSc is still pulled from OSF, but we now use Zenodo+Dataverse

1 participant