Skip to content

Commit

Permalink
feat: run multidim-interop.yml on self-hosted runners (#154)
Browse files Browse the repository at this point in the history
* feat: run multidim-interop.yml on self-hosted runners

* feat: make worker count configurable

* feat: enable docker.io proxy on self-hosted runners

* chore: provide s3 creds through env

* Try 4 workers

* ci: run-multidim-interop on 16 workers

* chore: change self hosted labels

* Update .github/workflows/multidim-interop.yml

Co-authored-by: Piotr Galar <piotr.galar@gmail.com>

* Use self-hosted runners for now

This reverts commit 7e868ea.

---------

Co-authored-by: Marco Munizaga <git@marcopolo.io>
Co-authored-by: Marco Munizaga <marco@marcopolo.io>
  • Loading branch information
3 people authored Jul 7, 2023
1 parent 22c7e58 commit 35ab35b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
44 changes: 28 additions & 16 deletions .github/actions/run-interop-ping-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,23 @@ inputs:
description: "Which AWS region to use"
required: false
default: "us-east-1"
worker-count:
description: "How many workers to use for the test"
required: false
default: "2"
runs:
using: "composite"
steps:
- if: inputs.s3-access-key-id != '' && inputs.s3-secret-access-key != ''
run: |
echo "AWS_BUCKET=${{ inputs.s3-cache-bucket }}" >> $GITHUB_ENV
echo "AWS_REGION=${{ inputs.aws-region }}" >> $GITHUB_ENV
shell: bash

- name: Configure AWS credentials for S3 build cache
if: inputs.s3-access-key-id != '' && inputs.s3-secret-access-key != ''
run: |
echo "PUSH_CACHE=true" >> $GITHUB_ENV
shell: bash

- name: Configure AWS credentials for S3 build cache
if: inputs.s3-access-key-id != '' && inputs.s3-secret-access-key != ''
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ inputs.s3-access-key-id }}
aws-secret-access-key: ${{ inputs.s3-secret-access-key}}
aws-region: ${{ env.AWS_REGION }}

# This depends on where this file is within this repository. This walks up
# from here to the multidim-interop folder
- run: |
WORK_DIR=$(realpath "${{ github.action_path }}/../../../multidim-interop")
WORK_DIR=$(realpath "$GITHUB_ACTION_PATH/../../../multidim-interop")
echo "WORK_DIR=$WORK_DIR" >> $GITHUB_OUTPUT
shell: bash
id: find-workdir
Expand All @@ -60,9 +50,22 @@ runs:
with:
node-version: 18

# Existence of /etc/buildkit/buildkitd.toml indicates that this is a
# self-hosted runner. If so, we need to pass the config to the buildx
# action. The config enables docker.io proxy which is required to
# work around docker hub rate limiting.
- run: |
if test -f /etc/buildkit/buildkitd.toml; then
echo "config=/etc/buildkit/buildkitd.toml" >> $GITHUB_OUTPUT
fi
shell: bash
id: buildkit
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
config: ${{ steps.buildkit.outputs.config }}

- name: Install deps
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
Expand All @@ -77,12 +80,21 @@ runs:
- name: Push the image cache
if: env.PUSH_CACHE == 'true'
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
env:
AWS_BUCKET: ${{ inputs.s3-cache-bucket }}
AWS_REGION: ${{ inputs.aws-region }}
AWS_ACCESS_KEY_ID: ${{ inputs.s3-access-key-id }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.s3-secret-access-key }}
run: npm run cache -- push
shell: bash

- name: Run the test
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
run: WORKER_COUNT=2 npm run test -- --extra-version=${{ inputs.extra-versions }} --name-filter=${{ inputs.test-filter }}
env:
WORKER_COUNT: ${{ inputs.worker-count }}
EXTRA_VERSION: ${{ inputs.extra-versions }}
NAME_FILTER: ${{ inputs.test-filter }}
run: npm run test -- --extra-version=$EXTRA_VERSION --name-filter=$NAME_FILTER
shell: bash

- name: Print the results
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/multidim-interop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ name: libp2p multidimensional interop test

jobs:
run-multidim-interop:
runs-on: ubuntu-latest
runs-on: ['self-hosted', 'linux', 'x64', '4xlarge'] # https://github.com/pl-strflt/tf-aws-gh-runner/blob/main/runners.tf
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/run-interop-ping-test
with:
s3-cache-bucket: libp2p-by-tf-aws-bootstrap
s3-access-key-id: ${{ vars.S3_AWS_ACCESS_KEY_ID }}
s3-secret-access-key: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }}
worker-count: 16
build-without-secrets:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 35ab35b

Please sign in to comment.