feat(builtins): add aspect ci warming task#1063
Conversation
✨ Aspect Workflows Tasks📅 Wed May 13 02:41:48 UTC 2026 ❌ 1 failed task
✅ 14 successful tasks
🔁 Reproduce❌ format (buildifier-gha-debug)🛠️ Fix❌ format (buildifier-gha-debug)Powered by Aspect Build · GitHub · X · LinkedIn · YouTube |
1369346 to
9cbc9dd
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 573c2b0010
ℹ️ 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".
|
|
||
| def _impl(ctx: TaskContext) -> int: | ||
| on_workflows_runner = bool(ctx.std.env.var("ASPECT_WORKFLOWS_RUNNER")) | ||
| mount = ctx.std.env.var("ASPECT__STORAGE_PATH") |
There was a problem hiding this comment.
Use runner storage env var for warming cleanup
The cleanup step reads ASPECT__STORAGE_PATH, but the runner environment model in lib/environment.axl is keyed off ASPECT_WORKFLOWS_RUNNER_STORAGE_PATH (with defaults derived from it). On Workflows runners where only the documented ASPECT_WORKFLOWS_RUNNER_* variables are present, mount is empty, so the pre-warming cleanup is skipped and stale cache contents can be re-archived by warming_archive, defeating the task’s “clean then repopulate” behavior.
Useful? React with 👍 / 👎.
3b26ee6 to
cf6ab03
Compare
Cleans `${ASPECT__STORAGE_PATH}/{bazel,output,caches/repository}` —
matching rosetta's WarmingTaskRef cleanup — then runs
`bazel build --nobuild` against the given targets so the repository,
output, and bazel caches under the ephemeral mount are populated and
ready for an Aspect Workflows warming archive to capture.
Default targets `//...`; positional args override. Honors BazelTrait
flags / startup_flags contributions so warming sees the same
`--config=...` etc. as real builds.
Pairs with #1062 (env-var routing of the launcher / AXL caches into
the same ephemeral mount) and a forthcoming silo PR that adds these
subtrees to the warming archive.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Closes the loop on the customer-facing warming workflow. After the
bazel cache populate step succeeds, when ASPECT_WORKFLOWS_RUNNER is
set the task now invokes /etc/aspect/workflows/bin/warming_archive to
upload the populated caches to the warming bucket — so the customer's
GitHub Actions workflow drops to:
steps:
- uses: actions/checkout@v4
- name: Warming Task
run: aspect ci warming
Off a Workflows runner the archive step is skipped with a warning to
stderr; the populate step still runs so the task is useful for local
testing.
cf6ab03 to
767c490
Compare
Summary
Adds a new built-in AXL task:
aspect ci warming.${ASPECT__STORAGE_PATH}/{bazel,output,caches/repository}(matching rosetta'sWarmingTaskRefcleanup).bazel build --nobuildagainst the given targets so the repository, output, and bazel caches under the ephemeral mount are populated.ASPECT_WORKFLOWS_RUNNERis set, also invokes/etc/aspect/workflows/bin/warming_archiveto upload the populated caches to the warming bucket. Off-runner this step is skipped with a stderr warning; the populate step still runs so the task is useful for local testing.This collapses the customer-facing GHA warming workflow to:
(Replacing the prior 5-step flow that called
configure_workflows_env,agent_health_check,rosetta run warming, andwarming_archiveseparately.)//...; positional args override.BazelTraitflags / startup_flags contributions so warming sees the same--config=...etc. as real builds.ASPECT__STORAGE_PATHis unset.This is the new-task half of the warming-refactor plan. Sibling PRs:
ASPECT_LAUNCHER_CACHE,ASPECT_CLI_CACHE).archive.sh/restore.sh.The three pieces are runtime-coupled but compile-independent. Either PR here can land first.
Test plan
Tested locally on macOS aarch64.
cargo build -p aspect-cli— cleanaspect ci warming --help— CLI surface exposes the task under groupciaspect ci warming //...in a Bazel example workspace — cleanup is no-op (noASPECT__STORAGE_PATH),bazel build --nobuildruns, exits 0 with0 total actions, then prints theASPECT_WORKFLOWS_RUNNER is not set; skipping the warming archive upload step.warning to stderrASPECT__STORAGE_PATH=/tmp/warmtestwithbazel/,output/,caches/repository/subdirs and a sentinel file → afteraspect ci warming, all three subdirs are removedASPECT_WORKFLOWS_RUNNER=1 ASPECT_WORKFLOWS_RUNNER_STORAGE_PATH=/tmp/warmtest aspect ci warming //...— task progresses past the bazel populate step and attempts to spawn/etc/aspect/workflows/bin/warming_archive(fails on a laptop because the binary isn't there, which confirms the call site is wired)🤖 Generated with Claude Code