Skip to content

Commit

Permalink
Merge pull request #906 from OpenFreeEnergy/gha-gpu-runner
Browse files Browse the repository at this point in the history
Create gpu-runner.yaml
  • Loading branch information
IAlibay authored Jul 25, 2024
2 parents 7615ccc + d4a2361 commit f6a3f8f
Showing 1 changed file with 102 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/gpu-runner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Test 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::010438489691:role/GHARunnerAWS
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-0f7c4a792e3fb63c8
aws_instance_type: c4.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
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: "Setup Micromamba"
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-name: openfe_env
create-args: >-
python="3.12"
pydantic=">1"
init-shell: bash

- name: "Install GUFE from main@HEAD"
run: python -m pip install --no-deps git+https://github.com/OpenFreeEnergy/gufe@main

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

- name: "Test imports"
run: |
# if we add more to this, consider changing to for + env vars
python -Ic "import openfe; print(openfe.__version__)"
- name: "Environment Information"
run: |
micromamba info
micromamba list
pip list
- name: "Run tests"
env:
# Set the OFE_SLOW_TESTS to True if running a Cron job
OFE_SLOW_TESTS: "true"
DUECREDIT_ENABLE: 'yes'
run: |
pytest -n auto -v --cov=openfe --cov=openfecli --cov-report=xml --durations=10
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::010438489691:role/GHARunnerAWS
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 }}

0 comments on commit f6a3f8f

Please sign in to comment.