-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lambda handler for attaching thumbnails to records
Now that Archivematica is generating thumbnails for us, we want to use those instead of generating our own. This commit adds a lambda handler that will be subscribed to S3 events fired when Archivematica generates new .jpg files inside DIPs. The handler checks whether the .jpg is a thumbnail, and if so creates a CDN URL for it and adds that URL, and the S3 location of the thumbnail, to the corresponding record in our database.
- Loading branch information
Liam Lloyd
committed
Aug 16, 2024
1 parent
3df4003
commit 655993f
Showing
23 changed files
with
3,103 additions
and
1,371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM public.ecr.aws/lambda/nodejs:18 as builder | ||
WORKDIR /usr/local/apps/stela/ | ||
|
||
COPY package.json ./ | ||
COPY tsconfig.build.json ./ | ||
COPY tsconfig.json ./ | ||
COPY jest.config.js ./ | ||
COPY packages ./packages | ||
|
||
RUN npm install -g [email protected] | ||
RUN npm install | ||
RUN npm install -ws | ||
RUN npm run build -ws | ||
|
||
|
||
FROM public.ecr.aws/lambda/nodejs:18 as final | ||
WORKDIR ${LAMBDA_TASK_ROOT} | ||
|
||
COPY --from=builder /usr/local/apps/stela/packages/record_thumbnail_attacher/dist ./packages/record_thumbnail_attacher/dist | ||
COPY --from=builder /usr/local/apps/stela/packages/record_thumbnail_attacher/package.json ./packages/record_thumbnail_attacher/package.json | ||
COPY --from=builder /usr/local/apps/stela/packages/logger/dist ./packages/logger/dist | ||
COPY --from=builder /usr/local/apps/stela/packages/logger/package.json ./packages/logger/package.json | ||
COPY --from=builder /usr/local/apps/stela/package.json ./package.json | ||
COPY --from=builder /usr/local/apps/stela/package-lock.json ./package-lock.json | ||
|
||
RUN npm install -g [email protected] | ||
RUN npm install --workspace @stela/record_thumbnail_attacher | ||
|
||
CMD ["packages/record_thumbnail_attacher/dist/index.handler"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.