-
Notifications
You must be signed in to change notification settings - Fork 243
ci: Edit Dockerfile.petsc and add docker-petsc.yml #2779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ZoeLeibowitz
wants to merge
5
commits into
petsc
Choose a base branch
from
update_docker
base: petsc
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cd255de
ci: Edit Dockerfile.petsc, add docker-petsc.yml and clean up pytest-p…
ZoeLeibowitz 0f2f664
misc: Add try except except to petsctools import with get_petscvariables
ZoeLeibowitz 5a6ea1b
docker: Update dockerfile.cpu
ZoeLeibowitz 95d402d
docker/ci: Update petsc image and wf
ZoeLeibowitz 17cc296
workflows: Trigger docker-petsc wf
ZoeLeibowitz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Publish devito-petsc docker image | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - petsc # Push events on petsc branch | ||
| # TODO: drop this | ||
| pull_request: | ||
| branches: | ||
| - petsc | ||
|
|
||
| jobs: | ||
| build-and-push: | ||
| name: Build and push devito-petsc image | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| # Use buildkit | ||
| DOCKER_BUILDKIT: "1" | ||
|
|
||
| steps: | ||
| - name: Checkout devito | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to DockerHub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKER_USERNAME }} | ||
| password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
|
||
| - name: Build & push petsc image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: docker/Dockerfile.petsc | ||
| push: true | ||
| tags: | | ||
| devitocodes/devito-petsc:latest | ||
| build-args: base=devitocodes/devito:gcc-dev-amd64 | ||
| platforms: linux/amd64 | ||
|
|
||
| - name: Remove dangling layers | ||
| run: docker system prune -f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| petsctools<=2025.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,4 +8,3 @@ codepy>=2019.1,<2025 | |
| multidict<6.3 | ||
| anytree>=2.4.3,<=2.13.0 | ||
| packaging<25.1 | ||
| petsctools<=2025.1 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.txttorequirements-petsc.txtas you advised. As a result, the petsc dependencies are no longer installed inDockerfile.devito- which is preferred - but this leads to the following errors (this and this). I've addressed them by wrapping the imports inexcept ImportErrorblocks (see alsopetsc/solver_parameters.pybelow), in a similar way to howmpi4pyis imported indistributed.py. Is this fine? What is best practice? Any suggestions for a longer term solution, particularly asrequirements-petsc.txtgrows?There was a problem hiding this comment.
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