Skip to content

fix(ci): run the health check before warming's storage cleanup#1300

Merged
gregmagolan merged 2 commits into
mainfrom
fix-warming-cleanup-after-health-check
Jun 28, 2026
Merged

fix(ci): run the health check before warming's storage cleanup#1300
gregmagolan merged 2 commits into
mainfrom
fix-warming-cleanup-after-health-check

Conversation

@gregmagolan

@gregmagolan gregmagolan commented Jun 28, 2026

Copy link
Copy Markdown
Member

Summary

aspect ci warming cleaned the prior Bazel state under the runner storage mount (ASPECT_WORKFLOWS_RUNNER_STORAGE_PATH) before setup_phase, which is where the Workflows agent_health_check runs. So the health check ran after the wipe. The health check must run first — it validates the runner before warming touches any of its state.

This moves the cleanup to after setup_phase. Because the health check (ctx.bazel.health_check()) starts a Bazel server in the runner --output_base under that same mount, cleaning afterwards would wipe <mount>/output/* out from under a live server and poison it. So the cleanup now shuts that server down firstbazel <resolved-startup-flags> shutdown, replaying the RunCommand's --output_base/--output_user_root so it targets the right server — then does the rm. Best-effort throughout (a missing server is tolerated).

`aspect ci warming` cleaned the prior Bazel state under the runner storage
mount *before* `setup_phase`, so the Workflows `agent_health_check` ran after
the wipe. The health check must run first — it validates the runner before
warming touches any of its state.

Move the cleanup to after `setup_phase`. The health check
(`ctx.bazel.health_check()`) starts a Bazel server in the runner
`--output_base` under the same mount, so cleaning afterwards would wipe
`<mount>/output/*` out from under a live server. Shut that server down first
(`bazel <resolved-startup-flags> shutdown`, targeting the runner output base)
before the wipe; best-effort, so a missing server is tolerated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e85280b476

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread crates/aspect-cli/src/builtins/aspect/warming.axl Outdated
@aspect-workflows

aspect-workflows Bot commented Jun 28, 2026

Copy link
Copy Markdown

✨ Aspect Workflows Tasks

📅 Sun Jun 28 14:21:05 UTC 2026

⚠️ 2 flagged tasks

  • ⚠️ delivery-gha-debug [delivery] · ⏱ 34.1s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Delivery complete (1 delivered · 2 warn · 3 skipped)
  • ⚠️ delivery-gha [delivery] · ⏱ 29.3s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Delivery complete (1 delivered · 2 warn · 3 skipped)

✅ 27 successful tasks

  • ✅ axl-smoke-gha-bootstrap [build] · ⏱ 1m 7s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (1 built)
  • ✅ run-axl-smoke [run] · ⏱ 19.9s · 🐙 GitHub Actions · ☑️ Check
    💬 Ran //examples/deliverable:py_deliverable
  • ✅ run-axl-smoke-2 [run] · ⏱ 14.2s · 🐙 GitHub Actions · ☑️ Check
    💬 Ran //examples/deliverable:sh_deliverable
  • ✅ axl-tests-gha-bootstrap [build] · ⏱ 19.8s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (1 built)
  • ✅ build-gha-debug [build] · ⏱ 5m 2s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (166 built)
  • ✅ build-gha [build] · ⏱ 5m 2s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (166 built)
  • ✅ build-gha-ephemeral [build] · ⏱ 36.4s · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (9 built)
  • ✅ buildifier-gha-debug [buildifier] · ⏱ 32.2s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ buildifier-gha [buildifier] · ⏱ 1m · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-gha-debug [format] · ⏱ 1m 35s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-format-repeat-task [format] · ⏱ 1m 44s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-format-repeat-task-2 [format] · ⏱ 21.9s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-format-repeat-task-3 [format] · ⏱ 18.9s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-format-repeat-task-4 [format] · ⏱ 18.2s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format-gha [format] · ⏱ 1m 29s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ gazelle-gha-debug [gazelle] · ⏱ 34.2s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle-from-source-gha-debug [gazelle] · ⏱ 1m 58s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle-from-source-gha [gazelle] · ⏱ 2m 26s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle-gha [gazelle] · ⏱ 33.7s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ init-shell [build] · ⏱ 30.5s · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (10 built)
  • ✅ lint-gha-debug [lint] · ⏱ 1m 11s · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ lint-gha [lint] · ⏱ 1m 7s · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ test-gha-debug [test] · ⏱ 5m · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (26/26 passed · 25 cached)
  • ✅ test-gha-coverage [test] · ⏱ 22.9s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (1/1 passed · 1 cached)
  • ✅ test-gha-target-pattern-file [test] · ⏱ 17.1s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (1/1 passed · 1 cached)
  • ✅ test-gha [test] · ⏱ 5m 4s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (26/26 passed · 23 cached)
  • ✅ test-gha-ephemeral [test] · ⏱ 1m 3s · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (1/1 passed)

🔁 Reproduce

⚠️ delivery (delivery-gha-debug · delivery-gha)

# --mode=always --track-state=false for off-runner with no state backend.
aspect delivery \
  --commit-sha=1a7cc52540a5b92383ccac19ff4af56c4910bb22 \
  --mode=always \
  --track-state=false \
  --dry-run=true

Install aspect: aspect.build/docs/cli/install


⏱ Last updated Sun Jun 28 14:26:04 UTC 2026 · 📊 GitHub API quota 845/15,000 (6% used, resets in 25m)
🚀 Powered by Aspect CLI (v0.0.0-dev)  |  Aspect Build · X · LinkedIn · YouTube

Addressing Codex review on #1300: the cleanup shut the server down with a raw
`command("bazel")`, which bypasses the runtime's launcher resolution. When
Aspect runs with a resolved Bazel binary (BAZEL_REAL) or a `tools/bazel`
wrapper, the health check and build go through `bazel_command()` (honoring
BAZEL_REAL, setting ASPECT_CLI_RUNNING), so a bare `bazel` could invoke a
different binary/wrapper that doesn't target the server the health check
started — leaving it live while the cleanup wipes the output base.

Add a `ctx.bazel.shutdown()` runtime method that goes through `bazel_command()`
and replays the active run command's startup flags (like `build`/`info`/
`health_check`), and call it from warming instead of the raw command.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gregmagolan gregmagolan merged commit 3bc400e into main Jun 28, 2026
70 checks passed
@gregmagolan gregmagolan deleted the fix-warming-cleanup-after-health-check branch June 28, 2026 14:30
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.

1 participant