forked from DefiLlama/yield-ml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
60 lines (55 loc) · 1.48 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
56
57
58
59
60
service: llama-apy-prediction
frameworkVersion: "3"
provider:
name: aws
runtime: python3.8
stage: dev
region: eu-central-1
tracing:
apiGateway: true
lambda: true
# needs to be >=256, otherwise blas error on joblib.load
memorySize: 1024
iam:
role:
statements:
# for reading the joblib object
- Effect: Allow
Action:
- s3:ListBucket
- s3:*Object*
Resource: "*"
- Effect: Allow
Action:
- ssm:GetParameter
- ssm:DescribeParameters
- kms:Decrypt
Resource: "*"
functions:
getPredictions:
handler: src/getPredictions.handler
description: Lambda for calling trained random forest model
timeout: 20
events:
- httpApi:
method: post
path: /predictions
layers:
# adding this manually cause lamba layer deployment via manual process
- arn:aws:lambda:eu-central-1:856461987125:layer:yield-ml-2022-05-20:1
checkFeatureDrift:
handler: src/checkFeatureDrift.handler
description: Lambda for checking for potential feature drift btw reference and current data
timeout: 30
layers:
- arn:aws:lambda:eu-central-1:856461987125:layer:yield-ml-2022-05-20:1
events:
# every hour at 30 past
- schedule: cron(30 * * * ? *)
package:
patterns:
# first exclude everything
- "!*/**"
# then add just the handler func
- src/getPredictions.py
- src/checkFeatureDrift.py