Skip to content

Commit

Permalink
Bring up all runners in parallel with a single Lambda call
Browse files Browse the repository at this point in the history
  • Loading branch information
rocallahan committed Jun 7, 2024
1 parent 7a36217 commit 75702ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/build-and-test-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,30 @@ jobs:
if: github.repository == 'rr-debugger/rr'
steps:
- id: generate
name: Generate runner ID
name: Generate runner label
run: |
RUNNER_ID=rr_runner_$(uuidgen|tr -d -)
echo "RUNNER_ID=$RUNNER_ID" >> "$GITHUB_OUTPUT"
- name: Start x86-64 runner
RUNNER_LABEL=rr_runner_$(uuidgen|tr -d -)
echo "RUNNER_LABEL=$RUNNER_LABEL" >> "$GITHUB_OUTPUT"
- name: Start runners
run: |2-
curl --fail -s -X POST -H "Content-Type: application/json" --data "{\"operation\": \"create\", \"architecture\":\"x86_64\", \"label\": \"${{ steps.generate.outputs.RUNNER_ID }}_x86_64\"}" https://gztdxwrnjh46z4ucjge5m4pxhu0vtfzs.lambda-url.us-east-2.on.aws
- name: Start arm64 runner
run: |2-
curl --fail -s -X POST -H "Content-Type: application/json" --data "{\"operation\": \"create\", \"architecture\":\"arm64\", \"label\": \"${{ steps.generate.outputs.RUNNER_ID }}_arm64\"}" https://gztdxwrnjh46z4ucjge5m4pxhu0vtfzs.lambda-url.us-east-2.on.aws
curl --fail -s -X POST -H "Content-Type: application/json" --data "{\"operation\": \"create\", \"architectures\":[\"x86_64\", \"arm64\"], \"label\": \"${{ steps.generate.outputs.RUNNER_LABEL }}\"}" https://bqugdqmvcql6yvz4i362qohyea0namsk.lambda-url.us-east-2.on.aws
outputs:
RUNNER_ID: ${{ steps.generate.outputs.RUNNER_ID }}
RUNNER_LABEL: ${{ steps.generate.outputs.RUNNER_LABEL }}

x86-64:
uses: ./.github/workflows/build-and-test.yml
needs: setup
if: github.repository == 'rr-debugger/rr'
with:
runner_id: ${{ needs.setup.outputs.RUNNER_ID }}_x86_64
label: ${{ needs.setup.outputs.RUNNER_LABEL }}
architecture: x86_64

arm64:
uses: ./.github/workflows/build-and-test.yml
needs: setup
if: github.repository == 'rr-debugger/rr'
with:
runner_id: ${{ needs.setup.outputs.RUNNER_ID }}_arm64
label: ${{ needs.setup.outputs.RUNNER_LABEL }}
architecture: arm64

stop-runners:
Expand All @@ -49,4 +46,4 @@ jobs:
steps:
- name: "Stop runners"
run: |2-
curl --fail -s -X POST -H "Content-Type: application/json" --data "{\"operation\": \"destroy\", \"labels\": [\"${{ needs.setup.outputs.RUNNER_ID }}_x86_64\", \"${{ needs.setup.outputs.RUNNER_ID }}_arm64\"]}" https://gztdxwrnjh46z4ucjge5m4pxhu0vtfzs.lambda-url.us-east-2.on.aws
curl --fail -s -X POST -H "Content-Type: application/json" --data "{\"operation\": \"destroy\", \"label\": \"${{ needs.setup.outputs.RUNNER_ID }}\"}" https://bqugdqmvcql6yvz4i362qohyea0namsk.lambda-url.us-east-2.on.aws
5 changes: 3 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and test on runner
on:
workflow_call:
inputs:
runner_id:
label:
required: true
type: string
architecture:
Expand All @@ -14,7 +14,8 @@ jobs:
build-and-test:
name: On runner
runs-on:
- ${{ inputs.runner_id }}
- ${{ inputs.label }}
- arch_${{ inputs.architecture }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down

0 comments on commit 75702ea

Please sign in to comment.