-
Notifications
You must be signed in to change notification settings - Fork 5
fix: clean registry buildcache tags on PR close #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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>
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>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
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.