Skip to content

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

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

timlichtenberg merged 5 commits into
mainfrom
tl/petsc-zenodo

Conversation

@timlichtenberg

@timlichtenberg timlichtenberg commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

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, where the same change is FormingWorlds/PROTEUS#965; the two copies change together.

Testing: tests/test_get_petsc.py and tests/test_get_petsc_ldflags.py pass (7). With PETSC_URL pointed at a missing file, the archive comes from DataverseNL with the pinned SHA-256. Tested on macOS (Apple Silicon).

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 mirror URL stays empty until the mirror is published; PETSC_URL and PETSC_MIRROR_URL override the sources.
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 stops before any download when the SHA-256 pin is empty, and curl gives up on a connection or a stalled transfer so the next source is tried.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Checksum-tool availability and the per-test edge-case requirement remain unresolved.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Updates PETSc installation to use verified Zenodo and DataverseNL downloads.

Changes:

  • Adds SHA-256 verification and mirror fallback.
  • Adds offline download-path tests.
  • Updates installer documentation.
File Description
tools/​get_petsc.sh Implements verified downloads and fallback.
tests/​test_get_petsc.py Tests download and integrity behavior.
.github/​copilot-instructions.md Documents the new sources.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/get_petsc.sh
Comment thread tests/test_get_petsc.py Outdated
fetch_verified stops before any download, naming shasum and sha256sum, when neither is installed, instead of failing inside the hash step. The pin assertions are part of the test that stops on a blank pin or a missing hash tool.
timlichtenberg added a commit to FormingWorlds/PROTEUS that referenced this pull request Oct 8, 2026
…ck (#965)

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]; PETSC_URL and PETSC_MIRROR_URL override the two sources. The pins are read before the previous installation is removed, so an unreadable pin leaves the old build in place. SPIDER's copy of the script changes in the same window (FormingWorlds/SPIDER#20).
@timlichtenberg
timlichtenberg merged commit 09d7c3a into main Oct 8, 2026
5 checks passed
@timlichtenberg
timlichtenberg deleted the tl/petsc-zenodo branch October 8, 2026 05:09
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.

2 participants