Skip to content

Commit

Permalink
find_non_rate_limited_PAT (#19736)
Browse files Browse the repository at this point in the history
* find_non_rate_limited_PAT

* checkout repo to find pat
  • Loading branch information
git-phu authored Nov 23, 2022
1 parent cc6facf commit 0c73b70
Show file tree
Hide file tree
Showing 8 changed files with 251 additions and 184 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/gke-kube-test-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,10 @@ on:
required: false

jobs:
find_valid_pat:
name: "Find a PAT with room for actions"
timeout-minutes: 10
runs-on: ubuntu-latest
outputs:
pat: ${{ steps.variables.outputs.pat }}
steps:
- name: Checkout Airbyte
uses: actions/checkout@v3
- name: Check PAT rate limits
id: variables
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.AIRBYTEIO_PAT }} \
${{ secrets.OSS_BUILD_RUNNER_GITHUB_PAT }} \
${{ secrets.SUPERTOPHER_PAT }} \
${{ secrets.DAVINCHIA_PAT }}
start-gke-kube-acceptance-test-runner:
timeout-minutes: 10
name: Start GKE Kube Acceptance Test EC2 Runner
runs-on: ubuntu-latest
needs: find_valid_pat
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
Expand All @@ -48,13 +30,20 @@ jobs:
with:
repository: ${{ github.event.inputs.repo }}
ref: ${{ github.event.inputs.gitref }}
- name: Check PAT rate limits
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.AIRBYTEIO_PAT }} \
${{ secrets.OSS_BUILD_RUNNER_GITHUB_PAT }} \
${{ secrets.SUPERTOPHER_PAT }} \
${{ secrets.DAVINCHIA_PAT }}
- name: Start AWS Runner
id: start-ec2-runner
uses: ./.github/actions/start-aws-runner
with:
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
github-token: ${{ needs.find_valid_pat.outputs.pat }}
github-token: ${{ env.PAT }}
gke-kube-acceptance-test:
# In case of self-hosted EC2 errors, removed the `needs` line and switch back to running on ubuntu-latest.
needs: start-gke-kube-acceptance-test-runner # required to start the main job when the runner is ready
Expand Down Expand Up @@ -146,7 +135,6 @@ jobs:
needs:
- start-gke-kube-acceptance-test-runner # required to get output from the start-runner job
- gke-kube-acceptance-test # required to wait when the main job is done
- find_valid_pat
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
Expand All @@ -156,10 +144,22 @@ jobs:
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Checkout Airbyte
uses: actions/checkout@v3
with:
repository: ${{ github.event.inputs.repo }}
ref: ${{ github.event.inputs.gitref }}
- name: Check PAT rate limits
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.AIRBYTEIO_PAT }} \
${{ secrets.OSS_BUILD_RUNNER_GITHUB_PAT }} \
${{ secrets.SUPERTOPHER_PAT }} \
${{ secrets.DAVINCHIA_PAT }}
- name: Stop EC2 runner
uses: supertopher/ec2-github-runner@base64v1.0.10
with:
mode: stop
github-token: ${{ needs.find_valid_pat.outputs.pat }}
github-token: ${{ env.PAT }}
label: ${{ needs.start-gke-kube-acceptance-test-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-gke-kube-acceptance-test-runner.outputs.ec2-instance-id }}
Loading

0 comments on commit 0c73b70

Please sign in to comment.