Skip to content

ci: run independent workflow steps in parallel - #518

Open
caugner wants to merge 5 commits into
mainfrom
parallel-ci-steps
Open

ci: run independent workflow steps in parallel#518
caugner wants to merge 5 commits into
mainfrom
parallel-ci-steps

Conversation

@caugner

@caugner caugner commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Description

Update the build workflows to run independent steps in parallel groups:

  • prod-build.yml, stage-build.yml, test-build.yml: run all repository checkouts in one group.
  • prod-build.yml, stage-build.yml: run Update search index and Update AI Help index with macros alongside Sync build. Both only read the build output.

Motivation

Shorten the nightly builds by overlapping network-bound steps.

Additional details

Uses the parallel step keywords introduced in GitHub Actions on 2026-06-25: https://github.blog/changelog/2026-06-25-actions-steps-can-now-be-run-in-parallel/. A failing child fails the job at the end of the group, after all siblings have completed.

Expected savings, based on mean step durations of the last 5 (prod) / 3 (stage, test-build) successful runs:

Workflow Group Before (serial) After (bounded by) Saving
prod-build (~40 min) 9 checkouts ~73s ~32s (translated-content) ~41s
prod-build Search index + AI Help + Sync build ~118s + ~134s + ~863s ~863s (Sync build) ~252s
stage-build (~43 min) 9 checkouts ~76s ~33s (translated-content) ~43s
stage-build Search index + AI Help + Sync build ~111s + ~127s + ~1036s ~1036s (Sync build) ~238s
test-build (~35 min) 10 checkouts (incl. optional rari) ~92s ~40s (translated-content) ~52s

Total: ~4.9 min (~12%) for prod, ~4.7 min (~11%) for stage, ~1 min (~2.5%) for test.

Not parallelized:

  • Deploy Function vs. Sync build: both use gcloud with different service accounts, so re-authenticating during a background sync would race on the credentials.
  • review-deploy.yml: Setup gcloud alongside Setup Node + npm ci would save ~5s of ~100s.
  • Lint steps in test.yml: measured no gain (~8s either way), since the checks are CPU-bound on the 2-core runner.

actionlint doesn't know the parallel keyword yet and reports it as a syntax error.

Related issues and pull requests

Part of mdn/fred#1862.

Run all repository checkouts in one `parallel` group, and run the
search index and AI Help index updates alongside the bucket sync
instead of before and after it.

The checkout phase is bounded by the translated-content checkout
(~32s) instead of the serial sum (~73s). Both index updates (~2 min
each) only read the build output and hit Elasticsearch, OpenAI and
Postgres, so they are fully hidden behind the ~15 min `gsutil` sync.
The function deploy stays sequential because it re-authenticates
`gcloud` with a different service account.
Same restructuring as in `prod-build.yml`: run all repository
checkouts in one `parallel` group, and run the search index and AI
Help index updates alongside the bucket sync instead of around it.
Run all repository checkouts (including the optional rari checkout) in
one `parallel` group. The checkout phase is bounded by the
translated-content checkout (~40s) instead of the serial sum (~90s).

Unlike prod and stage, this workflow has no index updates to overlap
with the bucket sync.
@caugner
caugner marked this pull request as ready for review September 10, 2026 09:57
@caugner
caugner requested a review from a team as a code owner September 10, 2026 09:57
@caugner
caugner requested a review from LeoMcA September 10, 2026 09:57
The step depends on the fred build output and the dex install, both of
which are skipped when `SKIP_BUILD` is set, so it would fail in that
case. Aligns it with the other steps in the same `parallel` group.
Running the step in a `parallel` group ahead of `Deploy Function` would
otherwise let an OpenAI or Postgres failure block the function deploy,
which previously ran before this step.

- name: Update AI Help index with macros
if: ${{ ! vars.SKIP_BUILD }}
continue-on-error: true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, I'm not so sure about this. Before, we had a nice situation where a failed ai help index would fail the build (alerting us), but not fail to update the content.

Now, do we either have to chose between us finding out, or us bringing down the content upload.

I think I'd move this back, it didn't really count in the "time from start to deploy" sense

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