ci: Edit Dockerfile.petsc and add docker-petsc.yml#2779
Conversation
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
| try: | ||
| from petsctools import get_petscvariables, MissingPetscException | ||
| petsc_variables = get_petscvariables() | ||
| except ImportError: |
There was a problem hiding this comment.
@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?
There was a problem hiding this comment.
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
17cc296 to
b23bfbb
Compare
540936d to
9171403
Compare
While developing on the
petscbranch, this PR addsdocker-petsc.ymlto build and pushDockerfile.petscon pushes to thepetscbranch. This PR also updatesDockerfile.petscso that it usesdevitocodes/devito:gcc-dev-amd64as its base. Marked as a draft until PR #2778 is reviewed/merged.