Skip to content

Conversation

adityamaru
Copy link
Contributor

@adityamaru adityamaru commented Sep 7, 2025

Summary

  • Adds a new verbose input parameter to the action for enhanced debugging capabilities
  • Implements detailed BuildKit cache logging using docker buildx du instead of basic filesystem commands
  • Provides visibility into cache usage patterns and pruning effectiveness
  • Prepares code structure for new metrics (BPA_V2_DEBUG_WORKERS_AVAILABLE_MS and BPA_V2_PRUNE_BYTES)

Changes

  • action.yml: Added verbose boolean input (default: false)
  • pruneBuildkitCache: Updated to accept verbose parameter and use docker buildx du for detailed cache information
  • Cache logging: When verbose is enabled, logs show:
    • Cache size for each layer
    • Last used timestamps
    • Cache types (regular, source, exec.cachemount, etc.)
    • Descriptions of cache contents
    • Total cache size before and after pruning
  • Future metrics: Added commented code structure for:
    • BPA_V2_DEBUG_WORKERS_AVAILABLE_MS: Track time for workers to become available
    • BPA_V2_PRUNE_BYTES: Track bytes pruned from cache
    • These will be enabled when updating to @buf/[email protected]+

Test plan

  • Unit tests updated and passing
  • Build successful
  • Test with verbose: false (default) - should not show cache details
  • Test with verbose: true - should show detailed cache information
  • Verify cache pruning still works correctly

Usage Example

- uses: useblacksmith/setup-docker-builder@main
  with:
    verbose: true  # Enable detailed cache logging

Future Work

When the buf packages are updated to v2.7.0+, uncomment the metric tracking code to automatically report:

  • Worker availability timing metrics
  • Cache pruning size metrics

🤖 Generated with Claude Code

- Add `verbose` input parameter to action.yml
- Update pruneBuildkitCache to use docker buildx du for detailed cache info
- Log cache state before and after pruning when verbose is enabled
- Shows cache size, last used time, type, and descriptions
- Helps debug cache usage and pruning effectiveness

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
cursor[bot]

This comment was marked as outdated.

- Add code structure for BPA_V2_DEBUG_WORKERS_AVAILABLE_MS metric
- Add code structure for BPA_V2_PRUNE_BYTES metric
- Currently commented out due to package version compatibility
- Will be enabled when updating to @buf/[email protected]+
- These metrics will track worker availability time and pruned cache bytes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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