Conversation
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Clean registry buildcache on PR merge or close
Clean registry buildcache tags on PR close
Dec 14, 2025
wdconinc
reviewed
Dec 14, 2025
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
wdconinc
reviewed
Dec 14, 2025
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements automatic cleanup of buildcache container image tags from both ghcr.io and eicweb.phy.anl.gov registries when pull requests are closed or merged. This addresses the issue of buildcache accumulation without timestamps for automatic eviction. The workflow uses the branch slug (GITHUB_REF_POINT_SLUG) to identify and remove all associated buildcache tags.
Key Changes
- Added new
.github/workflows/cleanup-buildcache.ymlworkflow triggered on PR close - Implements deletion logic for both GitHub Container Registry (ghcr.io) and GitLab Container Registry (eicweb.phy.anl.gov)
- Updated build pipeline documentation to describe the automatic cleanup behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/cleanup-buildcache.yml |
New workflow that cleans up buildcache tags using branch slug pattern matching from both registries when PRs are closed, with manual dispatch option |
docs/build-pipeline.md |
Documents the buildcache cleanup workflow behavior and adds new trigger table section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
11 tasks
wdconinc
added a commit
that referenced
this pull request
Sep 15, 2026
* docs: correct pipeline, image and version-update documentation The documentation had drifted from the code in several places that would send a reader, human or agent, down the wrong path. AGENTS.md: - the workflow tree listed three of the six workflows, omitting the two reusable workflows that do all the building and the backport workflow - the image list named three images; cuda_devel and cuda_runtime were missing, as was any mention of the environments built only on GitLab CI - the spack-environment tree showed two of the nine environments - "Update versions in both places" named xl and cuda only. There are nine environments with an epic overlay, and the thing that actually matters is the trailing marker comment the Dockerfile keys its sed overrides on, which was not documented at all - "Tags are automatically cleaned on PR close by cleanup workflows" is not true for GitHub Actions: no such workflow exists, which is what issue #89 is about and PR #90 proposes. GitLab does clean up, via clean_unstable_mr and clean_pipeline. Say which is which .github/copilot-instructions.md carried the same "both xl and cuda" claim; corrected in step with AGENTS.md. The rest of that file correctly defers to AGENTS.md as the primary reference and is left alone. docs/build-pipeline.md described the pipeline as it was before the reusable workflows were split out: build-push.yml appeared to run the builds itself, and the diagrams showed two architectures where three are built. Add a table of the two reusable workflows and what each produces, and correct the architecture set to amd64, amd64_v3 and arm64. README.md linked to the GitLab mirror for files that live in this repository, and the link captioned "spack.sh" actually pointed at packages.yaml while the text describes editing the cherry-pick list, which is in spack-packages.sh. Point both at the files here. The historical merge-request link is left as-is, since it is a reference to something that only exists on GitLab. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B6394UjZvzHPVygCvjRc9n * docs: add amd64_v3 EIC jobs to build-pipeline flowchart Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com> * docs: use "available per-arch digests" in base-manifest step description Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Buildcache tags accumulate in container registries (ghcr.io and eicweb.phy.anl.gov) without timestamps for automatic eviction. This adds a workflow to delete them when PRs close or via manual trigger.
Implementation
.github/workflows/cleanup-buildcache.ymltriggers on:pull_request: types[closed]- automatic cleanup when PR closesworkflow_dispatch- manual cleanup with branch slug inputrlespinasse/github-slug-action@v5(for pull_request events) to ensureGITHUB_REF_POINT_SLUGis set-{GITHUB_REF_POINT_SLUG}-GITHUB_REF_POINT_SLUG(derived from branch name):{BUILD_IMAGE}-{GITHUB_REF_POINT_SLUG}-{arch}{BUILD_IMAGE}{ENV}-{BUILD_TYPE}-{GITHUB_REF_POINT_SLUG}-{arch}Example
For a PR from branch "my-feature" (where
GITHUB_REF_POINT_SLUG= "my-feature"), deletes:For manual cleanup via
workflow_dispatch, provide the branch slug (e.g., "old-feature") as input to delete buildcache tags for that branch.The cleanup workflow uses the same
GITHUB_REF_POINT_SLUGvariable as the build-push workflow, ensuring pattern consistency between tag creation and deletion.Authentication uses existing secrets:
GHCR_REGISTRY_TOKENandGITLAB_TOKENDocumentation
Updated
docs/build-pipeline.mdto document cleanup workflow and caching strategy.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.