Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GitHub Action to Create an AWS EC2 Self-hosted Runner

License

NotificationsYou must be signed in to change notification settings

sustainable-computing-io/aws_ec2_self_hosted_runner

Repository files navigation

GitHub Super-LinterCI

Usage

Here's an example of how to use this action in a workflow file:

name:Test Self-hosted Runneron:push:branches:      -mainpermissions:contents:readjobs:setup-runner:name:Test-Setup Self Hosted Runnerruns-on:ubuntu-latestoutputs:instance_id:${{ steps.create-runner.outputs.instance_id }}runner_name:${{ steps.create-runner.outputs.runner_name }}steps:      -name:Create Runneruses:sustainable-computing-io/aws_ec2_self_hosted_runner@mainid:create-runnerwith:action:"create"aws_region:${{ secrets.AWS_REGION }}github_token:${{ secrets.GH_SELF_HOSTED_RUNNER_TOKEN }}aws_access_key_id:${{ secrets.AWS_ACCESS_KEY_ID }}aws_secret_access_key:${{ secrets.AWS_SECRET_ACCESS_KEY }}security_group_id:${{ secrets.AWS_SECURITY_GROUP_ID }}github_repo:${{ github.repository }}ami_id:"ami-0e4d0bb9670ea8db0"instance_type:"t2.micro"create_s3_bucket:"false"spot_instance_only:"true"      -name:Print Outputid:outputrun:|          echo "instance_id ${{ steps.create-runner.outputs.instance_id }}"          echo "instance_ip ${{ steps.create-runner.outputs.instance_ip }}"          echo "runner_name ${{ steps.create-runner.outputs.runner_name }}"          echo "bucket_name ${{ steps.create-runner.outputs.bucket_name }}"test-runner:needs:setup-runnername:GitHub Self Hosted Runner Testsruns-on:[self-hosted, linux, x64]steps:      -name:Checkoutid:checkoutuses:actions/checkout@v4      -name:Run Testsrun:|          export INSTANCE_ID="${{ needs.setup-runner.outputs.instance_id }}"          echo "Running tests on self-hosted runner with instance ${INSTANCE_ID}"          uname -a # or any other command          cat /etc/os-release          cat /proc/cpuinfodestroy-runner:if:always()needs:[setup-runner, test-runner]name:Destroy Self Hosted Runnerruns-on:ubuntu-lateststeps:      -name:unregister runnerid:unregisteruses:sustainable-computing-io/aws_ec2_self_hosted_runner@mainwith:action:"unregister"runner_name:${{ needs.setup-runner.outputs.runner_name }}github_token:${{ secrets.GH_SELF_HOSTED_RUNNER_TOKEN }}github_repo:${{ github.repository }}      -name:terminate instanceid:terminateuses:sustainable-computing-io/aws_ec2_self_hosted_runner@mainwith:action:"terminate"aws_access_key_id:${{ secrets.AWS_ACCESS_KEY_ID }}aws_secret_access_key:${{ secrets.AWS_SECRET_ACCESS_KEY }}instance_id:${{ needs.setup-runner.outputs.instance_id }}

Inputs

ParameterDescriptionDefault Value
github_token(Required) The GitHub token to authenticate with the GitHub API. Must have repository admin permission.Should be set in secrets, e.g. GH_SELF_HOSTED_RUNNER_TOKEN
aws_access_key_id(Required) The AWS access key ID to use for authentication.Should be set in secrets.
aws_secret_access_key(Required) The AWS secret access key to use for authentication.Should be set in secrets.
security_group_id(Required) The ID of the AWS security group to associate with the instance.Should be set in secrets.
ami_id(Optional) The ID of the Amazon Machine Image (AMI) to use for the instance."ami-0e4d0bb9670ea8db0" (Ubuntu Server 20.04 LTS)
instance_type(Optional) The type of the instance to launch."t2.micro"
github_repo(Optional) The GitHub repository in the format "owner/repository" to clone and use."sustainable-computing-io/kepler-model-server"
aws_region(Optional) The AWS region to launch the spot instance."us-east-2"
key_name(Optional) The name of the key pair to use for the instance.Empty.
root_volume_size(Optional) The size of the root volume in GB.20
spot_inastance_only(Optional) If true, only create a spot instance."true"
create_s3_bucket(Optional) If true, create a S3 bucket to store the model."false"
bucket_name(Optional) The name of the S3 bucket to store the model.The bucket name is the same as the repository name with time date stamp.
auto_terminate_hours(Optional) The number of hours after which the instance should be terminated.6

Outputs

OutputDescription
instance_idAWS EC2 instance ID
runner_nameGitHub self hosted runner name
instance_ipAWS EC2 instance IP
bucket_nameAWS S3 bucket name
termination_timeThe time when the instance was terminated

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp