Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OMSF action for AWS self-hosted runner #744

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .github/workflows/gpu-runner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Self-Hosted Runner
on:
workflow_dispatch:

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@v4
with:
role-to-assume: arn:aws:iam::009563297724:role/gha-runner-omsf
aws-region: us-east-1
- name: Create cloud runner
id: aws-start
uses: omsf-eco-infra/[email protected]
with:
provider: "aws"
action: "start"
aws_image_id: ami-053912f3a44543f8c
aws_instance_type: g4dn.xlarge
aws_region_name: us-east-1
aws_home_dir: /home/ubuntu
env:
GH_PAT: ${{ secrets.GH_PAT }}

self-hosted-test:
runs-on: self-hosted
timeout-minutes: 720 # 12 hours
defaults:
run:
shell: bash -leo pipefail {0}
env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt

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"

- name: "Setup Micromamba"
uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/test_env.yaml
environment-name: openfe_env

- name: "Check if OpenMM can get a GPU"
run: python -m openmm.testInstallation

- name: "Install"
run: python -m pip install --no-deps -e .

- name: "Environment Information"
run: |
micromamba info
micromamba list
pip list

- name: Test OE License & Write License to File
env:
OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }}
run: |
echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE}
python -c "import openeye; assert openeye.oechem.OEChemIsLicensed(), 'OpenEye license checks failed!'"

- name: "Run tests"
run: |
pytest -n 4 -v --durations=10 --cov=openmmtools --cov-report=term

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@v4
with:
role-to-assume: arn:aws:iam::009563297724:role/gha-runner-omsf
aws-region: us-east-1
- name: Stop instances
uses: omsf-eco-infra/[email protected]
with:
provider: "aws"
action: "stop"
instance_mapping: ${{ needs.start-aws-runner.outputs.mapping }}
aws_region_name: us-east-1
env:
GH_PAT: ${{ secrets.GH_PAT }}
130 changes: 0 additions & 130 deletions .github/workflows/self-hosted-gpu-test.yml

This file was deleted.

Loading