Skip to content

Commit

Permalink
Document market-type (#211)
Browse files Browse the repository at this point in the history
* Document `market-type`

* Fix blank line

* Fix note

* Try to fix note syntax
  • Loading branch information
tverghis authored Jan 23, 2025
1 parent 28fbe1c commit dcd20a8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,19 @@ Use the following steps to prepare your workflow for running on your EC2 self-ho

These example policies above are provided as a guide. They can and most likely should be limited even more by specifying the resources you use.


2. Add the keys to GitHub secrets.
3. Use the [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) action to set up the keys as environment variables.

> [!IMPORTANT]
> If you are planning on using Spot instances for your runner, AWS uses a service-linked role to provision the instances.
>
> For this to work, at least one of the following must be true:
> - The service-linked role exists already. This happens if you request a Spot instance via the AWS Console interface.
> - You create the service-linked role via the Console, AWS CLI or AWS API.
> - You grant the IAM role above permissions to create the service-linked role at runtime.
> See the docs [here](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create-service-linked-role.html) and [here](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/service-linked-roles-spot-instance-requests.html) for more details.
**2. Prepare GitHub personal access token**

1. Create a new GitHub personal access token with the `repo` scope.
Expand Down Expand Up @@ -205,8 +215,8 @@ Now you're ready to go!
| `iam-role-name` | Optional. Used only with the `start` mode. | IAM role name to attach to the created EC2 runner. <br><br> This allows the runner to have permissions to run additional actions within the AWS account, without having to manage additional GitHub secrets and AWS users. <br><br> Setting this requires additional AWS permissions for the role launching the instance (see above). |
| `aws-resource-tags` | Optional. Used only with the `start` mode. | Specifies tags to add to the EC2 instance and any attached storage. <br><br> This field is a stringified JSON array of tag objects, each containing a `Key` and `Value` field (see example below). <br><br> Setting this requires additional AWS permissions for the role launching the instance (see above). |
| `runner-home-dir` | Optional. Used only with the `start` mode. | Specifies a directory where pre-installed actions-runner software and scripts are located.<br><br> |
| `pre-runner-script` | Optional. Used only with the `start` mode. | Specifies bash commands to run before the runner starts. It's useful for installing dependencies with apt-get, yum, dnf, etc. For example:<pre> - name: Start EC2 runner<br> with:<br> mode: start<br> ...<br> pre-runner-script: \|<br> sudo yum update -y && \ <br> sudo yum install docker git libicu -y<br> sudo systemctl enable docker</pre>
<br><br> |
| `pre-runner-script` | Optional. Used only with the `start` mode. | Specifies bash commands to run before the runner starts. It's useful for installing dependencies with apt-get, yum, dnf, etc. For example:<pre> - name: Start EC2 runner<br> with:<br> mode: start<br> ...<br> pre-runner-script: \|<br> sudo yum update -y && \ <br> sudo yum install docker git libicu -y<br> sudo systemctl enable docker</pre> |
| `market-type` | Optional. Used only with the `start` mode. | The only valid option is `spot`. If `spot` is specified, a Spot instance will be requested. If left unspecified, an on-demand instance will be provisioned. |

### Environment variables

Expand Down

0 comments on commit dcd20a8

Please sign in to comment.