Skip to content

Commit

Permalink
fix lambda packaging (#12)
Browse files Browse the repository at this point in the history
* remove a step from the lambda zip cleanup that was mangling filenames
* add explicit architecture params to lambda package so running the script from an arm macbook will still work when targeting an amd64 lambda
* update changelog
  • Loading branch information
bick4ord authored Aug 15, 2023
1 parent c40d19b commit 163ae76
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release Notes

## 0.12.0-1.0.0 (2023-08-15)

* introduce new split versioning scheme that represents the upstream titiler version (v0.12.0) and the mosaic version (1.0.0)
* fix broken packaging in lambda zip file introduced from upgrading to python 3.10

## 0.12.0 (2023-07-17)

* use `Annotated` Type for Query/Path parameters
Expand Down
9 changes: 6 additions & 3 deletions build-lambda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ pip install --upgrade pip
# https://github.com/aws/aws-sam-cli/issues/3661#issuecomment-1044340547

python -m pip install \
--no-cache-dir --upgrade \
--no-cache-dir \
--platform manylinux2014_x86_64 \
--implementation cp \
--only-binary=:all: \
--upgrade \
--target=./lambda/ \
./src/titiler/core \
./src/titiler/extensions["cogeo,stac"] \
Expand All @@ -29,9 +33,8 @@ python -m pip install \
cd lambda

echo "cleaning up..."
find . -type f -name '*.pyc' | while read f; do n=$(echo $f | sed 's/__pycache__\///' | sed 's/.cpython-[2-3][0-9]//'); cp $f $n; done;
find . -type d -a -name '*.dist-info' -print0 | xargs -0 rm -rf
find . -type d -a -name '__pycache__' -print0 | xargs -0 rm -rf
find . -type f -a -name '*.py' -print0 | xargs -0 rm -f
find . -type d -a -name 'tests' -print0 | xargs -0 rm -rf

echo "copying handler..."
Expand Down

0 comments on commit 163ae76

Please sign in to comment.