Skip to content

Commit 459e1e2

Browse files
docs: add docs how build gh base image (#43)
1 parent 323a344 commit 459e1e2

File tree

3 files changed

+96
-12
lines changed

3 files changed

+96
-12
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Building the GitHub Actions Base Image with Packer
2+
3+
This guide explains how to build the Forge GitHub Actions runner base image using [Packer](https://www.packer.io/).
4+
5+
## Prerequisites
6+
7+
- [Packer](https://www.packer.io/downloads) installed
8+
- AWS CLI configured with credentials and permissions to build AMIs
9+
- The required VPC and subnet exist in your AWS account
10+
- (Optional) Splunk Observability credentials if you want to enable Splunk OTel Collector
11+
- (Optional) Teleport for secure SSH access
12+
13+
## Required Variables
14+
15+
You must provide the following variables to Packer:
16+
17+
- `subnet_id`: The subnet where the instance will be launched
18+
- `vpc_id`: The VPC where the instance will be launched
19+
- `allowed_ssh_cidrs`: CIDR blocks allowed to SSH into the instance (for debugging)
20+
- `aws_region`: The AWS region to build the image in
21+
22+
Example values:
23+
- `subnet_id=subnet-0123456789abcdef0`
24+
- `vpc_id=vpc-0123456789abcdef0`
25+
- `allowed_ssh_cidrs=10.0.0.0/8`
26+
- `aws_region=us-west-2`
27+
28+
## (Optional) Splunk OTel Collector and Teleport
29+
30+
If you want to include the Splunk OpenTelemetry Collector in your image, set the following environment variables **before** running Packer:
31+
32+
```sh
33+
export SPLUNK_ACCESS_TOKEN=<your_splunk_access_token>
34+
export SPLUNK_REALM=<your_splunk_realm>
35+
```
36+
37+
If you want to include Teleport or Splunk OTel Collector roles in the build, enable them in your Ansible playbook by uncommenting the roles:
38+
39+
`forge/examples/build/ansible/build_gh_base_image.yaml`
40+
```yaml
41+
roles:
42+
- role: teleport
43+
- role: splunk_otel_collector
44+
```
45+
46+
## Build Command
47+
48+
Run the following command from the directory containing your Packer template:
49+
50+
```sh
51+
cd forge/examples/build/packer
52+
packer build \
53+
-var "subnet_id=<your_subnet_id>" \
54+
-var "vpc_id=<your_vpc_id>" \
55+
-var "allowed_ssh_cidrs=<your_allowed_ssh_cidrs>" \
56+
-var "aws_region=<your_aws_region>" \
57+
.
58+
```
59+
60+
**Example:**
61+
```sh
62+
cd forge/examples/build/packer
63+
packer build \
64+
-var "subnet_id=subnet-0123456789abcdef0" \
65+
-var "vpc_id=vpc-0123456789abcdef0" \
66+
-var "allowed_ssh_cidrs=10.0.0.0/8" \
67+
-var "aws_region=us-west-2" \
68+
.
69+
```
70+
71+
## Notes
72+
73+
- Make sure your AWS user/role has permissions to create EC2 instances, AMIs, and related resources.
74+
- If you enable the Splunk OTel Collector, ensure your access token and realm are valid.
75+
- The resulting AMI can be used as the base image for Forge GitHub Actions runners.

docs/configurations/index.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ This guide helps you navigate ForgeMT configuration modules—from platform setu
88

99
Start here if you're deploying for the first time:
1010

11-
1. [First Tenant Deployment](./deployments/forge_tenant.md)
12-
2. [Tenant Usage Guide](../tenant-usage/index.md)
13-
3. [Secrets Reference](./secrets.md)
14-
4. [Module Dependency Guide](./dependency.md)
11+
1. [First Tenant Deployment](./deployments/new_tenant.md)
12+
2. [Build GitHub Actions Base Image](./build/gh_base_image.md)
13+
3. [EKS Deployment Example](./deployments/forge_eks.md)
14+
4. [Splunk Integration Example](./deployments/splunk_deployment.md)
15+
5. [Secrets Reference](./secrets.md)
16+
6. [Module Dependency Guide](./dependency.md)
1517

1618
---
1719

@@ -68,26 +70,30 @@ Optional modules for observability, access, and compliance.
6870

6971
| Item | Purpose |
7072
|--------------------------|-----------------------------------------------|
71-
| `infra/secrets` | Provisions secrets for GitHub Apps and Splunk |
7273
| [Secrets Reference](./secrets.md) | Documents required keys, formats, scopes |
7374
| [Dependency Guide](./dependency.md) | Shows setup order across modules |
7475

7576
---
7677

77-
## Deployment Scenarios
78+
## Deployment & Build Scenarios
7879

7980
Ready-made configuration examples:
8081

81-
- [First Tenant Deployment](./deployments/forge_tenant.md)
82-
- [Splunk Integration](./deployments/splunk_deployment.md)
82+
- [First Tenant Deployment](./deployments/new_tenant.md)
83+
- [Build GitHub Actions Base Image](./build/gh_base_image.md)
84+
- [EKS Deployment Example](./deployments/forge_eks.md)
85+
- [Splunk Integration Example](./deployments/splunk_deployment.md)
8386

8487
View all: [Deployment Index](./deployments/index.md)
8588

8689
---
8790

8891
## Recommended Setup Order
8992

90-
1. Deploy base `infra/` modules (VPCs, EKS, IAM, S3, etc.)
91-
2. Deploy `platform/forge_runners`
92-
3. Configure secrets and tenant GitHub Apps
93-
4. Enable integrations (e.g., Splunk, Teleport)
93+
1. Build the GitHub Actions base image ([guide](./build/gh_base_image.md))
94+
2. Deploy base `infra/` modules (VPCs, EKS, IAM, S3, etc.)
95+
3. Deploy `platform/forge_runners`
96+
4. Configure secrets and tenant GitHub Apps
97+
5. Enable integrations (e.g., Splunk, Teleport)
98+
99+
---

examples/build/ansible/group_vars/all/common.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ aws_cli_checksum: bb1fcbbdaffc006dce62827083605b9953d23a1b42b3a7375733d9a6d7c94b
1111
# renovate: datasource=github-tags depName=github-aws-runners/terraform-aws-github-runner registryUrl=https://github.com/
1212
tf_aws_github_runner_version: 6.5.5
1313
install_runner_shell: https://raw.githubusercontent.com/github-aws-runners/terraform-aws-github-runner/v{{ tf_aws_github_runner_version }}/modules/runners/templates/install-runner.sh
14+
15+
teleport_comm_ca_pin: <teleport_comm_ca_pin> # e.g. sha256:3c2f8b1d4e5f7c6a9b0c8d9e1f2a3b4c5d6e7f8g9h0i1j2k3l4m5n6o7p8q9r0
16+
teleport_comm_auth_server: <teleport_comm_auth_server> # e.g. teleport.example.com:443

0 commit comments

Comments
 (0)