You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+149-5Lines changed: 149 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ Run GitHub Actions on ephemeral EC2 instances.
11
11
-[Runner Lifecycle](#lifecycle)
12
12
-[Multi-Job Workflows](#multi-job)
13
13
-[How Termination Works](#termination)
14
+
-[CloudWatch Logs Integration](#cloudwatch)
14
15
-[Debugging and Troubleshooting](#debugging)
15
16
-[SSH Access](#ssh)
16
17
-[Important Log Files](#logs)
@@ -53,6 +54,10 @@ jobs:
53
54
3. Configure an AWS IAM role with GitHub OIDC trust policy (see [below](#ec2-launch-role))
54
55
4. Add the role ARN as a repository variable named `EC2_LAUNCH_ROLE`
55
56
57
+
**Optional Setup:**
58
+
- `EC2_INSTANCE_PROFILE`: Only needed if you want CloudWatch Logs or need the EC2 instances to access AWS APIs
59
+
- See [CloudWatch Logs Integration](#cloudwatch) for details
60
+
56
61
The `EC2_LAUNCH_ROLE` is passed to [aws-actions/configure-aws-credentials]; if you'd like to authenticate with AWS using other parameters, please [file an issue] to let us know.
@@ -74,9 +79,10 @@ The reusable workflow ([`runner.yml`]) requires:
74
79
75
80
Optional inputs (all fall back to corresponding `vars.*` if not provided):
76
81
- `action_ref`- ec2-gha Git ref to checkout (branch/tag/SHA); auto-detected if not specified
82
+
- `cloudwatch_logs_group`- CloudWatch Logs group name for streaming logs (falls back to `vars.CLOUDWATCH_LOGS_GROUP`)
77
83
- `ec2_home_dir` - Home directory (default: `/home/ubuntu`)
78
84
- `ec2_image_id` - AMI ID (default: Deep Learning AMI)
79
-
- `ec2_instance_profile`- IAM instance profile name for EC2 instances (useful for on-instance debugging [via SSH](#ssh))
85
+
- `ec2_instance_profile`- IAM instance profile name for EC2 instances (useful for on-instance debugging [via SSH](#ssh), required for [CloudWatch logging](#cloudwatch))
80
86
- `ec2_instance_type` - Instance type (default: `g4dn.xlarge`)
81
87
- `ec2_key_name`- EC2 key pair name (required for [SSH access](#ssh))
82
88
- `ec2_root_device_size` - Root device size in GB (default: 0 = use AMI default)
@@ -144,6 +150,45 @@ jobs:
144
150
5. New jobs starting within the grace period cancel the termination
145
151
6. Before shutdown, the runner process is gracefully stopped to remove itself from GitHub
2. **Create an IAM role for your EC2 instances** with CloudWatch Logs permissions:
163
+
164
+
**Important**: This is a separate role from your GitHub Actions launch role (`EC2_LAUNCH_ROLE`). The EC2 instances need their own IAM role to write logs. This role is only required if you want to use CloudWatch Logs.
165
+
166
+
See [Appendix: IAM Role Setup](#iam-setup-appendix) for detailed instructions on creating the `EC2_INSTANCE_PROFILE`.
Copy file name to clipboardExpand all lines: action.yml
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -13,14 +13,17 @@ inputs:
13
13
aws_tags:
14
14
description: "The AWS tags to use for your runner, formatted as a JSON list. See `README` for more details."
15
15
required: false
16
+
cloudwatch_logs_group:
17
+
description: "CloudWatch Logs group name for streaming runner logs. Leave empty to disable CloudWatch Logs."
18
+
required: false
16
19
ec2_home_dir:
17
20
description: "The EC2 AMI home directory to use for your runner. Will not start if not specified. For example: `/home/ec2-user`"
18
21
required: true
19
22
ec2_image_id:
20
23
description: "The machine AMI to use for your runner. This AMI can be a default but should have docker installed in the AMI. Will not start if not specified."
21
24
required: true
22
25
ec2_instance_profile:
23
-
description: "Instance profile name to attach to launched EC2 instances"
26
+
description: "Instance profile name to attach to launched EC2 instances (e.g. for CloudWatch Logs)"
24
27
required: false
25
28
ec2_instance_type:
26
29
description: "The type of instance to use for your runner. For example: t2.micro, t4g.nano, etc. Will not start if not specified."
0 commit comments