Skip to content
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 49 commits into from
May 27, 2024
Merged

GHA: Docker build refactor #6396

merged 49 commits into from
May 27, 2024

Conversation

danielhollas
Copy link
Collaborator

@danielhollas danielhollas commented May 16, 2024

This is an analogous refactor that I did over at aiidalab-docker-stack, please see that PR for details. aiidalab/aiidalab-docker-stack#439

tl;dr This should both increase speed and robustness of the build, main due to:

  1. Not uploading image as artifacts. (this does have a side-effect that the build can't happen from forks, maybe we can workaround that)
  2. Build multiplatform images together

@unkcpz
Copy link
Member

unkcpz commented May 23, 2024 via email

Copy link
Member

@unkcpz unkcpz left a comment

Choose a reason for hiding this comment

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

Thanks @danielhollas. Only a nitpick, all looks good. Let's try the test and publish CI after merge.

Comment on lines +40 to +45
- name: Set Up Python 🐍
if: ${{ startsWith(inputs.runsOn, 'ubuntu') }}
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
Copy link
Member

Choose a reason for hiding this comment

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

I assume this will fail for arm64? But anyway let's test it after merge.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It would fail, that's why this step is skipped :-)

.github/workflows/extract-docker-image-names.sh Outdated Show resolved Hide resolved
REGISTRY_USERNAME: ${{ secrets.DOCKER_USERNAME }}
REGISTRY_TOKEN: ${{ secrets.DOCKER_TOKEN }}
needs: [arm64-build]
runsOn: buildjet-4vcpu-ubuntu-2204-arm
Copy link
Member

@unkcpz unkcpz May 24, 2024

Choose a reason for hiding this comment

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

Hi @danielhollas, I just talk to the guy from warpBuild, and it has $8 per month for free, may try once by just change to warp-ubuntu-latest-arm64-2x? nerver mind, let's merge it first and we test it later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, I'll give it a go. I am just going out the office, so will do later today or tomorrow. (Or feel free to push to this branch if you can).

@danielhollas
Copy link
Collaborator Author

Hmm, after merging main the builld failed. Will have a look.

@danielhollas
Copy link
Collaborator Author

@unkcpz hmm, the warp arm64 runner doesn't seem to pick up the job. Do you need to somehow activate the trial period?

image

This reverts commit ed3621a.
This reverts commit 5d0c012.
@danielhollas
Copy link
Collaborator Author

@sphuber this is ready to merge.

@sphuber
Copy link
Contributor

sphuber commented May 26, 2024

The Docker Images / test-amd64 build is failing. Is this expected and of any concern?

@danielhollas
Copy link
Collaborator Author

@sphuber I restarted the test and it passed. It seems to be somewhat flaky, not sure why. I suspect sometimes the image download stalls for some reason (I blame GHA). We should keep an eye on how often it happens, and whether we need to investigate further.

@@ -2,7 +2,7 @@ name: continuous-integration-code

on:
push:
branches-ignore: [gh-pages]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intentional? Now the normal unit tests workflow will only run on merge to main right and no longer on push to branches?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The unit tests will still run on pull_request event.

I made this change for this PR in particular since I was opening the pull request from origin, and so the status checks were all duplicated. This is what happens for PRs from forks as well, essentially wasting CI compute imo.

So this change would only make a difference to you if you care about running tests on push before you open your PR. Given that you can always open a draft PR I feel like this use case is not as important, but I am happy to revert this in case you think differently.

Thanks for spotting this! I totally forgot I did this here. Sorry about that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that in most cases, having it run doubly is not ideal.

So this change would only make a difference to you if you care about running tests on push before you open your PR. Given that you can always open a draft PR

This is the critical point for me though. In many cases, I rely on running the CI on my fork. I don't really like the concept of draft PRs and so I rarely open them. If the work is not ready, there is rarely a reason to open a (draft) PR. The downside for me as a reviewer is that it adds a lot of noise. I look at the PR page often to see what needs to be done and when. Having a lot of open draft PRs where everytime I have to assess whether to consider or skip it, adds noise. So I don't really like the idea that users will be forced to open them just to get the CI to run.

I could be convinced otherwise, but I think this discussion shows that we probably shouldn't sneak the change into this PR, so for now please remove it and I will merge

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No problem, done.

@sphuber sphuber merged commit e47932e into main May 27, 2024
49 checks passed
@sphuber sphuber deleted the docker-refactor branch May 27, 2024 12:33
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.

None yet

3 participants