Storage & Tasks#
Object Storage#
The storage module manages SPK packages in S3-compatible object
storage. It handles uploading, downloading (rehoming),
and deleting package files, and is configured via the storage environment
variables described in Deployment.
- spkrepo.storage.delete(object_key)[source]#
Delete a file from Object Storage. Returns True on success.
- spkrepo.storage.download(object_key, local_path)[source]#
Download a file from Object Storage to a local path. Returns True on success.
- spkrepo.storage.purge_cdn(url_path)[source]#
Issue a CDN purge for the given URL path. Logs and skips if not configured.
Background Tasks#
Celery tasks are used for long-running operations triggered from the admin
interface. All tasks run on the ops queue and are tracked per-user via
Redis for 24 hours after completion. Task progress is visible on the
Task Status page in the admin interface.
- (task)spkrepo.views.tasks.rehome_from_storage(build_id, build_label)#
Download a build from Object Storage back to local disk for editing.
- (task)spkrepo.views.tasks.resync_build_file(build_id, build_label)#
Recalculate md5 and size from sidecar or local file.
- (task)spkrepo.views.tasks.resync_build_metadata(build_id, build_label)#
Re-read build metadata from sidecar or SPK and reapply to DB.
If the build has a sidecar (Object Storage), reads metadata from the sidecar. Otherwise parses the local .spk file and checks consistency against siblings.
- (task)spkrepo.views.tasks.upload_to_storage(build_id, build_label)#
Upload a signed, active build from local disk to Object Storage.