-
Notifications
You must be signed in to change notification settings - Fork 21
90 lines (81 loc) · 2.68 KB
/
aws.yaml
File metadata and controls
90 lines (81 loc) · 2.68 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
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
name: Run integration tests on GPU-enabled AWS image
on:
workflow_dispatch:
pull_request:
branches:
- "main"
defaults:
run:
shell: bash -l {0}
jobs:
start-aws-runner:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
outputs:
mapping: ${{ steps.aws-start.outputs.mapping }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::649715411074:role/gh-actions-runner-role
aws-region: us-east-1
- name: Create cloud runner
id: aws-start
uses: omsf/start-aws-gha-runner@v1.1.1
with:
aws_image_id: ami-0d5079d9be06933e5
aws_instance_type: g4dn.xlarge
aws_root_device_size: 125
aws_home_dir: /home/ubuntu
env:
GH_PAT: ${{ secrets.GH_PAT }}
self-hosted-test:
runs-on: self-hosted
timeout-minutes: 600 # 10 hours * 60 mins, also see the auto-shutdown step below for failsafe
needs:
- start-aws-runner
steps:
- uses: actions/checkout@v6
- name: Schedule auto-shutdown after 24 hours
# This is the failsafe if timeout-minutes above fails
# More info https://github.com/openforcefield/openff-evaluator/issues/740
run: nohup bash -c 'sleep 86400 && sudo shutdown -h now' > /tmp/auto-shutdown.log 2>&1 &
- name: Print disk usage
run: "df -h"
- name: Print Docker details
run: "docker version || true"
- name: Setup Conda Environment
uses: mamba-org/setup-micromamba@v3
with:
environment-file: devtools/conda-envs/test_env.yaml
- name: Install Package and test plugins
run: python -m pip install . utilities/test_plugins/
- name: Double-check local installation
run: python -c "from openff.evaluator import __version__; print(__version__)"
- name: Run integration tests
run: |
cd integration-tests/default-workflows/
python run.py
stop-aws-runner:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
needs:
- start-aws-runner
- self-hosted-test
if: ${{ always() }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::649715411074:role/gh-actions-runner-role
aws-region: us-east-1
- name: Stop instances
uses: omsf/stop-aws-gha-runner@v1.0.0
with:
instance_mapping: ${{ needs.start-aws-runner.outputs.mapping }}
env:
GH_PAT: ${{ secrets.GH_PAT }}