-
Notifications
You must be signed in to change notification settings - Fork 615
157 lines (140 loc) · 4.95 KB
/
deeplake-benchmark.yaml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Deep Lake benchmarks
permissions:
id-token: write
contents: read
pull-requests: 'write'
on:
schedule:
- cron: '0 6 * * 6'
push:
branches:
- "release/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
remove_label:
name: Remove run-benchmarks label
if: github.event_name == 'pull_request' && github.event.label.name == 'run-benchmarks'
runs-on: ubuntu-latest
steps:
- name: Remove run-benchmarks label
continue-on-error: true
uses: actions-ecosystem/action-remove-labels@v1.3.0
with:
labels: run-benchmarks
start-ec2:
name: Start benchmarks ec2
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.label.name == 'run-benchmarks')
runs-on: ubuntu-latest
steps:
- name: checkout
if: vars.BENCHMARKS_DEFAULT_RUNNERS_TYPE == 'self-hosted-ec2'
uses: actions/checkout@v3
with:
repository: ${{ secrets.BENCHMARKS_REPO }}
path: "benchmarks"
ref: "main"
token: ${{ secrets.BENCHMARK_REPO_TOKEN }}
- name: checkout
if: vars.BENCHMARKS_DEFAULT_RUNNERS_TYPE == 'self-hosted-ec2'
uses: actions/checkout@v3
with:
repository: ${{ secrets.BENCHMARKS_REPO }}
path: "benchmarks"
ref: "main"
token: ${{ secrets.BENCHMARK_REPO_TOKEN }}
- uses: aws-actions/configure-aws-credentials@v1-node16
if: vars.BENCHMARKS_DEFAULT_RUNNERS_TYPE == 'self-hosted-ec2'
with:
role-to-assume: ${{ secrets.BENCHMARKS_AWS_ROLE_ARN }}
aws-region: us-east-1
- name: start ec2
if: vars.BENCHMARKS_DEFAULT_RUNNERS_TYPE == 'self-hosted-ec2'
working-directory: benchmarks/scripts
shell: bash
run: |
pip install -q boto3
readarray -t machines_list <<< "$( echo -e 'for i in ${{ vars.BENCHMARK_DEFAULT_MACHINES }}:\n if "linux" in i:\n print(i)' | python3)"
for i in "${machines_list[@]}"
do
python3 ec2.py start -t "$i"
done
benchmark:
name: Run Benchmarks
needs: start-ec2
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.label.name == 'run-benchmarks')
runs-on: benchmarks_${{ matrix.machine }}
timeout-minutes: 720
strategy:
fail-fast: false
matrix:
machine: ${{ fromJSON(vars.BENCHMARK_DEFAULT_MACHINES) }}
steps:
- name: Configure AWS credentials
if: matrix.machine == 'macos_intel'
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: ${{ secrets.BENCHMARKS_AWS_ROLE_ARN }}
aws-region: us-east-1
role-duration-seconds: 14400
- name: pull deeplake
uses: actions/checkout@v3
with:
path: "deeplake"
- name: pull benchmarks
uses: actions/checkout@v3
with:
repository: ${{ secrets.BENCHMARKS_REPO }}
path: "benchmarks"
ref: "main"
token: ${{ secrets.BENCHMARK_REPO_TOKEN }}
- name: pull reports
uses: actions/checkout@v3
with:
repository: ${{ secrets.BENCHMARK_REPORT }}
path: "reports"
ref: "main"
token: ${{ secrets.BENCHMARK_REPO_TOKEN }}
- name: run benchmarks
shell: bash
continue-on-error: true
working-directory: ./benchmarks
env:
DEEPLAKE_USER: ${{ secrets.BENCHMARKS_DEEPLAKE_USERNAME}}
DEEPLAKE_PASS: ${{ secrets.BENCHMARKS_DEEPLAKE_PASSWORD }}
DEEPLAKE_PATH: '../deeplake'
REPORTS_PATH: '../reports'
NODE: ${{ matrix.machine }}
PR_NUMBER: ${{ github.event.number }}
BENCHMARKS_THRESHOLD: ${{ vars.BENCHMARKS_THRESHOLD }}
run: |
bash benchmarks.sh ${{ matrix.machine }}
- name: comment pr
continue-on-error: true
if: github.event_name == 'pull_request'
uses: thollander/actions-comment-pull-request@v2
with:
filePath: ./benchmarks/report.md
comment_tag: ${{ matrix.machine }}
- name: complete
continue-on-error: true
shell: bash
env:
BENCHMARK_TYPE: 'default'
MACHINE: ${{ matrix.machine }}
URL: ${{ secrets.SLACK_URL }}
PR_NUMBER: ${{ github.event.number }}
working-directory: ./benchmarks
run: |
bash scripts/complete_benchmark.sh
if [ "{{ vars.BENCHMARKS_DEFAULT_RUNNERS_TYPE }}" == 'self-hosted-ec2' ]
then
echo bash "$(pwd)/scripts/self_stop_ec2.sh" | at now +2 minutes
fi
- name: stop ec2
if: vars.BENCHMARKS_DEFAULT_RUNNERS_TYPE == 'self-hosted-ec2' && cancelled()
working-directory: ./benchmarks
shell: bash
run: |
echo bash "$(pwd)/scripts/self_stop_ec2.sh" | at now +2 minutes