Skip to content

ci: one-time cache clear to reduce S3 bucket bloat#901

Closed
Corey Christous (cchristous) wants to merge 1 commit intomasterfrom
ci/clear-semaphore-cache
Closed

ci: one-time cache clear to reduce S3 bucket bloat#901
Corey Christous (cchristous) wants to merge 1 commit intomasterfrom
ci/clear-semaphore-cache

Conversation

@cchristous
Copy link
Copy Markdown
Member

Summary

  • Adds cache clear as the first command in the Semaphore CI pipeline prologue

Why this is needed

The prod Semaphore cache S3 bucket (semaphore-cache-519856050701-us-west-2) has grown to 137 TB, up from 58 TB just 3 months ago. Analysis shows that Maven cache entries are being stored with unique-per-build keys (e.g., cache-maven-8.0.x-1770405615), creating a new 17-35 GB cache file on every single build instead of overwriting a stable key.

With the 90-day S3 lifecycle, this causes thousands of duplicate cache files to pile up. This project is one of the top contributors to the bucket size.

What this PR does

Adds cache clear as the first prologue command, which deletes all cached entries for this project. This is a one-time cleanup -- the change should be reverted immediately after merging so that caching resumes normally.

Why this is safe

  • cache clear only affects this project cache prefix in S3 (scoped by Semaphore project ID)
  • The first build after merge will run without cache (slightly slower), then cache store will repopulate it
  • No impact on other projects or production systems
  • The CI pipeline continues to function normally; it just starts cold once

Action after merge

Revert this PR immediately after the first successful pipeline run so that future builds benefit from caching again.

The Semaphore cache S3 bucket (semaphore-cache-519856050701-us-west-2) has
grown to 137 TB due to Maven cache entries being stored with unique-per-build
keys. This causes thousands of multi-GB duplicate cache files to accumulate
over the 90-day lifecycle window.

This adds `cache clear` as the first command in the CI prologue to flush
all existing cache entries for this project. This is a one-time cleanup
and should be reverted after merging.
@cchristous Corey Christous (cchristous) deleted the ci/clear-semaphore-cache branch February 11, 2026 22:00
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