-
Notifications
You must be signed in to change notification settings - Fork 142
81 lines (77 loc) · 2.59 KB
/
performance.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Performance test
on:
workflow_dispatch:
jobs:
start-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.PAT }}
ec2-image-id: ami-04cd9fec4a7a39019
ec2-instance-type: c5.9xlarge
subnet-id: subnet-72d3e53e
security-group-id: sg-06b0c93122c08aeab
test:
name: Performance test
needs: start-runner
runs-on: ${{ needs.start-runner.outputs.label }}
strategy:
matrix:
tag: ["gnu", "intel"]
container: ghcr.io/deepmodeling/abacus-${{ matrix.tag }}
timeout-minutes: 2880
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Requirements
run: |
apt install -y time
- name: Build
run: |
cmake -B build -DENABLE_LIBXC=ON
cmake --build build -j`nproc`
cmake --install build
- name: Test
run: |
test -e /opt/intel/oneapi/setvars.sh && . /opt/intel/oneapi/setvars.sh
cd tests/performance/
bash run.sh
- name: Show Result
if: always()
run: |
cat tests/performance/sumall.dat
stop-runner:
name: Stop self-hosted EC2 runner
needs:
- start-runner # required to get output from the start-runner job
- test # required to wait when the main job is done
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.PAT }}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}