Skip to content

feat(builtins): add aspect ci warming task#1063

Open
gregmagolan wants to merge 3 commits into
mainfrom
aspect_ci_warming_task
Open

feat(builtins): add aspect ci warming task#1063
gregmagolan wants to merge 3 commits into
mainfrom
aspect_ci_warming_task

Conversation

@gregmagolan
Copy link
Copy Markdown
Member

@gregmagolan gregmagolan commented May 5, 2026

Summary

Adds a new built-in AXL task: aspect ci warming.

  1. Cleans ${ASPECT__STORAGE_PATH}/{bazel,output,caches/repository} (matching rosetta's WarmingTaskRef cleanup).
  2. Runs bazel build --nobuild against the given targets so the repository, output, and bazel caches under the ephemeral mount are populated.
  3. When ASPECT_WORKFLOWS_RUNNER is set, also invokes /etc/aspect/workflows/bin/warming_archive to 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:

jobs:
    warming-archive:
        name: Aspect Workflows Warming
        runs-on: [self-hosted, aspect-workflows, aspect-default]
        steps:
            - uses: actions/checkout@v4
            - name: Warming Task
              run: aspect ci warming

(Replacing the prior 5-step flow that called configure_workflows_env, agent_health_check, rosetta run warming, and warming_archive separately.)

  • Default targets //...; positional args override.
  • Honors BazelTrait flags / startup_flags contributions so warming sees the same --config=... etc. as real builds.
  • Cleanup is no-op when ASPECT__STORAGE_PATH is unset.

This is the new-task half of the warming-refactor plan. Sibling PRs:

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 — clean
  • aspect ci warming --help — CLI surface exposes the task under group ci
  • aspect ci warming //... in a Bazel example workspace — cleanup is no-op (no ASPECT__STORAGE_PATH), bazel build --nobuild runs, exits 0 with 0 total actions, then prints the ASPECT_WORKFLOWS_RUNNER is not set; skipping the warming archive upload step. warning to stderr
  • Pre-seeded ASPECT__STORAGE_PATH=/tmp/warmtest with bazel/, output/, caches/repository/ subdirs and a sentinel file → after aspect ci warming, all three subdirs are removed
  • ASPECT_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)
  • End-to-end on a staging Workflows runner — depends on feat: route launcher and AXL caches via env vars #1062 + the silo PR

🤖 Generated with Claude Code

@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented May 5, 2026

✨ Aspect Workflows Tasks

📅 Wed May 13 02:41:48 UTC 2026

❌ 1 failed task

  • ❌ format (buildifier-gha-debug) · ⏱ 1m 20s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 failed in diff · Format failed (1 file needs format)

✅ 14 successful tasks

  • ✅ build (build-gha) · ⏱ 1m 14s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (161 built)
  • ✅ build (build-gha-debug) · ⏱ 1m 12s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel build complete (161 built)
  • ✅ delivery (delivery-gha) · ⏱ 1m 47s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Delivery complete (1 delivered)
  • ✅ delivery (delivery-gha-debug) · ⏱ 5m 5s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Delivery complete (1 delivered)
  • ✅ format (format-gha) · ⏱ 1m 24s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ format (format-gha-debug) · ⏱ 1m 14s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ gazelle (gazelle-from-source-gha) · ⏱ 1m 23s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle (gazelle-from-source-gha-debug) · ⏱ 1m 13s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle (gazelle-gha) · ⏱ 1m 11s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ gazelle (gazelle-gha-debug) · ⏱ 1m 9s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ lint (lint-gha) · ⏱ 1m 22s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ lint (lint-gha-debug) · ⏱ 1m 14s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Lint complete (clean)
  • ✅ test (test-gha) · ⏱ 1m 10s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (25/25 passed · 25 cached)
  • ✅ test (test-gha-debug) · ⏱ 1m 9s · ✨ Aspect · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (25/25 passed · 25 cached)

🔁 Reproduce

❌ format (buildifier-gha-debug)

aspect format --check=true --scope=changed --formatter-target=//tools/format:format-starlark

🛠️ Fix

❌ format (buildifier-gha-debug)

aspect format --check=false --formatter-target=//tools/format:format-starlark -- \
  crates/aspect-cli/src/builtins/aspect/warming.axl

Powered by Aspect Build · GitHub · X · LinkedIn · YouTube

@gregmagolan gregmagolan force-pushed the aspect_ci_warming_task branch from 1369346 to 9cbc9dd Compare May 5, 2026 18:14
@gregmagolan gregmagolan marked this pull request as ready for review May 5, 2026 18:44
@gregmagolan gregmagolan requested a review from thesayyn May 5, 2026 18:44
Copy link
Copy Markdown

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

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: 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")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@gregmagolan gregmagolan force-pushed the aspect_ci_warming_task branch 3 times, most recently from 3b26ee6 to cf6ab03 Compare May 9, 2026 17:58
gregmagolan and others added 3 commits May 12, 2026 19:40
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.
@gregmagolan gregmagolan force-pushed the aspect_ci_warming_task branch from cf6ab03 to 767c490 Compare May 13, 2026 02:40
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