Repository navigation
fix(raster): strip shared libraries from the bundle - #705
Open
chuckwondo wants to merge 1 commit into
Open
chuckwondo wants to merge 1 commit into
chuckwondo wants to merge 1 commit into
Conversation
Fail the build when the bundle exceeds Lambda's unzipped size limit. Closes #703
This branch was successfully deployed
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.
Closes #703
This PR strips every shared library in the raster bundle of symbols it does not need at run time, which shrinks the bundle from 245,733,512 bytes to 187,139,237. It also adds a last build step that fails when the bundle exceeds Lambda's 262,144,000-byte limit. The
predeployjob builds this image, so a dependency bump that pushes the bundle over the limit will fail its PR rather than the deploy.Unlike titiler's strip step, which #703 proposed copying, this one also strips numpy's OpenBLAS (
numpy.libs), which brings the bundle 0.9MB below #703's figure of 188,041,799 bytes. Titiler added that exclusion without giving a reason, and numpy's linear algebra still works with the library stripped.Testing
Build the image, then measure the bundle with the command from #703:
On 2026-11-26:
Then check that the stripped libraries still work: GDAL writes, reads, and reprojects a GeoTIFF, numpy inverts a matrix, and shapely buffers a point.