Skip to content

Conversation

@crazy-max
Copy link
Member

@crazy-max crazy-max commented Nov 14, 2025

needs #20
relates to #2

Allows to distribute builds across multiple runners per platform to speed up builds and avoid storage space issues like docker/buildx#3520 (comment)

Comment on lines +383 to +384
pattern: ${{ needs.bake-local.outputs.artifact-name }}*
merge-multiple: true
Copy link
Member Author

Choose a reason for hiding this comment

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

Now artifacts are pushed per platform so we need to merge them:

image

break;
case 'local':
outputOverride = `*.output=type=local,dest=${inpLocalExportDir}`;
outputOverride = `*.output=type=local,platform-split=true,dest=${inpLocalExportDir}`;
Copy link
Member Author

@crazy-max crazy-max Nov 14, 2025

Choose a reason for hiding this comment

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

Need to opt-in platform-split=true for local artifacts to make output consistent and avoid merge conflicts with @actions/download-artifact.

Comment on lines +267 to +289
# needs predefined outputs as we can't use dynamic ones atm: https://github.com/actions/runner/pull/2477
# 20 is the maximum number of platforms supported by our matrix strategy
result_0: ${{ steps.result.outputs.result_0 }}
result_1: ${{ steps.result.outputs.result_1 }}
result_2: ${{ steps.result.outputs.result_2 }}
result_3: ${{ steps.result.outputs.result_3 }}
result_4: ${{ steps.result.outputs.result_4 }}
result_5: ${{ steps.result.outputs.result_5 }}
result_6: ${{ steps.result.outputs.result_6 }}
result_7: ${{ steps.result.outputs.result_7 }}
result_8: ${{ steps.result.outputs.result_8 }}
result_9: ${{ steps.result.outputs.result_9 }}
result_10: ${{ steps.result.outputs.result_10 }}
result_11: ${{ steps.result.outputs.result_11 }}
result_12: ${{ steps.result.outputs.result_12 }}
result_13: ${{ steps.result.outputs.result_13 }}
result_14: ${{ steps.result.outputs.result_14 }}
result_15: ${{ steps.result.outputs.result_15 }}
result_16: ${{ steps.result.outputs.result_16 }}
result_17: ${{ steps.result.outputs.result_17 }}
result_18: ${{ steps.result.outputs.result_18 }}
result_19: ${{ steps.result.outputs.result_19 }}
Copy link
Member Author

@crazy-max crazy-max Nov 14, 2025

Choose a reason for hiding this comment

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

Maximum of 20 jobs to align with max jobs concurrency for GitHub hosted runners https://docs.github.com/en/actions/reference/limits#job-concurrency-limits-for-github-hosted-runners

I don't think people will build more than 20 platforms anyway 😅

Comment on lines 238 to 249
platforms.forEach((platform, index) => {
let runner = inpRunner;
if (runner === 'auto') {
runner = platform.startsWith('linux/arm') ? 'ubuntu-24.04-arm' : 'ubuntu-latest';
}
includes.push({
index: index,
platform: platform,
runner: runner
});
});
Copy link
Member Author

Choose a reason for hiding this comment

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

Will choose best-matching runner to use based on target platform to build. cc @dvdksn

on:
workflow_call:
inputs:
runner:
Copy link

Choose a reason for hiding this comment

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

wdyt about reusing the same input name?

Suggested change
runner:
runs-on:

Copy link
Member Author

Choose a reason for hiding this comment

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

Was thinking of reusing the same but here we have some logic if set to auto to choose best matching one. Maybe we could default to empty instead of auto, I'm taking a look.

Copy link
Member Author

@crazy-max crazy-max Nov 14, 2025

Choose a reason for hiding this comment

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

Changes to runs-on and now defaults to empty instead of auto.

@crazy-max crazy-max force-pushed the bake-distrib branch 2 times, most recently from 6d79c77 to 0f73820 Compare November 14, 2025 14:32
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max requested a review from tonistiigi November 14, 2025 16:11
@crazy-max crazy-max marked this pull request as ready for review November 14, 2025 16:11
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max merged commit 6a09854 into main Nov 15, 2025
28 checks passed
@crazy-max crazy-max deleted the bake-distrib branch November 15, 2025 10:28
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.

3 participants