-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (58 loc) · 1.78 KB
/
Copy pathinference-test.yaml
File metadata and controls
59 lines (58 loc) · 1.78 KB
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
name: Inference test
on:
workflow_dispatch:
jobs:
start-aws-runner:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
outputs:
mapping: ${{ steps.aws-start.outputs.mapping }}
instances: ${{ steps.aws-start.outputs.instances }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::730335439009:role/gha-runner-deploy
aws-region: us-east-1
- name: Create cloud runner
id: aws-start
uses: omsf/start-aws-gha-runner@main
with:
aws_image_id: ami-0f7c4a792e3fb63c8
aws_root_device_size: 125
aws_instance_type: g4dn.xlarge
aws_home_dir: /home/ubuntu
aws_tags: '["gha-runner"]'
env:
GH_PAT: ${{ secrets.GH_PAT }}
inference-test:
runs-on: ${{ fromJSON(needs.start-aws-runner.outputs.instances) }}
defaults:
run:
shell: bash -leo pipefail {0}
needs:
- start-aws-runner
steps:
- name: Checkout scripts
uses: actions/checkout@v4
with:
sparse-checkout: |
inference-test
repository: omsf-eco-infra/ci-scripts
path: ci-scripts
- name: Print disk usage
run: "df -h"
- name: Print Docker details
run: "docker version || true"
- name: Check for nvidia-smi
run: "nvidia-smi || true"
- uses: mamba-org/setup-micromamba@main
with:
environment-file: ci-scripts/inference-test/environment.yml
- name: Test for pytorch
run: python -c "import torch; assert torch.cuda.is_available()"
- name: Test for GPU
id: gpu_test
run: python ci-scripts/inference-test/inference.py