{"id":20705744,"url":"https://github.com/sustainable-computing-io/aws_ec2_self_hosted_runner","last_synced_at":"2026-02-12T14:03:34.064Z","repository":{"id":211482111,"uuid":"728895535","full_name":"sustainable-computing-io/aws_ec2_self_hosted_runner","owner":"sustainable-computing-io","description":"GitHub Action to Create an AWS EC2 Self-hosted Runner","archived":false,"fork":false,"pushed_at":"2024-12-10T22:54:59.000Z","size":69,"stargazers_count":2,"open_issues_count":9,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-23T01:41:05.208Z","etag":null,"topics":["aws-ec2","ec2-spot-instances","github-actions","github-aws","github-docker","github-self-hosted-runner","github-selfhosted"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sustainable-computing-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-07T23:48:05.000Z","updated_at":"2024-11-08T19:23:46.000Z","dependencies_parsed_at":"2023-12-08T21:22:05.040Z","dependency_job_id":"941502ed-150b-4c1f-8468-fd47dcd9d4ec","html_url":"https://github.com/sustainable-computing-io/aws_ec2_self_hosted_runner","commit_stats":null,"previous_names":["sustainable-computing-io/aws_ec2_self_hosted_runner"],"tags_count":5,"template":false,"template_full_name":"actions/hello-world-docker-action","purl":"pkg:github/sustainable-computing-io/aws_ec2_self_hosted_runner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sustainable-computing-io%2Faws_ec2_self_hosted_runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sustainable-computing-io%2Faws_ec2_self_hosted_runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sustainable-computing-io%2Faws_ec2_self_hosted_runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sustainable-computing-io%2Faws_ec2_self_hosted_runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sustainable-computing-io","download_url":"https://codeload.github.com/sustainable-computing-io/aws_ec2_self_hosted_runner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sustainable-computing-io%2Faws_ec2_self_hosted_runner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29367845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-ec2","ec2-spot-instances","github-actions","github-aws","github-docker","github-self-hosted-runner","github-selfhosted"],"created_at":"2024-11-17T01:19:33.768Z","updated_at":"2026-02-12T14:03:34.021Z","avatar_url":"https://github.com/sustainable-computing-io.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS Self Hosted Runner GitHub Action\n\n[![GitHub Super-Linter](https://github.com/sustainable-computing-io/aws_ec2_self_hosted_runner/actions/workflows/linter.yml/badge.svg)](https://github.com/super-linter/super-linter)\n![CI](https://github.com/sustainable-computing-io/aws_ec2_self_hosted_runner/actions/workflows/ci.yml/badge.svg)\n\n## Usage\n\nHere's an example of how to use this action in a workflow file:\n\n```yaml\nname: Test Self-hosted Runner\n\non:\n  push:\n    branches:\n      - main\n\npermissions:\n  contents: read\n\njobs:\n  setup-runner:\n    name: Test-Setup Self Hosted Runner\n    runs-on: ubuntu-latest\n    outputs:\n      instance_id: ${{ steps.create-runner.outputs.instance_id }}\n      runner_name: ${{ steps.create-runner.outputs.runner_name }}\n\n    steps:\n      - name: Create Runner\n        uses: sustainable-computing-io/aws_ec2_self_hosted_runner@main\n        id: create-runner\n        with:\n            action: \"create\"\n            aws_region: ${{ secrets.AWS_REGION }}\n            github_token: ${{ secrets.GH_SELF_HOSTED_RUNNER_TOKEN }}\n            aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n            aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n            security_group_id: ${{ secrets.AWS_SECURITY_GROUP_ID }}\n            github_repo: ${{ github.repository }}\n            ami_id: \"ami-0e4d0bb9670ea8db0\"\n            instance_type: \"t2.micro\"\n            create_s3_bucket: \"false\"\n            spot_instance_only: \"true\"\n\n      - name: Print Output\n        id: output\n        run: |\n          echo \"instance_id ${{ steps.create-runner.outputs.instance_id }}\"\n          echo \"instance_ip ${{ steps.create-runner.outputs.instance_ip }}\"\n          echo \"runner_name ${{ steps.create-runner.outputs.runner_name }}\"\n          echo \"bucket_name ${{ steps.create-runner.outputs.bucket_name }}\"\n    \n  test-runner:\n    needs: setup-runner\n    name: GitHub Self Hosted Runner Tests\n    runs-on: [self-hosted, linux, x64]\n\n    steps:\n      - name: Checkout\n        id: checkout\n        uses: actions/checkout@v4\n\n      - name: Run Tests\n        run: |\n          export INSTANCE_ID=\"${{ needs.setup-runner.outputs.instance_id }}\"\n          echo \"Running tests on self-hosted runner with instance ${INSTANCE_ID}\"\n          uname -a # or any other command\n          cat /etc/os-release \n          cat /proc/cpuinfo \n  \n  destroy-runner:\n    if: always()\n    needs: [setup-runner, test-runner]\n    name: Destroy Self Hosted Runner\n    runs-on: ubuntu-latest\n    steps:\n      - name: unregister runner\n        id: unregister\n        uses: sustainable-computing-io/aws_ec2_self_hosted_runner@main\n        with:\n          action: \"unregister\"\n          runner_name: ${{ needs.setup-runner.outputs.runner_name }}\n          github_token: ${{ secrets.GH_SELF_HOSTED_RUNNER_TOKEN }}\n          github_repo: ${{ github.repository }}\n\n      - name: terminate instance\n        id: terminate\n        uses: sustainable-computing-io/aws_ec2_self_hosted_runner@main\n        with:\n          action: \"terminate\"\n          aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}\n          aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}\n          instance_id: ${{ needs.setup-runner.outputs.instance_id }}\n```\n\n## Inputs\n\n| Parameter            | Description                                                                                           | Default Value                            |\n|----------------------|-------------------------------------------------------------------------------------------------------|------------------------------------------|\n| 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 |\n| aws_access_key_id    | (Required) The AWS access key ID to use for authentication.                                                      | Should be set in secrets. |\n| aws_secret_access_key| (Required) The AWS secret access key to use for authentication.                                                  | Should be set in secrets. |\n| security_group_id    | (Required) The ID of the AWS security group to associate with the instance.                                      | Should be set in secrets. |\n| ami_id               | (Optional) The ID of the Amazon Machine Image (AMI) to use for the instance.                                     | \"ami-0e4d0bb9670ea8db0\" (Ubuntu Server 20.04 LTS) |\n| instance_type        | (Optional) The type of the instance to launch.                                                                   | \"t2.micro\"                               |\n| github_repo          | (Optional) The GitHub repository in the format \"owner/repository\" to clone and use.                              | \"sustainable-computing-io/kepler-model-server\" |\n| aws_region           | (Optional) The AWS region to launch the spot instance.                                                           | \"us-east-2\"                              |\n| key_name             | (Optional) The name of the key pair to use for the instance.                                                     | Empty. |\n| root_volume_size     | (Optional) The size of the root volume in GB.                                                                    | 20                                       |\n| spot_inastance_only  | (Optional) If true, only create a spot instance.                                                                 | \"true\"                                   |\n| create_s3_bucket     | (Optional) If true, create a S3 bucket to store the model.                                                       | \"false\"                                  |\n| 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. |\n| auto_terminate_hours | (Optional) The number of hours after which the instance should be terminated.                                   | 6                                        |\n\n## Outputs\n\n| Output | Description             |\n| ------ | ----------------------- |\n| `instance_id` | AWS EC2 instance ID |\n| `runner_name` | GitHub self hosted runner name |\n| `instance_ip` | AWS EC2 instance IP |\n| `bucket_name` | AWS S3 bucket name |\n| `termination_time` | The time when the instance was terminated |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsustainable-computing-io%2Faws_ec2_self_hosted_runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsustainable-computing-io%2Faws_ec2_self_hosted_runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsustainable-computing-io%2Faws_ec2_self_hosted_runner/lists"}