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 aa34bdc
Show file tree
Hide file tree
Showing 3 changed files with 14 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_LABEL }}\"}" 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
2 changes: 2 additions & 0 deletions scripts/github-actions-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ if [ $MACHINE_TYPE == 'x86_64' ]; then
EXTRA_PACKAGES=g++-multilib
fi

sudo apt-get update -y
sudo apt-get dist-upgrade -f -y
sudo apt-get install -y $EXTRA_PACKAGES cmake g++ pkg-config zlib1g-dev git python-dev-is-python3 libacl1-dev ninja-build manpages-dev capnproto libcapnp-dev gdb lldb python3-pexpect libzstd1 libzstd-dev

mkdir obj
Expand Down

0 comments on commit aa34bdc

Please sign in to comment.