Expand description
AWS S3 SDK function wrappers for caching deployer artifacts
Structs§
- Instance
File Urls - Result of uploading instance files to S3
- Region
- The region to send requests to.
Enums§
- Upload
Source - Source for S3 upload
Constants§
- DEPLOYMENTS_
PREFIX - Prefix for per-deployment data
- MAX_
CONCURRENT_ HASHES - Maximum number of concurrent file hash operations
- MAX_
HASH_ BUFFER_ SIZE - Maximum buffer size for file hashing (32MB)
- PRESIGN_
DURATION - Duration for pre-signed URLs (6 hours)
- TOOLS_
BINARIES_ PREFIX - Prefix for tool binaries: tools/binaries/{tool}/{version}/{platform}/{filename}
- TOOLS_
CONFIGS_ PREFIX - Prefix for tool configs: tools/configs/{deployer_version}/{component}/{file}
- WGET
- Common wget prefix with retry settings for S3 downloads
Functions§
- cache_
and_ presign - Caches content to S3 if it doesn’t exist, then returns a pre-signed URL
- create_
client - Creates an S3 client for the specified AWS region
- delete_
bucket - Deletes a bucket (must be empty first)
- delete_
bucket_ and_ contents - Deletes all objects in a bucket and then deletes the bucket itself
- delete_
bucket_ config - Deletes the bucket config file so a new bucket name is generated on next use.
- delete_
prefix - Deletes all objects under a prefix in S3 using batch delete (up to 1000 objects per request)
- ensure_
bucket_ exists - Ensures the S3 bucket exists, creating it if necessary
- get_
bucket_ name - Gets the bucket name, generating one if it doesn’t exist. The bucket name is stored in ~/.commonware_deployer/bucket.
- hash_
file - Computes the SHA256 hash of a file and returns it as a hex string. Uses spawn_blocking internally to avoid blocking the async runtime.
- hash_
files - Computes SHA256 hashes for multiple files concurrently. Returns a map from file path to hex-encoded digest.
- is_
no_ such_ bucket_ error - Checks if an error is a “bucket does not exist” error
- object_
exists - Checks if an object exists in S3
- presign_
url - Generates a pre-signed URL for downloading an object from S3
- upload_
instance_ files - Uploads binary and config files for instances to S3 with digest-based deduplication.