Skip to content

Commit

Permalink
add image processing layers
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjawalpoudel committed Jan 24, 2022
1 parent e767a8a commit acd34dd
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ To deploy this project run

**Package for Mongoengine**
```bash
pip install -r layers/tools/mongoengine.txt -t layers/tools/mongoengine/python/lib/python3.7/site-packages/ --upgrade
pip install -r layers/tools/mongoengine.txt -t layers/tools/mongoengine/python/lib/python3.8/site-packages/ --upgrade
```

After deployed, you can access this layes using following name:
**Package for Image Pocessing**
```bash
${self:provider.stage}MongoengineLambdaLayer
pip install -r layers/tools/image-processing.txt -t layers/tools/image-processing/python/lib/python3.8/site-packages/ --upgrade
```
5 changes: 0 additions & 5 deletions layer.yml

This file was deleted.

2 changes: 2 additions & 0 deletions layers/tools/image-processing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
requests==2.27.1
Pillow==9.0.0
1 change: 1 addition & 0 deletions layers/tools/mongoengine.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ mongoengine==0.23.1
dnspython==2.1.0
pydantic==1.9.0
mongoengine-goodjson==1.1.8

30 changes: 17 additions & 13 deletions serverless.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
service: aws-layers-demo
service: tbd-layers-sandbox

frameworkVersion: '2'

custom:
defaultStage: dev
project: demo-project
project: tbd
developer: Ujjawal Poudel
team: demo-team
team: tbd-backend


provider:
name: aws
runtime: python3.7
profile: demoProfile
runtime: python3.8
profile: sandbox
region: ap-south-1
logRetentionInDays: 1
lambdaHashingVersion: 20201221 # optional, version of hashing algorithm that should be used by the framework
stage: ${opt:stage, self:custom.defaultStage}
deploymentBucket:
blockPublicAccess: true
name: ${self:service}
name: sandbox-tbd-backend-dev
maxPreviousDeploymentArtifacts: 10
stackTags: # Optional CF stack tags
btlTeam: ${self:custom.team}
btlDeveloper: ${self:custom.developer}
btlProject: ${self:custom.project}

plugins:
- serverless-deployment-bucket

layers:
Mongoengine:
path: layers/tools/mongoengine
name: ${self:service}-${self:provider.stage}-mongoengine
description: "Lambda layer for python 3.7 for mongoengine"
description: "Lambda layer for python 3.8 for mongoengine"
compatibleRuntimes:
- python3.7
- python3.8
retain: false

resources:
- ${file(layer.yml)}
ImageProcessing:
path: layers/tools/image-processing
name: ${self:service}-${self:provider.stage}-image-processing
description: "Lambda layer for python 3.8 for image-processing"
compatibleRuntimes:
- python3.8
retain: false


0 comments on commit acd34dd

Please sign in to comment.