-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from geospatial-jeff/dev
Lambda Layers
- Loading branch information
Showing
36 changed files
with
671 additions
and
183 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM lambci/lambda:build-python3.6 | ||
|
||
|
||
# Installing system libraries | ||
RUN \ | ||
yum install -y wget; \ | ||
yum install -y geos-devel; \ | ||
yum clean all; \ | ||
yum autoremove; | ||
|
||
|
||
# Paths | ||
ENV \ | ||
PREFIX=/usr/local \ | ||
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 | ||
|
||
# Switch to build directory | ||
WORKDIR /build | ||
|
||
# Installing cognition-datasources + requirements | ||
COPY requirements-dev.txt ./ | ||
|
||
RUN \ | ||
pip install -r requirements-dev.txt; \ | ||
pip install git+https://github.com/geospatial-jeff/cognition-datasources.git | ||
|
||
|
||
|
||
# Copy shell scripts | ||
COPY bin/* /usr/local/bin/ | ||
|
||
WORKDIR /home/cognition-datasources |
This file was deleted.
Oops, something went wrong.
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,26 @@ | ||
#!/bin/bash | ||
|
||
# Directory used for deployment | ||
export DEPLOY_DIR=layer | ||
|
||
mkdir $DEPLOY_DIR | ||
|
||
PYPATH=/var/lang/lib/python3.6/site-packages | ||
|
||
|
||
echo Creating deployment package for cognition-datasources | ||
|
||
# Moving python libraries | ||
mkdir $DEPLOY_DIR/python | ||
EXCLUDE="shapely* stac_validator* s3transfer* boto3* botocore* pip* docutils* *.pyc setuptools* wheel* coverage* testfixtures* mock* *.egg-info *.dist-info __pycache__ easy_install.py" | ||
|
||
EXCLUDES=() | ||
for E in ${EXCLUDE} | ||
do | ||
EXCLUDES+=("--exclude ${E} ") | ||
done | ||
|
||
rsync -ax $PYPATH/ $DEPLOY_DIR/python/ ${EXCLUDES[@]} | ||
|
||
cd $DEPLOY_DIR | ||
zip -ruq ../lambda-layer.zip ./ |
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,12 @@ | ||
#!/bin/bash | ||
|
||
# Directory used for deployment | ||
export DEPLOY_DIR=service | ||
|
||
mkdir $DEPLOY_DIR | ||
|
||
# Moving handler | ||
cp handler.py $DEPLOY_DIR | ||
|
||
cd $DEPLOY_DIR | ||
zip -ruq ../lambda-service-package.zip ./ |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
from .manifest import Manifest | ||
|
||
|
||
layer_arn = 'arn:aws:lambda:us-east-1:725820063953:layer:cognition-datasources:6' |
Oops, something went wrong.