Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update the screenshot Lambda function #20427

Merged
merged 6 commits into from
Jan 8, 2020

Conversation

m-allanson
Copy link
Contributor

Description

This fixes #19452. The errors were due to the Lambda container running out of space. It seems like this was due to the function being kept warm, and error logs filling up the tmp directory.

Redeploying the function would have reset that space, acting as a temporary fix. However, this function was running on Node 6, which is no longer supported by AWS Lambda. Meaning it has to use a newer runtime before it could be redeployed.

I tried and failed to rebuild the existing code on a newer version of Node.

Instead, here's an update that:

  • updates the runtime to Node 10
  • swaps the vendored version of Chrome out for an installable dependency
  • adds some more helpful logging
  • includes a (manual) local testing mode

This PR drops 40MB from a shallow checkout of the Gatsby repo 🎉

The code has been running for the last couple of weeks creating the screenshots at https://www.gatsbyjs.org/showcase/.

Documentation

There are no changes to the plugin. This PR only updates the AWS Lambda function that the plugin uses, which is not a user-facing part of the plugin. I've added a readme to the Lambda function.

Related Issues

Fixes #19452

@m-allanson m-allanson requested review from a team as code owners January 6, 2020 12:43
@muescha
Copy link
Contributor

muescha commented Jan 8, 2020

FYI:

i got in mail the double-shot-2507 newsletter with:

Chromda - "Chromda is an AWS Lambda function for serverless capturing screenshots of websites." Trigger it via SQS, SNS, API Gateway or Cloudwatch events.

maybe it is interesting for you how they designed the lambda screenshot tool

Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job fixing this, Mike! Thank you so much 💪

@sidharthachatterjee sidharthachatterjee added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Jan 8, 2020
@gatsbybot gatsbybot merged commit 242ff89 into master Jan 8, 2020
@delete-merged-branch delete-merged-branch bot deleted the update-screenshot-transformer branch January 8, 2020 21:36
@LekoArts LekoArts mentioned this pull request Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intermittent failures for gatsby-transformer-screenshot
5 participants