Skip to content

Conversation

@ZoeLeibowitz
Copy link
Contributor

@ZoeLeibowitz ZoeLeibowitz commented Oct 27, 2025

While developing on the petsc branch, this PR adds docker-petsc.yml to build and push Dockerfile.petsc on pushes to the petsc branch. This PR also updates Dockerfile.petsc so that it uses devitocodes/devito:gcc-dev-amd64 as its base. Marked as a draft until PR #2778 is reviewed/merged.

@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.99%. Comparing base (501e1f9) to head (9171403).
⚠️ Report is 1 commits behind head on petsc.

Files with missing lines Patch % Lines
devito/petsc/config.py 57.14% 3 Missing ⚠️
devito/petsc/solver_parameters.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            petsc    #2779      +/-   ##
==========================================
- Coverage   76.00%   75.99%   -0.01%     
==========================================
  Files         273      273              
  Lines       54419    54425       +6     
  Branches     4602     4602              
==========================================
+ Hits        41360    41362       +2     
- Misses      12222    12226       +4     
  Partials      837      837              

☔ View full report in Codecov by Sentry.
📢 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.

try:
from petsctools import get_petscvariables, MissingPetscException
petsc_variables = get_petscvariables()
except ImportError:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JDBetteridge I moved the petsc imports from requirements.txt to requirements-petsc.txt as you advised. As a result, the petsc dependencies are no longer installed in Dockerfile.devito - which is preferred - but this leads to the following errors (this and this). I've addressed them by wrapping the imports in except ImportError blocks (see also petsc/solver_parameters.py below), in a similar way to how mpi4py is imported in distributed.py. Is this fine? What is best practice? Any suggestions for a longer term solution, particularly as requirements-petsc.txt grows?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, you will need to import guard petsctools. And wherever possible you should avoid importing anything PETSc specific if PETSc isn't present on the system. Long term we may want to revisit the module structure, but for now this is fine

@ZoeLeibowitz ZoeLeibowitz marked this pull request as ready for review January 8, 2026 12:29
@ZoeLeibowitz ZoeLeibowitz merged commit a91bdaf into petsc Jan 8, 2026
35 checks passed
@ZoeLeibowitz ZoeLeibowitz deleted the update_docker branch January 8, 2026 13:57
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.

3 participants