Compresses images and manifests from S3 into ZIP files. It supports creating both full ZIP archives and partial ZIP segments for large datasets.
- Trigger: Receives messages from SQS (typically via
ZooniverseZipTriggerService). - Analysis: Lists objects in the specified S3
processDir. - Slicing: Filters and slices the file list based on
startIndexandendIndex. - Manifest: Ensures the manifest CSV is included in every ZIP part.
- Compression:
- Files < 2GB: Processed in Lambda's
/tmpspace. - Files > 2GB: Processed using Amazon EFS mount (
/mnt/efs).
- Files < 2GB: Processed in Lambda's
- Upload: Saves the resulting ZIP to
export/in the S3 bucket. - Callback: Sends a status update (
zip-readyorpartial-zip-ready) back to the Laravel app via SQS.
- Inputs (JSON):
processDir: The directory in S3 containing files to zip.s3Bucket: Target S3 bucket.updatesQueueUrl: SQS URL for reporting status.queueId: Reference ID for the Laravel export queue.startIndex/endIndex: (Optional) Indices for partial zipping.
- Outputs:
- S3:
export/{processDir}.ziporexport/{processDir}_part{index}.zip. - SQS: Status notification to
updatesQueueUrl.
- S3:
- Laravel Command:
App\Console\Commands\SqsListenerExportUpdate(Listens forzip-readystatus). - Laravel Service:
App\Services\Actor\Zooniverse\ZooniverseZipTriggerService(Triggers this Lambda). - Related Lambda:
BiospexZipMerger(Consolidates partial ZIPs created by this function).
Use the deploy.sh script for interactive deployment to AWS (Region: us-east-2).