-
Notifications
You must be signed in to change notification settings - Fork 6
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
ci(docker): build each platform in a different worker #32
Conversation
ee20006
to
cbb273a
Compare
84ea843
to
79968d1
Compare
3b95574
to
e819776
Compare
8bf18ca
to
f359b44
Compare
|
d265dab
to
d66da47
Compare
4c1cb64
to
2c2eeac
Compare
This is R4R, having split out the misc cleanups I made into another PR, #39. |
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.
I think the failure notification got dropped, probably mistakenly?
Can we add a manual workflow trigger, and test it through that to make sure generating and publishing all platform images works as expected? (I expect that we'll need to add the manual workflow trigger to the main
branch first)
Edit: sorry for the delayed review. For some reason I'm not getting notifications for PR reviews in this repo
DEFAULT_PLATFORM=linux/amd64 | ||
echo "default=$DEFAULT_PLATFORM" >> $GITHUB_OUTPUT | ||
if ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}; then | ||
platforms='["'"$DEFAULT_PLATFORM"'"]' |
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 took me a minute to parse the quoting here.
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.
Added a comment.
.github/workflows/ci.yml
Outdated
- name: Set up QEMU for cross-platform builds | ||
uses: docker/setup-qemu-action@v3 | ||
if: ${{ matrix.platform != env.DEFAULT_PLATFORM }} |
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.
QEMU is still needed when running arm on macos-latest-xlarge
?
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.
I made the setup-qemu unconditional so that we can easily modify the runner configuration without needing to change things in multiple places.
.github/workflows/ci.yml
Outdated
sep= | ||
SUFFIXED= | ||
uarch=$(echo "${{ matrix.platform }}" | tr / _) | ||
for TAG in ${{ steps.meta.outputs.tags }}; do | ||
SUFFIXED="$SUFFIXED$sep$TAG-$uarch" | ||
if test -z "$sep"; then | ||
sep=, | ||
echo "tag=$TAG-$uarch" >> $GITHUB_OUTPUT | ||
fi | ||
done | ||
echo "tags=$SUFFIXED" >> $GITHUB_OUTPUT |
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.
This is pretty opaque too.
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write |
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.
Why is the explicit permission required here?
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.
The permissions are a restriction, not a grant.
.github/workflows/ci.yml
Outdated
- name: notify on failure | ||
if: failure() && github.event_name != 'pull_request' | ||
uses: ./.github/actions/notify-status |
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.
This seems to be completely gone, any reason to remove master failure notifications ?
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.
The notification will fail due to missing GitHub secrets, but I'll leave it here just so we can correct the secrets to make it work again.
2c2eeac
to
453fd99
Compare
.github/workflows/ci.yml
Outdated
# but it's re-building the last stage. This is deemed good enough for now. | ||
# see https://github.com/moby/moby/issues/34715 | ||
- name: Build and push complete image | ||
- name: Compute tags |
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.
Nit, can we move "compute tags" earlier in the job / before the build step so we can easily check the tags before the job completes?
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.
Done.
96c5f3e
to
f1a9c5f
Compare
82fb01b
to
cf9dfcb
Compare
https://github.com/Agoric/agoric-3-proposals/actions shows both the manual and PR triggers working correctly. |
strategy: | ||
matrix: | ||
platform: ${{ fromJSON(needs.platforms.outputs.platforms) }} | ||
# Run on our own self-hosted ARM64 machine if the platform is ARMish. |
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.
where is operation of this machine documented?
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.
Seeing the manual run results, I'm confident this does what it claims it does!
This is an optimisation to reduce the amount of disk space and build time needed on each worker. It currently uses a
self-hosted
runner for creating ARM images, falling back to standardubuntu-latest
GitHub runners.