-
Notifications
You must be signed in to change notification settings - Fork 2
/
serverless.yml
56 lines (51 loc) · 1.12 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
service: predict-service
plugins:
- serverless-python-requirements
- serverless-dotenv-plugin
provider:
name: aws
runtime: python3.7
region: us-west-2
iamRoleStatements:
- Effect: Allow
Action:
- s3:GetObject
- s3:GetObjectAcl
Resource: "arn:aws:s3:::${self:custom.bucket}/*"
functions:
predict-brand:
handler: src/model/predict.handler
layers:
- {Ref: PythonRequirementsLambdaLayer}
package:
include:
- src/model/predict.py
- src/model/util.py
#Exclude the files in funtions
package:
individually: true
exclude:
- ./**
# AWS Lambda Layers using pythonRequirements plugin
custom:
bucket: ${env:BUCKET_NAME}
dotenv:
include:
- BUCKET_NAME
- MODEL_FILE_NAME
pythonRequirements:
slim: true
useDownloadCache: true
useStaticCache: true
dockerizePip: true
layer:
name: ${self:provider.stage}-python37
description: Python Requirements for prediction
compatibleRuntimes:
- python3.7
noDeploy:
- python-dotenv
- psycopg2-binary
- pandas
- docutils
- pytz