Skip to content

Commit 6a72cd3

Browse files
authored
Merge pull request #2266 from annietllnd/github_LP
Tech review of Axion and GitHub Self-Hosted Runner
2 parents 8aa6763 + 5aa5e80 commit 6a72cd3

7 files changed

Lines changed: 107 additions & 62 deletions

File tree

content/learning-paths/servers-and-cloud-computing/github-on-arm/_index.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ draft: true
55
cascade:
66
draft: true
77

8-
minutes_to_complete: 30
8+
minutes_to_complete: 15
99

10-
who_is_this_for: This Learning Path is for DevOps engineers, system administrators, or developers who want to deploy GitHub Actions Self-Hosted Runner on the Google Axion C4A Arm virtual machine.
10+
who_is_this_for: This is an introductory topic for developers who want to deploy GitHub Actions Self-Hosted Runner on an Arm-based Google Axion C4A instance.
1111

1212
learning_objectives:
1313
- Provision an Arm virtual machine on the Google Cloud Platform using the C4A Google Axion instance family.
@@ -16,13 +16,12 @@ learning_objectives:
1616

1717
prerequisites:
1818
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free?utm_source=google&hl=en) account with billing enabled.
19-
- Familiarity with [GitHub Actions](https://github.com/features/actions) and the Linux command line.
20-
- A GitHub account. You can sign up [here](https://github.com/signup).
19+
- A GitHub account. You can sign up [here](https://github.com/signup).
2120

22-
author: Jason Andrews
21+
author: Annie Tallund
2322

2423
##### Tags
25-
skilllevels: Advanced
24+
skilllevels: Introductory
2625
subjects: CI-CD
2726
cloud_service_providers: Google Cloud
2827

@@ -55,6 +54,11 @@ further_reading:
5554
link: https://github.blog/news-insights/product-news/arm64-on-github-actions-powering-faster-more-efficient-build-systems/
5655
type: website
5756

57+
- resource:
58+
title: GCP Quickstart Guide to Create a virtual machine
59+
link: https://cloud.google.com/compute/docs/instances/create-start-instance
60+
type: website
61+
5862

5963
weight: 1 # _index.md always has weight of 1 to order correctly
6064
layout: "learningpathall" # All files under learning paths have this same wrapper

content/learning-paths/servers-and-cloud-computing/github-on-arm/background.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "About Google Axion C4A series and GitHub Actions"
2+
title: "About Google Axion and GitHub Actions"
33

44
weight: 2
55

@@ -10,7 +10,7 @@ layout: "learningpathall"
1010

1111
The Google Axion C4A series is a family of Arm-based virtual machines built on Google’s custom Axion CPU, which is based on Arm Neoverse-V2 cores. Designed for high-performance and energy-efficient computing, these virtual machines offer strong performance ideal for modern cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications.
1212

13-
The C4A series provides a cost-effective alternative to x86 virtual machine while leveraging the scalability and performance benefits of the Arm architecture in Google Cloud.
13+
The C4A series provides offer a cost-effective virtual machine while leveraging the scalability and performance benefits of the Arm architecture in Google Cloud.
1414

1515
To learn more about Google Axion, refer to the blog [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu).
1616

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,86 @@
11
---
2-
title: Install and Set Up GitHub Self-Hosted Runner on Google Cloud C4A Virtual Machine
2+
title: Set up a GitHub Self-Hosted Runner
33
weight: 4
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

99

10-
## Set Up GitHub Actions Self-Hosted Runner on Google Axion C4A Virtual Machine
10+
This section shows how to deploy a self-hosted GitHub Actions runner on your instance. It covers installing Git and GitHub CLI, authenticating with GitHub and configuring the runner on an Arm64 environment for optimized CI/CD workflows.
1111

12-
This Learning Path shows how to deploy a self-hosted GitHub Actions runner on a Google Cloud C4A Arm64 virtual machine running Ubuntu. It covers installing Git and GitHub CLI, authenticating with GitHub and configuring the runner on an Arm64 environment for optimized CI/CD workflows.
12+
### Set up development environment
13+
14+
Start by installing the required dependencies using the `apt` package manager:
1315

14-
### Install Git and GitHub CLI
1516
```console
16-
sudo apt update
17-
sudo apt install -y git gh
17+
sudo apt update
18+
sudo apt install -y git gh vim
19+
```
20+
21+
Next step is to configure your git credentials. Update the command with your name and email.
22+
23+
```bash
24+
git config --global user.email "you@example.com"
25+
git config --global user.name "Your Name"
1826
```
19-
Login to GitHub
27+
28+
Now you are ready to connect the machine to GitHub. The command below is used to authenticate the GitHub CLI with your GitHub account. It allows you to securely log in using a web browser or token, enabling the CLI to interact with repositories, actions, and other GitHub features on your behalf.
29+
30+
2031
```console
21-
gh auth login
22-
```
23-
The command `gh auth login` is used to authenticate the GitHub CLI with your GitHub account. It allows you to securely log in using a web browser or token, enabling the CLI to interact with repositories, actions, and other GitHub features on your behalf.
32+
gh auth login
33+
```
34+
35+
The command will prompt you to make a few choices. For this use-case, you can use the default ones as shown in the image below.
2436

2537
![Login to GitHub](./images/gh-auth.png)
2638

27-
Below is the GitHub login UI:
39+
{{% notice %}}
40+
If you get an error opening the browser on your virtual machine, you can navigate to the following URL on the host machine.
41+
```
42+
https://github.com/login/device
43+
```
44+
From there, you can enter the code displayed in the CLI of the virtual machine.
45+
{{% /notice %}}
46+
47+
If the log in was successful, you will see the following confirmation in your browser window.
2848

2949
![GitHub UI](./images/login-page.png)
3050

31-
### Test GitHub CLI and Git
32-
Create a test repo:
51+
### Test GitHub CLI and Git
52+
53+
The command below creates a new public GitHub repository named **test-repo** using the GitHub CLI. It sets the repository visibility to public, meaning anyone can view it
54+
3355
```console
34-
gh repo create test-repo public
56+
gh repo create test-repo --public
3557
```
3658
You should see an output similar to:
3759
```output
3860
✓ Created repository <your-github-account>/test-repo on GitHub
3961
https://github.com/<your-github-account>/test-repo
4062
```
4163

42-
The command `gh repo create test-repo --public` creates a new public GitHub repository named **test-repo** using the GitHub CLI. It sets the repository visibility to public, meaning anyone can view it
4364

4465
### Configure the Self-Hosted Runner
45-
Go to your repository's **Settings > Actions**, and under the **Runners** section, click on **Add Runner** or view existing self-hosted runners.
66+
67+
* Go to your repository's **Settings > Actions**, and under the **Runners** section
68+
* Click on **Add Runner** or view existing self-hosted runners.
69+
70+
{{% notice Note %}}
4671
If the **Actions** tab is not visible, ensure Actions are enabled by navigating to **Settings > Actions > General**, and select **Allow all actions and reusable workflows**.
72+
{{% /notice %}}
4773

4874
![runner](./images/newsh-runner.png)
4975

50-
Then, click on the **New runner** button, followed by **New self-hosted runner**. In the **Add new self-hosted runner** section, proceed as follows:
51-
- Select Linux for the operating system.
52-
- Choose ARM64 for the architecture
76+
Then, click on the **New self-hosted runner** button. In the **Add new self-hosted runner** section. Select Linux for the operating system, and choose ARM64 for the architecture. This will generate commands to set up the runner. Copy and run them on your Google Axion C4A virtual machine.
5377

5478
![new-runner](./images/new-runner.png)
5579

56-
Next, execute the following instructions on your Google Axion C4A virtual machine:
57-
```console
58-
mkdir actions-runner && cd actions-runner# Download the latest runner package
59-
curl -o actions-runner-linux-arm64-2.326.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.326.0/actions-runner-linux-arm64-2.326.0.tar.gz
60-
echo "ee7c229c979c5152e9f12be16ee9e83ff74c9d9b95c3c1aeb2e9b6d07157ec85 actions-runner-linux-arm64-2.326.0.tar.gz" | shasum -a 256 -c# Extract the installer
61-
tar xzf ./actions-runner-linux-arm64-2.326.0.tar.gz
62-
```
63-
Then, configure the virtual machine with the following command:
64-
65-
```console
66-
./config.sh --url https://github.com/<YOUR_USERNAME>/YOUR_REPO --token YOUR_TOKEN
67-
```
68-
Replace `YOUR_USERNAME`, `YOUR_REPO`, and `YOUR_TOKEN` accordingly.
69-
This command links the runner to your GitHub repo using a one-time registration token.
80+
The final command links the runner to your GitHub repo using a one-time registration token.
7081

7182
During the command’s execution, you will be prompted to provide the runner group, the name of the runner, and the work folder name. You can accept the defaults by pressing **Enter** at each step. The output will resemble as below:
7283

73-
You should see an output similar to:
74-
7584
```output
7685
--------------------------------------------------------------------------------
7786
| ____ _ _ _ _ _ _ _ _ |
@@ -111,3 +120,5 @@ Current runner version: '2.326.0'
111120
The runner will now be visible in the GitHub actions:
112121

113122
![final-runner](./images/final-runner.png)
123+
124+
For now, you can terminate the `./run.sh` command with `Ctrl+C`. Move on to the next section to set up a simple web server using the runner.
23.7 KB
Loading

content/learning-paths/servers-and-cloud-computing/github-on-arm/images/image.png renamed to content/learning-paths/servers-and-cloud-computing/github-on-arm/images/select-instance.png

File renamed without changes.
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Create Google Axion C4A Arm virtual machine
2+
title: Create the instance
33
weight: 3
44

55
### FIXED, DO NOT MODIFY
@@ -10,20 +10,24 @@ layout: learningpathall
1010

1111
This guide walks you through provisioning **Google Axion C4A Arm virtual machine** on GCP with the **c4a-standard-4 (4 vCPUs, 16 GB Memory)** machine type, using the **Google Cloud Console**.
1212

13-
If you are new to Google Cloud, it is recommended to follow the [GCP Quickstart Guide to Create a virtual machine](https://cloud.google.com/compute/docs/instances/create-start-instance).
14-
15-
For more details, kindly follow the Learning Path on [Getting Started with Google Cloud Platform](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/google/).
13+
If you haven't got a Google Cloud account, you can follow the Learning Path on [Getting Started with Google Cloud Platform](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/google/) to get started.
1614

1715
### Create an Arm-based Virtual Machine (C4A)
1816

1917
To create a virtual machine based on the C4A Arm architecture:
20-
1. Navigate to the [Google Cloud Console](https://console.cloud.google.com/).
21-
2. Go to **Compute Engine > VM Instances** and click on **Create Instance**.
18+
1. Open the [Google Cloud Console](https://console.cloud.google.com/).
19+
2. Navigate to the card **Compute Engine** and click on **Create Instance**.
2220
3. Under the **Machine Configuration**:
2321
- Fill in basic details like **Instance Name**, **Region**, and **Zone**.
2422
- Choose the **Series** as `C4A`.
2523
- Select a machine type such as `c4a-standard-4`.
26-
![Instance Screenshot](./images/image.png)
27-
4. Under the **OS and Storage**, click on **Change**, and select Arm64 based OS Image of your choice. For this Learning Path, we pick **Ubuntu** as the Operating System with **Ubuntu 24.04 LTS Minimal** as the Version. Make sure you pick the version of image for Arm.
24+
![Instance Screenshot](./images/select-instance.png)
25+
4. Under the **OS and Storage**, click on **Change**, pick **Ubuntu** as the Operating System with **Ubuntu 24.04 LTS Minimal** as the Version. Make sure you pick the version of image for Arm.
2826
5. Under **Networking**, enable **Allow HTTP traffic** to test workloads like NGINX later.
2927
6. Click on **Create**, and the instance will launch.
28+
29+
{{% notice Important %}}
30+
You should not enable the **Allow HTTP traffic** permanently, since this poses a security risk. For the long-term, you should only allow traffic from the IP address you use to connect to the instance.
31+
{{% /notice %}}
32+
33+
You can access the Google Cloud Console by clicking the **SSH** button in the instance overview. Use this command line interface (CLI) to run the commands in the remainder of this Learning Path.
Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
---
2-
title: Deploy NGINX on Self-Hosted Runner Using GitHub Actions
2+
title: Deploy NGINX the GitHub Runner
33
weight: 5
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

99

10-
## Deploy NGINX Using GitHub Actions
11-
This workflow installs and starts the NGINX web server on a self-hosted runner whenever code is pushed to the main branch.
10+
This workflow installs and starts a basic NGINX web server on a self-hosted runner whenever code is pushed to the main branch.
1211

13-
### Create the Workflow:
12+
In your instance's console, create a directory for the repository:
1413

15-
Create a workflow file at `.github/workflows/deploy-nginx.yaml` with the following content:
14+
```console
15+
mkdir test-repo && cd test-repo
16+
echo "# test-repo" >> README.md
17+
```
1618

17-
```yaml
19+
Then, create the GitHub Actions workflow file at `.github/workflows/deploy-nginx.yaml`.
20+
21+
```console
22+
mkdir .github && mkdir .github/workflows/
23+
vim .github/workflows/deploy-nginx.yaml
24+
```
1825

26+
Paste the following code block into the file and save it.
27+
28+
```yaml
1929
name: Deploy NGINX
2030

2131
on:
@@ -34,18 +44,34 @@ jobs:
3444
- name: Start NGINX
3545
run: sudo systemctl start nginx
3646
```
37-
### Commit and Push:
3847
39-
```console
48+
Now it's time to initiate your repository and push the changes.
49+
50+
```console
51+
git init
4052
git add .
41-
git commit -m "Add NGINX deploy workflow"
42-
git push origin main
53+
git commit -m "first commit"
54+
git branch -M main
55+
git remote add origin https://github.com/annietllnd/test-repo.git
56+
git push -u origin main
4357
```
58+
59+
This will trigger an actions job. The job will listen for a self-hosted runner to connect to the GitHub repository. Go back to the `actions-runner` directory and re-run the script from the previous section:
60+
61+
```bash
62+
cd ..
63+
./run.sh
64+
```
65+
66+
You will see in the output of the command that it identifies the a job called `deploy`, and that it finishes after having run the two steps.
67+
4468
### Access the NGINX Server
45-
Once the workflow completes, open your browser and navigate to:
69+
Once the workflow completes, open your browser and navigate to your machine's external IP address. You will find the information in your instance overview, under **Network interfaces**.
4670
```
4771
http://<your-public-IP>
4872
```
4973
You should see the NGINX welcome page confirming a successful deployment.
5074

5175
![nginx](./images/nginx.png)
76+
77+
You should now know how to set up a self-hosted runner with an Arm-based Google Cloud instance, and use it to run GitHub Actions workflows. From here, you can modify the workflow file to try out different commands.

0 commit comments

Comments
 (0)