The meta-repo CLI provides advanced caching and content-addressed storage to speed up builds, enable build artifact sharing, and provide maximum reproducibility.
Cache build artifacts to speed up subsequent builds by reusing unchanged artifacts.
meta cache build scraper-capabilities --source bazel-bin/scraper_capabilitiesBuilds and caches an artifact with automatic cache key computation.
meta cache get scraper-capabilities --target bazel-bin/scraper_capabilitiesRetrieves cached artifact if available.
meta cache invalidate --component scraper-capabilities
meta cache invalidate --allRemoves cache entries.
meta cache listShows all cached artifacts.
meta cache statsShows cache size and usage statistics.
Cache keys are computed from:
- Component version
- Build target
- Dependency versions
- Source file hashes
Same inputs = same cache key = cache hit!
- Speed - Faster builds by reusing artifacts
- Efficiency - Reduce redundant work
- Cost - Lower compute costs
- Reliability - Deterministic cache keys
Share build artifacts across machines and teams using S3 or Google Cloud Storage.
# Cache with S3
meta cache build component --source path/ --remote s3://my-bucket/cache
meta cache get component --target path/ --remote s3://my-bucket/cache# Cache with GCS
meta cache build component --source path/ --remote gs://my-bucket/cache
meta cache get component --target path/ --remote gs://my-bucket/cacheIf remote cache is unavailable, the system automatically falls back to local cache.
Set environment variables for authentication:
S3:
export AWS_ACCESS_KEY_ID=your-key
export AWS_SECRET_ACCESS_KEY=your-secret
export AWS_DEFAULT_REGION=us-east-1GCS:
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json- Team Sharing - Share builds across team members
- CI/CD Speed - Faster CI builds by reusing artifacts
- Cost Savings - Reduce redundant builds
- Reliability - Automatic fallback to local
Content-addressed store for deterministic builds, deduplication, and instant rollback.
meta store add scraper-capabilities --source bazel-bin/scraper_capabilitiesAdds artifact to content-addressed store. Hash computed from all inputs.
meta store query abc123def456...Queries store for artifact by content hash.
meta store get abc123def456... --target output/Retrieves artifact from store by content hash.
meta store listLists all entries in the store.
meta store statsShows store size and usage.
# Store with S3
meta store add component --source path/ --remote s3://my-bucket/store
meta store get hash --target path/ --remote s3://my-bucket/store
# Store with GCS
meta store add component --source path/ --remote gs://my-bucket/store
meta store get hash --target path/ --remote gs://my-bucket/store.meta-store/
├── ab/
│ ├── abc123def456.../
│ │ └── [artifact files]
│ └── abc123def456....metadata.json
└── cd/
└── cdef789012.../
- Reproducibility - Same inputs = same hash = same output
- Deduplication - Store only unique artifacts
- Rollback - Instant state switching
- Sharing - Share builds across machines
Clean up unused cache and store entries to save disk space.
meta gc store # Remove unreferenced store entries
meta gc cache # Remove old cache entries
meta gc all # Clean both store and cache- Disk Space - Free up space from unused artifacts
- Performance - Faster lookups with smaller stores
- Maintenance - Automated cleanup
Caching and storage work together with other systems:
# 1. Apply with caching
meta apply --locked --env prod # Uses cache if available
# 2. Cache to remote S3
meta cache build component --source build/ --remote s3://bucket/cache
# 3. Add to store for sharing
meta store add component-name --source build-output/
# 4. Garbage collection
meta gc allmeta/utils/cache.py- Cache managementmeta/utils/cache_keys.py- Cache key computationmeta/utils/remote_cache.py- S3/GCS backend supportmeta/utils/content_hash.py- Content hashingmeta/utils/store.py- Content-addressed storemeta/utils/gc.py- Garbage collectionmeta/commands/cache.py- Cache management commandsmeta/commands/store.py- Store management commandsmeta/commands/gc.py- Garbage collection commands
Optional dependencies (only needed for remote cache/store):
boto3>=1.26.0- For S3 supportgoogle-cloud-storage>=2.10.0- For GCS support
Install with:
pip install boto3 # For S3
pip install google-cloud-storage # For GCS- Performance - Faster builds through caching
- Reproducibility - Content-addressed storage ensures identical builds
- Team Collaboration - Share builds across team members
- Cost Savings - Reduce redundant builds
- Flexibility - Works with or without remote backends
- Efficiency - Deduplication and garbage collection