Skip to content

ci(android): build on hosted runners - #396

Open
juliusknorr wants to merge 2 commits into
mainfrom
ci/android-build-timeout
Open

juliusknorr wants to merge 2 commits into
mainfrom
ci/android-build-timeout

Conversation

@juliusknorr

@juliusknorr juliusknorr commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Android legs built in 8-10 min but waited 1-4 h for one of the five organisation runners. The build no longer needs them: third-party builds come from the remote cache, ccache from the Actions cache.

  • Build on ubuntu-latest; a private copy keeps self-hosted (same expression as ci: let a private copy of this repository run safely #408)
  • Free disk space before the build
  • Stop a hung build after 3 h instead of the 6 h default. The slowest legitimate runs (third-party rebuilds) took up to 2 h on the organisation runners; past hangs sat in the export for 5+ h
  • No retry: main already avoids the stalled export with docker cp

Tests: actionlint; this PR's own run is the trial on hosted runners. Not measured yet: a full third-party rebuild (manual run) on hosted runners.

@juliusknorr juliusknorr added build Build process related changes build-performance CI and build time mobile iOS, iPadOS and Android no-tests-needed labels Nov 19, 2026
@juliusknorr
juliusknorr marked this pull request as ready for review November 19, 2026 08:38
@juliusknorr
juliusknorr requested a review from a team as a code owner November 19, 2026 08:38
@juliusknorr
juliusknorr requested review from DmySyz and chrip and removed request for a team November 19, 2026 08:38

@chrip chrip left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Request changes. The limits fit everyday builds, but they would kill the runs that rebuild the third-party libraries, and the manual run that fills the remote cache is one of them.

The timeout and the retry work as described. The retry only runs when timeout exits with 124, so a real compile error still fails the job right away. I compared the limits with the Android jobs of the last two days, and everyday builds fit, though with little room: this PR's own arm64 run spent 54.6 minutes in the bake step, 5 minutes under the new 60-minute limit.

issue (blocking): Builds that compile the third-party libraries take longer than 90 minutes.
.github/workflows/build-android.yml:28 and :106. The last manual run (2026-11-05) is the only kind of run that uploads missing third-party builds, and it spent 119 minutes in the bake step on both legs. The run for #296 on 2026-11-19 passed after 152 minutes (arm64) and 86 minutes (x86_64), and V8 alone took 132 and 74 of those minutes. With this change, the manual run can no longer fill the cache after the next V8 or toolchain bump, so every Android check would time out, and main requires those checks. Please give workflow_dispatch runs a much higher limit, for example timeout-minutes: ${{ github.event_name == 'workflow_dispatch' && 360 || 90 }}, and the same switch for the bake limit. A PR that changes a third-party recipe will also need that manual run before its Android check can pass, which is worth a line in the comment.

nitpick (non-blocking): 90 minutes leaves 10 minutes for everything outside the bake step. Restore ccache alone took 10 minutes once (run 44315476604), and a retry would then be cut off. 100 is safer.

nitpick (non-blocking): Without -k, timeout waits for docker buildx bake to exit after the TERM signal. If the hung client ignores that signal, the retry never starts. timeout -k 2m "$1" makes sure it does.

Assisted-by: ClaudeCode:claude-opus-5-5

@juliusknorr
juliusknorr force-pushed the ci/android-build-timeout branch from 371b9fd to ca5f7b6 Compare December 3, 2026 14:51
@juliusknorr juliusknorr changed the title ci(android): time out a hung build and retry it once ci(android): build on hosted runners Dec 3, 2026
@juliusknorr
juliusknorr force-pushed the ci/android-build-timeout branch from ca5f7b6 to 485c87d Compare December 3, 2026 14:56
@juliusknorr

Copy link
Copy Markdown
Member Author

Thanks, and sorry for the delay. Reworked: Android now builds on hosted runners. The timeout and retry are gone, since main already avoids the stalled export with docker cp, so third-party rebuilds keep the 6 h default. Could you have another look?

@DmySyz DmySyz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On issue:

Rebase onto main and drop the retry. The export it re-runs no longer exists. If a retry is still wanted, it would need to cover the docker cp part too.

And a note to consider:

Size the job limit for third-party rebuilds. Keep a job-level timeout-minutes as the safety net: a hung job otherwise holds a self-hosted runner for 4 to 6 hours. But make it long enough for a full V8 rebuild in both kinds of runs. For example, ${{ github.event_name == 'workflow_dispatch' && 360 || 240 }}. Or keep the short limit and document that a recipe-bump PR needs a maintainer to merge it with that check red. chrip's 100-minute nit applies to whatever the everyday limit is.

Android legs built in 8-10 minutes but waited 1-4 hours for one of the
five organisation runners. The build no longer needs them: third-party
builds come from the remote cache and ccache from the Actions cache. A
private copy keeps them, as it has no free hosted minutes.

Signed-off-by: Julius Knorr <jus@bitgrid.net>
Assisted-by: ClaudeCode:claude-opus-5-5
No-test: CI configuration, proven by this PR's own run
The slowest legitimate runs, third-party rebuilds, took up to 2 hours. A stalled export used to hold the job for the 6 hour default.

Signed-off-by: Julius Knorr <jus@bitgrid.net>
Assisted-by: ClaudeCode:claude-opus-5-5
No-test: CI configuration
@juliusknorr

Copy link
Copy Markdown
Member Author

Thanks! Rebased onto main; the retry was already gone (the build uses docker cp from main). Added a job-level timeout-minutes: 180: the slowest legitimate runs (third-party rebuilds) took up to 2 h, while the hung exports sat for 5+ h. One limit for both run types, since they share the job. Could you have another look?

@chrip chrip left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approve. Looks good from my side, though I'd still give the manual run more time (below). Please wait for DmySyz's re-review before merging, since their change request still blocks the merge.

My earlier review:

  • Third-party rebuilds take longer than the limit: partly fixed. 180 minutes covers every run I measured on the organisation runners, but with little room (below).
  • 100 instead of 90 minutes, and timeout -k: no longer apply ✓, since the timeout wrapper and the retry are gone.

Earlier comments:

  • DmySyz: drop the retry: addressed ✓
  • DmySyz: size the limit for a full V8 rebuild (360 for manual runs, 240 otherwise): partly, it is now 180 for all runs.

issue: 180 minutes leaves little room for a third-party rebuild, and the comment's "up to 2 h" is too low.
.github/workflows/build-android.yml:27-29. The run for #296 on 2026-11-19 took 155 minutes on the organisation runners (arm64 leg, run 44355576860), and that runner built V8 with 7 parallel jobs. Nobody has timed a rebuild on the hosted runners yet, as your description says. If one takes longer than 180 minutes, the manual run can no longer fill the remote cache, and the required Android checks keep timing out until someone raises the limit. Manual runs are rare, so giving them GitHub's 6-hour maximum costs little:

timeout-minutes: ${{ github.event_name == 'workflow_dispatch' && 360 || 180 }}

Please also change the comment to "up to 2.5 h".

question: Is the Free disk space step needed?
.github/workflows/build-android.yml:50-55. It took 2 to 3 of the 9 minutes on this PR's legs, and df still showed 116 GB free afterwards. If the build fits without it, dropping it (or running it only on manual runs) saves those minutes on every Android run.

Assisted-by: ClaudeCode:claude-opus-5-5

This branch was previously deployed

1 inactive deployment
build-cache — fae99af8 Deployed Dec 4, 2026 by juliusknorr via publish / publish #1387
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build process related changes build-performance CI and build time mobile iOS, iPadOS and Android no-tests-needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants