Skip to content

Commit

Permalink
Add another token to alleviate API limit pressure. (#10826)
Browse files Browse the repository at this point in the history
We are running into Github API rate limits.

This PR:
- introduces another token as a temp solution.
- reorganises the workflow file.
  • Loading branch information
davinchia authored Mar 3, 2022
1 parent 0d38f27 commit 91b8d0e
Showing 1 changed file with 30 additions and 29 deletions.
59 changes: 30 additions & 29 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,30 @@ jobs:
SLACK_USERNAME: Buildbot
SLACK_TITLE: "Build Success"
SLACK_FOOTER: ""
# In case of self-hosted EC2 errors, remove this block.
stop-platform-build-runner:
name: "Platform: Stop Build EC2 Runner"
timeout-minutes: 10
needs:
- start-platform-build-runner # required to get output from the start-runner job
- platform-build # required to wait when the main job is done
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
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: Stop EC2 runner
uses: machulav/[email protected]
with:
mode: stop
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }}
label: ${{ needs.start-platform-build-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-platform-build-runner.outputs.ec2-instance-id }}

octavia-cli-build:
runs-on: ubuntu-latest
name: "Octavia CLI: Build"
Expand Down Expand Up @@ -353,29 +377,6 @@ jobs:
SLACK_USERNAME: Buildbot
SLACK_TITLE: "Build Success"
SLACK_FOOTER: ""
# In case of self-hosted EC2 errors, remove this block.
stop-platform-build-runner:
name: "Platform: Stop Build EC2 Runner"
timeout-minutes: 10
needs:
- start-platform-build-runner # required to get output from the start-runner job
- platform-build # required to wait when the main job is done
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
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: Stop EC2 runner
uses: machulav/[email protected]
with:
mode: stop
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }}
label: ${{ needs.start-platform-build-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-platform-build-runner.outputs.ec2-instance-id }}

## Frontend Test
## Gradle Build
Expand All @@ -396,7 +397,7 @@ jobs:
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: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }}
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }}
frontend-test:
needs: start-frontend-test-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-frontend-test-runner.outputs.label }} # run the job on the newly created runner
Expand Down Expand Up @@ -461,7 +462,7 @@ jobs:
uses: machulav/[email protected]
with:
mode: stop
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }}
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }}
label: ${{ needs.start-frontend-test-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-frontend-test-runner.outputs.ec2-instance-id }}

Expand All @@ -486,7 +487,7 @@ jobs:
ec2-image-id: ami-0c1a9bc22624339d8
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }}
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }}
kube-acceptance-test:
# In case of self-hosted EC2 errors, removed the `needs` line and switch back to running on ubuntu-latest.
needs: start-kube-acceptance-test-runner # required to start the main job when the runner is ready
Expand Down Expand Up @@ -613,7 +614,7 @@ jobs:
uses: machulav/[email protected]
with:
mode: stop
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }}
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }}
label: ${{ needs.start-kube-acceptance-test-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-kube-acceptance-test-runner.outputs.ec2-instance-id }}

Expand All @@ -638,7 +639,7 @@ jobs:
ec2-image-id: ami-0c1a9bc22624339d8
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }}
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }}
kube-acceptance-test-v2:
# In case of self-hosted EC2 errors, removed the `needs` line and switch back to running on ubuntu-latest.
needs: start-kube-acceptance-test-runner-v2 # required to start the main job when the runner is ready
Expand Down Expand Up @@ -735,6 +736,6 @@ jobs:
uses: machulav/[email protected]
with:
mode: stop
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }}
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }}
label: ${{ needs.start-kube-acceptance-test-runner-v2.outputs.label }}
ec2-instance-id: ${{ needs.start-kube-acceptance-test-runner-v2.outputs.ec2-instance-id }}

0 comments on commit 91b8d0e

Please sign in to comment.