Skip to content

Inference test

Inference test #20

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