-
Notifications
You must be signed in to change notification settings - Fork 19
44 lines (43 loc) · 1.78 KB
/
dev.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
name: Deploy Dev
on:
workflow_dispatch:
inputs:
model_name:
required: true
description: Model supported by sentence-transformers such as intfloat/e5-large-v2, sentence-transformers/all-MiniLM-L6-v2, sentence-transformers/all-mpnet-base-v2
memory_size:
required: true
description: Memory size of the lambda function
normalize_embeddings:
description: Enabled normalize embeddings by specify any value, otherwise leave it blank
jobs:
deploy-dev:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup NodeJS 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Serverless Framework
run: npm install -g serverless
- name: Serverless AWS authentication
run: sls config credentials --provider aws --key ${{ secrets.AWS_KEY }} --secret ${{ secrets.AWS_SECRET }}
- name: Deploy Lambda functions
run: >
SERVICE=$(echo "${{ github.event.inputs.model_name }}" | cut -d'/' -f2)
MODEL=${{ github.event.inputs.model_name }}
MEMORY_SIZE=${{ github.event.inputs.memory_size }}
NORMALIZE_EMBEDDINGS=${{ github.event.inputs.normalize_embeddings }}
sls deploy
- name: Export Endpoint URL
run: >
echo $(SERVICE=$(echo "${{ github.event.inputs.model_name }}" | cut -d'/' -f2) MODEL= MEMORY_SIZE=128 NORMALIZE_EMBEDDINGS= sls info --verbose |
grep endpoint |
sed s/endpoint\:\ //g |
awk '{print $1}') > endpoint
- name: Echo Endpoint URL
run: echo $(cat endpoint)
- name: Test Lambda functions
run: "curl -X POST -H 'Content-Type: application/json' -d @text.json $(cat endpoint)v1/embeddings"