Run performance comparisons #154
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cli command to run this from repo | |
# given a run, get output (link?) | |
# input variable to CLI to allow users to specify where to output their artefacts | |
name: Run performance comparisons | |
on: | |
workflow_dispatch: | |
inputs: | |
c1: | |
description: First commit hash | |
required: true | |
jobs: | |
build: | |
runs-on: buildjet-8vcpu-ubuntu-2204 | |
strategy: | |
fail-fast: true | |
matrix: | |
commit: | |
- ${{ github.event.inputs.c1 }} | |
timeout-minutes: 15 # Remove for ssh debugging | |
permissions: | |
id-token: write | |
contents: read | |
outputs: | |
wheel: ${{ steps.build-commit.outputs.wheel }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ matrix.commit }} | |
- uses: ./.github/workflows/build-commit.yaml | |
id: build-commit | |
with: | |
commit: ${{ matrix.commit }} | |
aws_role_arn: ${{ secrets.ACTIONS_AWS_ROLE_ARN }} | |
run: | |
needs: build | |
runs-on: [self-hosted, linux, x64, ci-dev] | |
strategy: | |
fail-fast: true | |
matrix: | |
commit: | |
- ${{ github.event.inputs.c1 }} | |
timeout-minutes: 15 # Remove for ssh debugging | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Checkout commit ${{ matrix.commit }} | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ matrix.commit }} | |
- name: Assume AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: us-west-2 | |
- uses: ./.github/actions/install | |
- name: Modify ray.yaml to contain runtime variables | |
run: | | |
sed -i 's|<<SHA>>|${{ github.sha }}|g' .github/assets/ray.yaml | |
sed -i 's|<<COMMIT>>|${{ matrix.commit }}|g' .github/assets/ray.yaml | |
sed -i 's|<<WHEEL>>|${{ needs.build.outputs.wheel }}|g' .github/assets/ray.yaml | |
- name: Write ssh-key to file | |
run: | | |
KEY=$(aws secretsmanager get-secret-value --secret-id ci-github-actions-ray-cluster-key-3 --query SecretString --output text) | |
echo "$KEY" >> ~/.ssh/ci-github-actions-ray-cluster-key.pem | |
chmod 600 ~/.ssh/ci-github-actions-ray-cluster-key.pem | |
- name: Spin up ray cluster | |
run: | | |
uv v | |
source .venv/bin/activate | |
uv pip install ray[default] boto3 | |
ray up .github/assets/ray.yaml -y | |
HEAD_NODE_IP=$(ray get-head-ip .github/assets/ray.yaml | tail -n 1) | |
ssh -o StrictHostKeyChecking=no -fN -L 8265:localhost:8265 -i ~/.ssh/ci-github-actions-ray-cluster-key.pem ubuntu@$HEAD_NODE_IP | |
ray job submit --working-dir .github/working_dir --address http://localhost:8265 -- python test.py | |
ray down .github/assets/ray.yaml -y |