Home

Awesome

aws-batch-iiif-generator

Publication

Workflow

Overview

  1. Upload task file to the batch bucket
  2. Batch bucket trigger launches an instance of a Lambda function
  3. The Lambda function reads the content in the task file and submits a batch job
  4. Each batch job generates tiles and manifests from the original image and uploads the generated derivatives to the target S3 bucket

Batch Job

  1. Pull raw original files from the S3 bucket
  2. Generate tiles and manifests
  3. Upload to target S3 bucket

Deploy aws-batch-iiif-generator using CloudFormation stack

Step 1: Launch CloudFormation stack

Launch Stack

Click Next to continue

Step 2: Specify stack details

Note: It's a good idea to provide a namespace for these resource names to prevent collisions (prepend resource names w/ stack name maybe? Don't prepend anything to the DockerImage)

NameDescription
Stack nameany valid name
BatchRepositoryNameany valid name for Batch process repository
DockerImageany valid Docker image. E.g. wlhunter/iiif_s3_tiling:latest
JDNameany valid name for Job definition
JQNameany valid name for Job queue
LambdaFunctionNameany valid name for Lambda function
LambdaRoleNameany valid name for Lambda role
S3BucketNameany valid name for S3 bucket

Step 3: Configure stack options

Leave it as is and click Next

Step 4: Review

Make sure all checkboxes under Capabilities section are CHECKED

Click Create stack

Deploy aws-batch-iiif-generator using AWS CLI

Run the following in your shell to deploy the application to AWS:

aws cloudformation create-stack --stack-name awsiiifs3batch --template-body file://awsiiifs3batch.template --capabilities CAPABILITY_NAMED_IAM

See Cloudformation: create stack for --parameters option

Usage

Cleanup

To delete the sample application that you created, use the AWS CLI. Assuming you used your project name for the stack name, you can run the following:

aws cloudformation delete-stack --stack-name stackname

Batch Configuration

S3

Lambda function

Task File

NameDescription
jobNameBatch job name
jobQueueBatch job queue name
jobDefinitionBatch job definition name
command"./createiiif.sh"
AWS_REGIONAWS region, e.g. us-east-1
COLLECTION_IDENTIFIERfrom collection metadata csv
AWS_SRC_BUCKETS3 bucket which stores the images need to be processed. (Source S3 bucket)
AWS_DEST_BUCKETS3 bucket which stores the generated tile images and manifests files. (Target S3 bucket)
ACCESS_DIRPath to the image folder in AWS_SRC_BUCKET
DEST_PREFIXpath pointing to the directory that contains your collection directory in AWS_DEST_BUCKET (This is generally your "collection category" and does not include COLLECTION_IDENTIFIER at the path's end. )
DEST_URLRoot URL for accessing the manifests e.g. https://cloudfront.amazonaws.com/...
CSV_NAMEA CSV file with title and description of the images
CSV_PATHPath to the csv folder under the AWS_SRC_BUCKET

IIIF S3 Docker image