forked from emdgroup/baybe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2516c1f
commit aad5fa1
Showing
4 changed files
with
4,352 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Attaches a runner to your repository | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
RunnerCount: | ||
description: 'Number of runners to attach' | ||
required: false | ||
default: 1 | ||
type: number | ||
RunnerComputeType: | ||
description: 'The type which indicates the compute power of the runner. Either "XS", "S", "M", "L" or "XL"' | ||
required: false | ||
default: 'S' | ||
type: string | ||
secrets: | ||
GitHubToken: | ||
description: 'GitHub Token which must provide admin permissions to attach a runner to the repository' | ||
required: true | ||
AWSRoleToAssume: | ||
description: 'AWS Role ARN which must provide permissions to attach a runner to the repository (Will be provided within the documentation)' | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
add-runner: | ||
name: Add one JIT Runner | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWSRoleToAssume }} | ||
role-session-name: Github_Add_Runner | ||
aws-region: eu-central-1 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Execute Lambda function | ||
run: | | ||
aws lambda invoke --function-name jit_runner_register_and_create_runner_container --cli-binary-format raw-in-base64-out --payload '{"github_api_secret": "${{ secrets.GitHubToken }}", "count_container": ${{ inputs.RunnerCount }}, "container_compute": "${{ inputs.RunnerComputeType }}", "repository": "${{ github.repository }}" }' response.json | ||
cat response.json | ||
if ! grep -q '"statusCode": 200' response.json; then | ||
echo "Lambda function failed. statusCode is not 200." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Manual Benchmark | ||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
add-runner: | ||
uses: ./.github/workflow_templates/runner_attach_workflow.yml | ||
with: | ||
RunnerCount: 1 | ||
RunnerComputeType: "S" | ||
secrets: | ||
GitHubToken: ${{ secrets.RUNNER_ATTACH_API_KEY }} | ||
AWSRoleToAssume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | ||
|
||
run-test-benchmark: | ||
needs: add-runner | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run benchmark | ||
run: python3 test.py |
Oops, something went wrong.