forked from ivy-llc/ivy
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (92 loc) · 3.19 KB
/
test-ivy-cron-gpu.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: test-ivy-cron-gpu
on:
workflow_dispatch:
schedule:
- cron: '25 * * * *'
permissions:
actions: read
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
start-vm:
runs-on: ubuntu-latest
if: always() # Run this job always, regardless of the status of run-test-basics
steps:
- name: Checkout Demos🛎
uses: actions/checkout@v4
with:
repository: unifyai/demos
path: demos
persist-credentials: false
submodules: "recursive"
fetch-depth: 1
- name: Install clients for GCP/Mongo
run: |
pip3 install pymongo google-api-python-client paramiko
- name: Start GPU VM
run: |
cd demos/tests/auth
mkdir -p ~/.ssh
touch ~/.ssh/id_rsa
echo -n "${{ secrets.GPU_SSH_KEY }}" > ~/.ssh/id_rsa
chmod +x ~/.ssh/id_rsa
python3 db_auth.py ${{ secrets.GPU_DB_ENDPOINT }} ${{ secrets.GPU_DB_OBJ_ID }}
python3 vm_auth.py ${{ secrets.GPU_SSH_USERNAME }} ${{ secrets.GPU_SSH_PASSPHRASE }} "false" "ivy-repo-gpu-testing"
run-gpu-tests:
needs: start-vm
runs-on: self-hosted
steps:
- name: Clean Repository
run:
sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE
- name: Checkout 🛎️Ivy
uses: actions/checkout@v2
with:
path: ivy
persist-credentials: false
submodules: "recursive"
fetch-depth: 2
- name: Install ivy and fetch binaries
run: |
cd ivy
export TAG="cp310-cp310-manylinux_2_17_x86_64"
sudo pip3 install -e .
mkdir .ivy
touch .ivy/key.pem
echo -n ${{ secrets.USER_API_KEY }} > .ivy/key.pem
cd ..
- name: Get Job URL
uses: Tiryoh/gha-jobid-action@v0
id: jobs
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: ${{ github.job }}
- name: Run Tests
id: tests
run: |
pip3 install pymongo
cd ivy
python3 scripts/setup_tests/cron_tests.py ${{ github.run_number }} true false
python3 scripts/run_tests/run_tests.py ${{ secrets.REDIS_CONNECTION_URL }} ${{ secrets.REDIS_PASSWORD }} ${{ secrets.MONGODB_PASSWORD }} 'false' 'true' ${{ github.run_id }} 'false' 'false' ${{ steps.jobs.outputs.html_url }}
stop-vm:
needs: run-gpu-tests
runs-on: ubuntu-latest
if: always() # Run this job always, regardless of the status of run-test
steps:
- name: Checkout Demos🛎
uses: actions/checkout@v4
with:
repository: unifyai/demos
path: demos
persist-credentials: false
submodules: "recursive"
fetch-depth: 1
- name: Install clients for GCP/Mongo
run: |
pip3 install pymongo google-api-python-client paramiko
- name: Stop GPU VM
run: |
cd demos/tests/auth
python3 db_auth.py ${{ secrets.GPU_DB_ENDPOINT }} ${{ secrets.GPU_DB_OBJ_ID }}
python3 vm_auth.py ${{ secrets.GPU_SSH_USERNAME }} ${{ secrets.GPU_SSH_PASSPHRASE }} "true" "ivy-repo-gpu-testing"