Maintenance: Fork wkhtmltopdf to remove unneeded binaries and reduce slug size - #2804
Merged
Merged
Conversation
Contributor
Author
|
selfie |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Heroku has a slug size limit, and we ran into it a few weeks ago. I figured it was from checking in large image assets related to reading, but turns out it was also driven by updating the
wkhtmltopdf-binarygem.That gem bundles up binaries for
wkhtmltopdfon different platforms, and in that release it increased its coverage for more OS versions, which meant the size of the gem increased ~5x to almost 300MB, which is already at the soft limit for slug size just on its own. On a dyno:This PR adds comments to that issue upstream in the Gemfile, and swaps to a fork of the gem that limits the binaries to only Ubuntu 18 and OSX, which is all we need for this project. That lets us keep the same developer setup and not add any other config complexity, while reducing the slug size by ~250MB of inert bytes, so we can deploy again.
For posterity, I also tried dropping in
rposborne/wkhtmltopdf-herokubut it didn't just work, so instead of investigating that I switched to forking.