Skip to content

[bazel] Improve job reliability and ensure jobs are time-bound - #5925

Merged
maru-ava merged 2 commits into
masterfrom
maru/bazel-job-reliability
Sep 5, 2026
Merged

[bazel] Improve job reliability and ensure jobs are time-bound#5925
maru-ava merged 2 commits into
masterfrom
maru/bazel-job-reliability

Conversation

@maru-ava

@maru-ava maru-ava commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Why this should be merged

Recent job failures caused by cache stalls were corrected by switching from HTTP to gRPC transport for cache requests. Effecting this transition did not involve a PR, but suggested the following follow-on changes:

  • Enforce the use of gRPC in CI to prevent accidental misconfiguration
  • Document the rationale for gRPC over HTTP
  • Add timeouts to Bazel CI jobs to ensure the impact of future failures is time-bound
  • Upgrade to Bazel 8.8.0, the latest in the 8.x series

@maru-ava maru-ava self-assigned this Sep 4, 2026
Copilot AI lite review requested due to automatic review settings September 4, 2026 07:14
@maru-ava
maru-ava requested a review from a team as a code owner September 4, 2026 07:14
@maru-ava maru-ava added the ci This focuses on changes to the CI process label Sep 4, 2026
@maru-ava maru-ava moved this to Ready 🚦 in avalanchego Sep 4, 2026

Copilot AI 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.

🟢 Approval recommended

The changes are consistent across CI configuration and documentation, and the enforcement/timeouts directly address the stated reliability goals without introducing apparent functional risk.

Pull request overview

Improves Bazel CI reliability by enforcing gRPC remote cache usage, adding explicit job-level timeouts to keep failures time-bounded, and aligning tooling with a Bazel 8.8.0 upgrade.

Changes:

  • Enforce grpcs:// remote-cache URLs in CI setup and document the rationale/tradeoffs of gRPC vs HTTP remote caching.
  • Add configurable per-job timeout-minutes to Bazel CI workflows (with longer limits for scheduled runs).
  • Upgrade Bazel to 8.8.0 and refresh the Bazel module lockfile accordingly.
File summaries
File Description
MODULE.bazel.lock Updates the bzlmod lockfile to the newer format/version and refreshed dependency/module metadata for the Bazel upgrade.
docs/bazel.md Adds documentation explaining why CI uses the gRPC remote cache protocol and how timeouts/retries behave.
.github/workflows/bazel-ci.yml Introduces workflow-call inputs for job timeouts and applies timeout-minutes to all Bazel CI jobs.
.github/workflows/bazel-ci-smoke.yml Adds explicit timeout-minutes to smoke-test jobs to keep them bounded.
.github/workflows/bazel-ci-scheduled.yml Configures longer timeout inputs for scheduled runs and disables the remote cache for broader scheduled coverage.
.github/actions/setup-bazel/configure-bazelrc.sh Enforces grpcs:// for remote-cache URLs when remote cache is enabled in CI.
.bazelversion Upgrades the pinned Bazel version to 8.8.0.
Review details
  • Files reviewed: 6/7 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@maru-ava
maru-ava added this pull request to the merge queue Sep 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 4, 2026
Comment thread .github/workflows/bazel-ci.yml Outdated
default: 5

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

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.

Remove this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed in #5930.

BAZEL_REMOTE_CACHE_URL="${BAZEL_REMOTE_CACHE_URL:-}"
BAZEL_REMOTE_CACHE_AUTH_HEADER="${BAZEL_REMOTE_CACHE_AUTH_HEADER:-}"

if [[ "$BAZEL_REMOTE_CACHE_ENABLED" == "true" && -n "$BAZEL_REMOTE_CACHE_URL" && -n "$BAZEL_REMOTE_CACHE_AUTH_HEADER" ]]; then

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.

If BAZEL_REMOTE_CACHE_ENABLED but the AUTH is empty, we run cache-less without warning. Is that intended? It was true before this PR therefore no change required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a GitHub Actions warning when remote cache is enabled but auth is absent.

Comment thread docs/bazel.md Outdated
command can make multiple RPCs. Retry delays and other build work also add time.
Use command and job timeouts to set a limit for the complete CI operation.

Pre-merge jobs use these job-level limits:

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.

This is true today but the limits for smoke are specified in a separate place, might diverge. Perhaps point that out, either here or as inline comments? No change required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the duplicated timeout values from this document. The workflow files are now the source of truth for their configured values.

steps:
- uses: actions/checkout@v5
- name: Run E2E smoke test with Bazel-built binary
uses: ./.github/actions/run-monitored-tmpnet-cmd

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.

The "Run" step inside run-monitored-tmpnet-cmd sets continue-on-error, so the logs etc are uploaded on failure. If the job is canceled instead by the timeout set here, the logs etc will have to upload within the grace period, which might be tight.

Perhaps the timeout should go in the "Run" step, but that requires an additional parameter etc, don't like it.

Perhaps ok to leave as is: when the failure is due to this timeout, maybe we don't care about the logs from the tmpnet run.

No change required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not yet convinced we're going to see enough timeouts where we want to see log output, and we can revisit this should it become a pressing concern.

Comment thread docs/bazel.md Outdated

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.

Perhaps add the new grpcs:// requirement?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Recent job failures caused by cache stalls were corrected by switching from HTTP to
gRPC transport for cache requests. Effecting this transition did not involve a PR, but
suggested the following follow-on changes:

 - Enforce the use of gRPC in CI to prevent accidental misconfiguration
 - Document the rationale for gRPC over HTTP
 - Add timeouts to Bazel CI jobs to ensure the impact of future failures is time-bound
 - Upgrade to Bazel 8.8.0, the latest in the 8.x series

Change-Id: I175ca05d6bdd1faa35457e1e8a1b30f8518f4c86
Change-Id: I1a3b71bfbd768c84bdfd6911acbcd129d839d3bb
@maru-ava
maru-ava force-pushed the maru/bazel-job-reliability branch from c3f5d81 to be8c692 Compare September 5, 2026 01:27
@maru-ava
maru-ava enabled auto-merge September 5, 2026 01:31
@maru-ava
maru-ava added this pull request to the merge queue Sep 5, 2026
Merged via the queue into master with commit 86b723a Sep 5, 2026
47 checks passed
@maru-ava
maru-ava deleted the maru/bazel-job-reliability branch September 5, 2026 01:55
@github-project-automation github-project-automation Bot moved this from Ready 🚦 to Done 🎉 in avalanchego Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci This focuses on changes to the CI process

Projects

Status: Done 🎉

Development

Successfully merging this pull request may close these issues.

4 participants