-
Notifications
You must be signed in to change notification settings - Fork 3
80 lines (78 loc) · 2.25 KB
/
reusable-gpu-test.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
name: Reusable OpenMM GPU Test
on:
workflow_call:
inputs:
instance_type: # The EC2 instance type needed
required: true
type: string
jobs:
start-aws-runner:
runs-on: ubuntu-latest
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: ${{ secrets.AWS_ROLE }}
aws-region: us-east-1
- name: Create cloud runner
id: aws-start
uses: omsf-eco-infra/gha-runner@main
with:
provider: "aws"
action: "start"
aws_region_name: us-east-1
aws_image_id: ami-0f7c4a792e3fb63c8
aws_instance_type: ${{ inputs.instance_type }}
aws_home_dir: /home/ubuntu
env:
GH_PAT: ${{ secrets.GH_PAT }}
openmm-test:
runs-on: ${{ fromJSON(needs.start-aws-runner.outputs.instances) }}
defaults:
run:
shell: bash -leo pipefail {0}
needs:
- start-aws-runner
steps:
- uses: actions/checkout@v4
- 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-name: openmm
create-args: >-
openmm
condarc: |
channels:
- conda-forge
- name: Test for GPU
id: gpu_test
run: python -m openmm.testInstallation
stop-aws-runner:
runs-on: ubuntu-latest
needs:
- start-aws-runner
- openmm-test
if: ${{ always() }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE }}
aws-region: us-east-1
- name: Stop instances
uses: omsf-eco-infra/gha-runner@main
with:
provider: "aws"
action: "stop"
aws_region_name: us-east-1
instance_mapping: ${{ needs.start-aws-runner.outputs.mapping }}
env:
GH_PAT: ${{ secrets.GH_PAT }}