Skip to content

Commit

Permalink
chore(ci): test start-stop aws instance
Browse files Browse the repository at this point in the history
  • Loading branch information
soonum committed Nov 18, 2024
1 parent 801df0b commit d3ce537
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
39 changes: 37 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:
id: npm-ci-test
run: npm run ci-test

test-action:
name: GitHub Actions Test
test-action-spawn-terminate:
name: GitHub Actions Test (spawn -> terminate)
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -76,3 +76,38 @@ jobs:
slab-url: ${{ secrets.SLAB_BASE_URL_PRE_PROD }}
job-secret: ${{ secrets.JOB_SECRET }}
label: ${{ steps.test-start.outputs.label }}

test-action-start-stop:
name: GitHub Actions Test (start -> stop)
runs-on: ubuntu-latest
steps:
- name: Checkout
id: checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871

- name: Test start instance
id: test-start
uses: ./
with:
mode: start
github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
slab-url: ${{ secrets.SLAB_BASE_URL_PRE_PROD }}
job-secret: ${{ secrets.JOB_SECRET }}
backend: aws
profile: ci-test-start-stop

- name: Test runner is alive
uses: ./.github/workflows/registered_runner.yml
with:
runner-name: ci-persistent-runner

- name: Test stop instance
id: test-stop
if: ${{ always() }}
uses: ./
with:
mode: stop
github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
slab-url: ${{ secrets.SLAB_BASE_URL_PRE_PROD }}
job-secret: ${{ secrets.JOB_SECRET }}
label: ci-persistent-runner
18 changes: 18 additions & 0 deletions .github/workflows/registered_runner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test registered runner

on:
workflow_call:
inputs:
runner-name:
required: true
type: string

jobs:
test-runner:
name: Test Runner
runs-on: ${{ inputs.runner-name }}
timeout-minutes: 5 # Job should be picked very quickly
steps:
- name: Checkout
id: checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
7 changes: 7 additions & 0 deletions ci/slab.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ image_id = "ami-01d21b7be69801c2f" # Ubuntu 22.04
instance_type = "t3.2xlarge"
user = "ubuntu"

# This instance is a persistent one with a runner already registered
[backend.aws.ci-test-start-stop]
region = "eu-west-3"
image_id = "ami-01d21b7be69801c2f" # Ubuntu 22.04
instance_type = "t3.2xlarge"
instance_id = "i-042a592f53f5ab592"

[backend.hyperstack.ci-test]
environment_name = "canada"
image_name = "Ubuntu Server 22.04 LTS R535 CUDA 12.2"
Expand Down

0 comments on commit d3ce537

Please sign in to comment.