feat(infra): add support for autogenerate CI runners

Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
Aaron Pham
2024-06-11 09:27:09 -04:00
parent a5995a6bb8
commit eaf5dafca9
3 changed files with 49 additions and 22 deletions

View File

@@ -26,15 +26,17 @@ jobs:
- name: setup tooling
run: |
python -m pip install uv
uv pip install --system httpx
uv pip install --system httpx orjson
- name: startup machine
run: python tools/machines.py --start ${{ secrets.PAPERSPACE_MACHINE_ID }} || true
id: paperspace-machine
run: |
echo "$(python tools/machines.py --ci-template ${{secrets.PAPERSPACE_TEMPLATE_ID}})" >> $GITHUB_OUTPUT
- name: running regression tests (PR)
uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # ratchet:appleboy/ssh-action@v1.0.3
if: github.event_name == 'pull_request'
with:
host: ${{secrets.PAPERSPACE_HOST}}
username: ${{secrets.PAPERSPACE_USERNAME}}
host: ${{steps.outputs.paperspace-machine.outputs.publicIp}}
username: paperspace
key: ${{secrets.PAPERSPACE_SSH_KEY}}
port: ${{secrets.PAPERSPACE_PORT}}
script: /nix/var/nix/profiles/default/bin/nix run github:aarnphm/dix#openllm-ci --refresh -- --pr ${{github.event.number}}
@@ -42,11 +44,13 @@ jobs:
uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # ratchet:appleboy/ssh-action@v1.0.3
if: ${{ !github.event.repository.fork && github.event_name == 'push' }}
with:
host: ${{secrets.PAPERSPACE_HOST}}
username: ${{secrets.PAPERSPACE_USERNAME}}
host: ${{steps.outputs.paperspace-machine.outputs.ip}}
username: paperspace
key: ${{secrets.PAPERSPACE_SSH_KEY}}
port: ${{secrets.PAPERSPACE_PORT}}
script: /nix/var/nix/profiles/default/bin/nix run github:aarnphm/dix#openllm-ci --refresh -- --head
- name: shutdown machine
run: python tools/machines.py --delete ${{ steps.outputs.paperspace-machine.outputs.ip }}
evergreen: # https://github.com/marketplace/actions/alls-green#why
if: always()
needs: