Pluto Restore Assets is a service designed to manage and monitor the restoration of assets from AWS S3 Glacier storage. It consists of two main components: an API server and a worker service, both running in Kubernetes.
- API Server: RESTful service listening on port 9000 for restore requests
- Worker Service: Handles the actual restoration process with AWS S3
- Kubernetes Integration: Runs as containerized services with proper RBAC
- AWS S3 Integration: Manages asset restoration from Glacier
- Logging: Comprehensive request and operation logging
- Cost Estimation: Provides cost estimates for Standard and Bulk retrievals
The application requires the following environment variables:
KUBE_NAMESPACE
: Kubernetes namespace (default: "default")ASSET_BUCKET_LIST
: Comma-separated list of asset bucketsMANIFEST_BUCKET
: S3 bucket for storing manifestsAWS_ROLE_ARN
: AWS role ARN for permissionsAWS_ACCESS_KEY_ID
: AWS access key IDAWS_SECRET_ACCESS_KEY
: AWS secret access keyAWS_DEFAULT_REGION
: AWS regionWORKER_IMAGE
: Docker image for the worker serviceBASE_PATH
: Base path for local assetsSMTP_HOST
: SMTP server hostnameSMTP_PORT
: SMTP server portSMTP_FROM
: Email sender addressNOTIFICATION_EMAIL
: Email recipient for notificationsPLUTO_PROJECT_URL
: Base URL for project references
- POST /api/v1/restore: Create a new restore job
- Required fields:
id
,user
,path
,retrievalType
- Required fields:
- GET /api/v1/restore/{id}: Get status of a restore job
- GET /health: Health check endpoint
main.go
: Server initialization and routinghandlers/
: Request handlers and interfacesrestore.go
: Main restore endpoint logicinterfaces.go
: Interface definitionsrestore_test.go
: Handler unit tests
main.go
: Worker process implementation- Handles AWS S3 interactions and restore operations
internal/s3utils/
: AWS S3 utility functionsmanifest.go
: Manifest generationmonitor.go
: Restore status monitoringupload.go
: S3 upload operations
internal/types/
: Shared type definitionspkg/kubernetes/
: Kubernetes integration
The project includes comprehensive tests:
- API Handler Tests:
cmd/api/handlers/restore_test.go
- S3 Utility Tests:
internal/s3utils/monitor_test.go
- Manifest Generation Tests:
internal/s3utils/manifest_test.go
make deploy-latest
The service uses several Kubernetes resources:
- API Server deployment
- Worker deployment for handling restore jobs
Exposes the API server on port 9000
job-creator-role.yaml
: Defines permissionsjob-creator-rolebinding.yaml
: Binds role to service account
Summary for 1000 objects totaling 1TB:
Retrieval Option | Retrieval Time | Total Cost |
---|---|---|
Expedited | 1–5 minutes | $40.72 |
Standard | 3–5 hours | $10.29 |
Bulk | 5–12 hours | $2.59 |