-
Notifications
You must be signed in to change notification settings - Fork 192
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
GHA: Docker build refactor #6396
Merged
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
02498d2
CI: WIP: Refactore docker build
danielhollas 7ab005a
Remove pre-commit from requirements
danielhollas 29768ad
Add docker-test
danielhollas b141d5b
Docker publish
danielhollas 967b637
Initial build workflow
danielhollas e64965a
remove action
danielhollas afe8448
Merge branch 'aiidateam:main' into docker-refactor
danielhollas fc00eb0
Updates from aiidalab stack
danielhollas 0bada85
Merge branch 'main' into docker-refactor
danielhollas 9c0c257
Fix test-amd64
danielhollas e16c127
One more fix
danielhollas f088c29
Don't run ci-code on push
danielhollas 9491a2e
workdir
danielhollas d470378
Fix test-install?
danielhollas 8a2941d
Build only amd64
danielhollas 6c4fe7b
Docker: Pintesting environment
danielhollas 6d71fc0
Build amd64 first
danielhollas ff0c49f
Add target option to pytest
danielhollas a9e6290
wtf
danielhollas d8b979c
Fix
danielhollas 8f4e7cb
Merge branch 'main' into docker-refactor
danielhollas 9f9b694
Full build needs test-amd64
danielhollas 4c906c0
Fix
danielhollas d9443f5
Fix docker-compose files
danielhollas 2fe8562
update uv
danielhollas eb69696
Fix test-install.yml test
danielhollas a06b549
Decrease timeout
danielhollas b7f8136
Fix comments in Dockerfile
danielhollas fad7c28
Temporarily enable arm64 testing
danielhollas 115b2f4
Update comments
danielhollas 13f69c2
Downgrade pytest
danielhollas cc4bd58
Fix ARM tests
danielhollas c420452
Revert "Temporarily enable arm64 testing"
danielhollas 608aff8
Increase timeout again
danielhollas ab2ebd1
Revert "Fix test-install.yml test"
danielhollas f5d125e
revert test-install fix
danielhollas 0130717
Don't run on forks for now
danielhollas 09931e9
Merge branch 'main' into docker-refactor
danielhollas 57f209d
Update .github/workflows/extract-docker-image-names.sh
danielhollas 2f92c27
Merge branch 'main' into docker-refactor
danielhollas 5d0c012
warp
danielhollas 49a0b09
Skip Docker build for PRs from forks
danielhollas ec12d50
Skip Docker build for PRs from forks
danielhollas ed3621a
Test arm on branch
danielhollas cb6f1fe
Revert "Test arm on branch"
danielhollas b53ff48
Revert "warp"
danielhollas c9c5cd6
Merge branch 'main' into docker-refactor
danielhollas f0a9a94
revert ci-code change
danielhollas bd9cc39
Consistent path-ignore in docker.yml
danielhollas 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 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 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 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 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 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 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[pytest] | ||
minversion = 7.0 | ||
addopts = -ra -q | ||
addopts = -ra -q --strict-markers | ||
testpaths = | ||
tests |
This file contains 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 |
---|---|---|
@@ -1,8 +1,4 @@ | ||
docker | ||
pre-commit | ||
pytest | ||
requests | ||
tabulate | ||
pytest-docker | ||
docker-compose | ||
pyyaml<=5.3.1 | ||
docker~=7.0.0 | ||
pytest~=8.2.0 | ||
requests~=2.32.0 | ||
pytest-docker~=3.1.0 |
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,77 @@ | ||
name: Build Docker images and upload them to ghcr.io | ||
|
||
env: | ||
BUILDKIT_PROGRESS: plain | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
runsOn: | ||
description: GitHub Actions Runner image | ||
required: true | ||
type: string | ||
platforms: | ||
description: Target platforms for the build (linux/amd64 and/or linux/arm64) | ||
required: true | ||
type: string | ||
outputs: | ||
images: | ||
description: Images identified by digests | ||
value: ${{ jobs.build.outputs.images }} | ||
|
||
jobs: | ||
build: | ||
name: ${{ inputs.platforms }} | ||
runs-on: ${{ inputs.runsOn }} | ||
timeout-minutes: 60 | ||
defaults: | ||
run: | ||
# Make sure we fail if any command in a piped command sequence fails | ||
shell: bash -e -o pipefail {0} | ||
|
||
outputs: | ||
images: ${{ steps.bake_metadata.outputs.images }} | ||
|
||
steps: | ||
|
||
- name: Checkout Repo ⚡️ | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
if: ${{ inputs.platforms != 'linux/amd64' }} | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry 🔑 | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and upload to ghcr.io 📤 | ||
id: build | ||
uses: docker/bake-action@v4 | ||
with: | ||
push: true | ||
workdir: .docker/ | ||
# Using provenance to disable default attestation so it will build only desired images: | ||
# https://github.com/orgs/community/discussions/45969 | ||
provenance: false | ||
set: | | ||
*.platform=${{ inputs.platforms }} | ||
*.output=type=registry,push-by-digest=true,name-canonical=true | ||
*.cache-to=type=gha,scope=${{ github.workflow }},mode=max | ||
*.cache-from=type=gha,scope=${{ github.workflow }} | ||
files: | | ||
docker-bake.hcl | ||
build.json | ||
|
||
- name: Set output variables | ||
id: bake_metadata | ||
run: | | ||
.github/workflows/extract-docker-image-names.sh | tee -a "${GITHUB_OUTPUT}" | ||
env: | ||
BAKE_METADATA: ${{ steps.build.outputs.metadata }} |
Oops, something went wrong.
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.
It would be better to use
--target
here to be consistent withaiidalab-docker-stack
but I'll do that in a separate PR.