Skip to content

Commit eefa097

Browse files
authored
Merge pull request #2496 from pareenaverma/content_review
Tech Review of CircleCI Axion LP
2 parents 89f9abb + 8885acf commit eefa097

File tree

6 files changed

+177
-100
lines changed

6 files changed

+177
-100
lines changed

content/learning-paths/servers-and-cloud-computing/circleci-gcp/_index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cascade:
77

88
minutes_to_complete: 45
99

10-
who_is_this_for: This learning path is intended for software developers and DevOps engineers looking to set up and run CircleCI Arm native workflows on SUSE Linux Arm64 VMs, specifically on Google Cloud C4A with Axion processors, using self-hosted runners.
10+
who_is_this_for: This is an introductory topic for software developers and DevOps engineers looking to set up and run CircleCI Arm native workflows on SUSE Linux Arm64 VMs, specifically on Google Cloud C4A with Axion processors, using self-hosted runners.
1111

1212
learning_objectives:
1313
- Provision a SUSE Arm64 virtual machine on Google Cloud (C4A with Axion processors)
@@ -40,7 +40,6 @@ tools_software_languages:
4040
- CircleCI
4141
- Node.js
4242
- npm
43-
- Express
4443
- Docker
4544

4645
operatingsystems:

content/learning-paths/servers-and-cloud-computing/circleci-gcp/background.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ To learn more about Google Axion, refer to the [Introducing Google Axion Process
1616

1717
## CircleCI
1818

19-
CircleCI is a cloud-based **Continuous Integration and Continuous Delivery (CI/CD)** platform that automates the process of **building, testing, and deploying software**.
19+
CircleCI is a cloud-based Continuous Integration and Continuous Delivery (CI/CD) platform that automates the process of building, testing, and deploying software.
2020

21-
It integrates with popular version control systems like **GitHub**, **Bitbucket**, and **GitLab**, and allows developers to define custom workflows in a `.circleci/config.yml` file using **YAML syntax**.
21+
It integrates with popular version control systems like GitHub, Bitbucket, and GitLab, and allows developers to define custom workflows in a `.circleci/config.yml` file using the YAML syntax.
2222

23-
CircleCI supports multiple environments, including **Docker**, **Linux**, **macOS**, and **Windows**, and offers advanced features like **parallelism**, **caching**, and **matrix builds** to speed up pipelines and improve efficiency.
23+
CircleCI supports multiple platforms, including Linux, macOS, and Windows, and offers advanced features like parallelism, caching, and matrix builds to speed up pipelines and improve efficiency.
2424

25-
It is widely used for **automating tests, running builds, deploying applications, and ensuring code quality** in modern development workflows. Learn more from the [CircleCI official website](https://circleci.com/) and its [documentation](https://circleci.com/docs/).
25+
It is widely used for automating tests, running builds, deploying applications, and ensuring code quality in modern development workflows. Learn more from the [CircleCI official website](https://circleci.com/) and its [documentation](https://circleci.com/docs/).

content/learning-paths/servers-and-cloud-computing/circleci-gcp/circleci-arm64-cloud-demo.md

Lines changed: 99 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,69 +6,97 @@ weight: 8
66
layout: learningpathall
77
---
88

9-
## Deploying a Cloud-Native Arm64 Node.js App using self-hosted CircleCI Runner on GCP
9+
## Deploying a Cloud-Native Arm64 Node.js App Using a Self-Hosted CircleCI Runner on GCP
1010

11-
This guide walks through building and testing a simple **Node.js web app** using a **self-hosted CircleCI Arm64 runner** on a **GCP SUSE Arm64 VM**.
11+
This section demonstrates how to build and test a simple Node.js web application using a self-hosted CircleCI runner running on a Google Cloud C4A (Axion Arm64) SUSE Linux virtual machine.
1212

13+
You’ll configure Docker on the VM so that CircleCI jobs can build, test, and run containerized applications directly in your Arm64 environment, ideal for cloud-native development and CI/CD workflows targeting Arm architecture.
1314

14-
### Install and Configure Docker
15-
Ensure Docker is installed, started, and accessible by both your user and the CircleCI runner service.
1615

17-
- **Install Docker**: Refresh your package manager and install Docker on your system.
18-
- **Enable Docker Service**: Ensure Docker starts on boot and is running.
19-
- **Add User to Docker Group**: Add both your user and the CircleCI runner to the Docker group to grant access.
16+
### Install and Configure Docker
17+
Ensure Docker is installed, enabled, and accessible by both your local user and the CircleCI runner service.
2018

21-
```console
19+
1. Install Docker
20+
Refresh your package manager and install Docker on your system:
21+
```bash
2222
sudo zypper refresh
2323
sudo zypper install docker
24+
```
25+
2. Enable and start Docker service
26+
Set Docker to start automatically at boot and verify it’s running:
27+
```bash
2428
sudo systemctl enable docker
2529
sudo systemctl start docker
2630
sudo systemctl status docker
31+
```
32+
3. Grant Docker access to users
33+
Add both your current user and the circleci system user to the Docker group so they can run Docker commands without sudo:
34+
```bash
2735
sudo usermod -aG docker $USER
2836
sudo usermod -aG docker circleci
2937
```
3038
### Validate Docker access
31-
This command switches to the CircleCI user and checks if Docker is working correctly.
39+
After installing Docker and adding the circleci user to the Docker group, verify that the CircleCI runner user can access Docker without requiring elevated privileges.
3240

33-
```console
41+
Run the following commands:
42+
```bash
3443
sudo -u circleci -i
3544
docker ps
3645
exit
3746
```
3847

3948
### Verify Docker Permissions
40-
Check Docker socket permissions and ensure that the CircleCI runner is active and running.
49+
Now, confirm that Docker’s socket permissions and the CircleCI runner service are both configured correctly.
4150

42-
```console
51+
```bash
4352
ls -l /var/run/docker.sock
4453
ps -aux | grep circleci-runner
4554
```
46-
- **Check Docker Socket Permissions**: This command ensures the Docker socket is accessible.
47-
- **Verify CircleCI Runner Process**: Confirm the CircleCI runner service is active and running.
55+
These commands ensure that the Docker socket is accessible and the CircleCI runner service is active and running.
4856

49-
### **Install Node.js and npm**
57+
Once both checks pass, your environment is ready to build and run container-based pipelines with CircleCI on SUSE Arm64.
5058

51-
Before proceeding with the app setup, please make sure **Node.js** and **npm** (Node.js package manager) are installed on the VM, as they are required to run your Node.js app.
59+
### Install Node.js and npm
5260

53-
- **Install Node.js**: Use the official Node.js package for Arm64 architecture.
54-
- **Install npm**: npm is automatically installed when Node.js is installed.
61+
Before setting up the sample application, ensure that `Node.js` and its package manager `npm` are installed on your SUSE Arm64 VM. Both are required to run, build, and test the `Node.js` web application within your CircleCI pipeline.
62+
63+
- Install Node.js: Install the official Node.js package built for the Arm64 architecture.
64+
- Install npm: npm (Node Package Manager) is bundled with Node.js but can also be explicitly installed or upgraded if needed.
5565

5666
```console
5767
sudo zypper install nodejs
5868
sudo zypper install npm
5969
```
60-
### Clone Your App Repository
61-
Clone your application repository (or create one locally):
70+
Next, you’ll create the demo project and prepare its CircleCI configuration to run jobs using your self-hosted Arm64 runner.
71+
72+
### Create a repository for your example code
73+
To store and manage your Node.js demo application, you’ll create a new GitHub repository using the GitHub CLI.
74+
75+
1. Install the GitHub CLI
76+
The GitHub CLI (gh) lets you manage repositories, issues, and pull requests directly from your terminal.
77+
78+
```bash
79+
sudo zypper install -y gh
80+
```
81+
2. Authenticate with GitHub
82+
Run the following command to connect the CLI to your GitHub account:
83+
84+
```bash
85+
gh auth login
86+
```
87+
88+
3. Create a New Repository
89+
Create a new public repository for your demo project and clone it locally:
6290

6391
```console
64-
git clone https://github.com/<your-repo>/arm64-node-demo.git
92+
gh repo create arm64-node-demo --public --clone
6593
cd arm64-node-demo
6694
```
6795

6896
### Create a Dockerfile
69-
In the root of your project, create a `Dockerfile` that defines how to build and run your application container.
97+
In the root of your project, create a file named `Dockerfile` to define how your `Node.js` application container will be built and executed.
7098

71-
```dockerfile
99+
```console
72100
# Dockerfile
73101
FROM arm64v8/node:20-alpine
74102
WORKDIR /app
@@ -78,13 +106,18 @@ COPY . .
78106
EXPOSE 3000
79107
CMD ["npm", "start"]
80108
```
81-
- **Use Arm64 Node.js Image**: The `arm64v8/node` image is specifically designed for Arm64 architecture.
82-
- **Install Dependencies**: `RUN npm install` installs the project dependencies listed in `package.json`.
83-
- **Expose Port**: The app will run on port 3000.
84-
- **Start the App**: The container will execute `npm start` to launch the Node.js server.
109+
Breakdown of the Dockerfile:
110+
111+
- Uses Arm64 Node.js Image: The `arm64v8/node` image is specifically designed for Arm64 architecture.
112+
- Install Dependencies: `RUN npm install` installs the project dependencies listed in `package.json`.
113+
- Expose Port: The app will run on port 3000.
114+
- Start the App: The container will execute `npm start` to launch the Node.js server.
115+
116+
Next, you’ll add the application code and a `.circleci/config.yml` file to automate the build and test pipeline using your self-hosted Arm64 runner.
85117

86118
### Add a CircleCI Configuration
87-
Create a `.circleci/config.yml` file to define the CircleCI pipeline for building and testing your Node.js app on Arm64 architecture.
119+
Create a configuration file that defines your CircleCI pipeline for building, running, and testing your Node.js app on Arm64 architecture.
120+
In the root of your project, create a folder named `.circleci` and inside it, add a file called `config.yml` with the contents below:
88121

89122
```yaml
90123
version: 2.1
@@ -124,14 +157,17 @@ workflows:
124157
jobs:
125158
- arm64-demo
126159
```
127-
- **arm64-demo Job**: This job checks if the architecture is Arm64, builds the Docker image, runs it in a container, and tests the app endpoint.
128-
- **resource_class**: Specify the resource class for the CircleCI runner (e.g., a custom Arm64 runner if using self-hosted).
129-
- **Test Endpoint**: The job sends a request to the app to verify it’s working.
160+
161+
Explanation of the yaml file:
162+
163+
- arm64-demo Job: This job checks if the architecture is Arm64, builds the Docker image, runs it in a container, and tests the app endpoint.
164+
- resource_class: Specify the resource class for the CircleCI runner (e.g., a custom Arm64 runner if using self-hosted).
165+
- Test Endpoint: The job sends a request to the app to verify it’s working.
130166
131167
### Node.js Application
132-
Here’s the basic code for the Node.js app.
168+
Create the application files in your repository root directory for the Node.js app.
133169
134-
`index.js`:
170+
Use a file editor of your choice and copy the contents shown below into a file named `index.js`:
135171

136172
```javascript
137173
const express = require('express');
@@ -146,7 +182,8 @@ app.listen(PORT, () => {
146182
console.log(`Server running on port ${PORT}`);
147183
});
148184
```
149-
package.json
185+
186+
Now copy the content below into a file named `package.json`:
150187

151188
```json
152189
{
@@ -162,53 +199,65 @@ package.json
162199
}
163200
}
164201
```
165-
- **Express Server**: The application uses Express.js to handle HTTP requests and respond with a simple message.
166-
- **Package Dependencies**: The app requires the `express` package for handling HTTP requests.
202+
- Express Server: The application uses Express.js to handle HTTP requests and respond with a simple message.
203+
- Package Dependencies: The app requires the `express` package for handling HTTP requests.
167204

168205
### Push Code to GitHub
169206

170-
Once all files (`Dockerfile`, `index.js`, `package.json`, `.circleci/config.yml`) are ready, push your project to GitHub so CircleCI can build it automatically.
207+
Now that all project files (Dockerfile, index.js, package.json, and .circleci/config.yml) are ready, push the code to GitHub.
208+
This allows CircleCI to automatically detect the repository and trigger your Arm64 build pipeline using the self-hosted runner.
209+
210+
Configure Git username and add and commit project files:
171211

172212
```console
213+
git config --global user.name "your-user-name"
173214
git add .
174215
git commit -m "Add ARM64 CircleCI Node.js demo project"
175216
git push -u origin main
176217
```
177-
- **Add and Commit Changes**: Stage and commit your project files.
178-
- **Push to GitHub**: Push your code to the GitHub repository so that CircleCI can trigger the build.
218+
You have pushed your code to the GitHub repository so that CircleCI can trigger the build.
179219

180220
### Start CircleCI Runner and Execute Job
181-
Ensure that your CircleCI runner is enabled and started. This will allow your self-hosted runner to pick up jobs from CircleCI.
221+
Before triggering your first workflow, ensure that the CircleCI runner service is enabled and running on your SUSE Arm64 VM. This will allow your self-hosted runner to pick up jobs from CircleCI.
182222

183-
```console
223+
```bash
184224
sudo systemctl enable circleci-runner
185225
sudo systemctl start circleci-runner
186226
sudo systemctl status circleci-runner
187227
```
188-
- **Enable CircleCI Runner**: Ensure the CircleCI runner is set to start automatically on boot.
189-
- **Start and Check Status**: Start the CircleCI runner and verify it is running.
228+
- Enable CircleCI Runner: Ensures the runner service starts automatically on system boot.
229+
- Start and Check Status: Starts the CircleCI runner and verifies it is running.
230+
190231

191-
After pushing your code to GitHub, open your **CircleCI Dashboard → Projects**, and confirm that your **ARM64 workflow** starts running using your **self-hosted runner**.
232+
### Verify Job Execution in CircleCI
233+
234+
After pushing your code to GitHub, open your CircleCI Dashboard → Projects, and confirm that your Arm64 workflow starts running using your self-hosted runner.
192235

193236
If the setup is correct, you’ll see your job running under the resource class you created.
194237

195238
### Output
196-
Once the job starts running, CircleCI will:
239+
When the CircleCI workflow starts running on your self-hosted Arm64 runner, you’ll see the following stages executed in your CircleCI Dashboard:
197240

198-
- Detect the ARM64 architecture.
241+
1. Detect the ARM64 Architecture
242+
CircleCI confirms the job is executing on your Arm64 self-hosted runner. This validates that the pipeline is correctly targeting your Google Cloud C4A (Axion) VM.
199243

200244
![CircleCI Dashboard alt-text#center](images/output1.png "Figure 1: Show architecture")
201245

202-
- Build the Docker image.
246+
2. Build the Docker image
247+
The runner builds the `arm64-node-demo` Docker image using the Dockerfile you defined.
203248

204249
![CircleCI Dashboard alt-text#center](images/output2.png "Figure 2: Docker Image")
205250

206-
- Runs a container from that image.
251+
3. Runs a container from that Image
252+
Once the image is built, the job launches a container to host your Node.js web app.
207253

208254
![CircleCI Dashboard alt-text#center](images/output4.png "Figure 3: Container Run")
209255

210-
- Test the application by hitting the endpoint.
211-
256+
4. Test the application by hitting the endpoint.
257+
The workflow tests the running app by sending an HTTP request to http://localhost:3000.
212258
![CircleCI Dashboard alt-text#center](images/output3.png "Figure 3: Verify App")
259+
If the app responds successfully, the test confirms that the Node.js web server is running correctly inside the container.
213260

214261
If successful, you will see your CircleCI job running and the app deployed in the CircleCI Dashboard.
262+
263+
This demonstrates an end-to-end cloud-native CI/CD workflow running natively on SUSE Arm64 with Google Cloud C4A (Axion) as a self-hosted runner on CircleCI.

content/learning-paths/servers-and-cloud-computing/circleci-gcp/create_resource_class.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,38 @@ layout: learningpathall
77
---
88

99
## Create a Resource Class for Self-Hosted Runner in CircleCI
10-
This guide explains how to create a **Resource Class** in the **CircleCI Web Dashboard** for a **self-hosted runner**.
11-
A Resource Class defines a unique identifier for your runner and links it to your CircleCI namespace, allowing CircleCI jobs to target your custom machine environment.
10+
This section explains how to create a Resource Class in the CircleCI Web Dashboard for a self-hosted runner.
11+
A Resource Class is a unique identifier that links your self-hosted runner to your CircleCI organization (namespace). It defines the “machine type” that CircleCI jobs can target, ensuring that only authorized jobs run on your managed infrastructure, in this case, your SUSE Linux Arm64 VM on Google Cloud C4A (Axion).
1212

1313
### Steps
1414

15-
1. **Go to the CircleCI Web Dashboard**
16-
- From the left sidebar, navigate to **Self-Hosted Runners**.
17-
- You’ll see a screen asking you to accept the **terms of use**.
18-
- **Check the box** that says **“Yes, I agree to the terms”** to enable runners.
19-
- Then click **Self-Hosted Runners** to continue setup.
15+
1. Open the CircleCI Web Dashboard
16+
- Login or Create a new account at [CircleCI](https://app.circleci.com/home)
17+
- In the left-hand navigation panel, click Self-Hosted Runners.
18+
- If this is your first time setting up runners, you’ll be prompted to accept the Terms of Use.
19+
Check “Yes, I agree to the terms” to enable runner functionality for your organization.
20+
- After accepting, click Self-Hosted Runners again to continue the setup process.
2021

2122
![Self-Hosted Runners alt-text#center](images/shrunner0.png "Figure 1: Self-Hosted Runners ")
2223

23-
2. **Create a New Resource Class**
24+
2. Create a New Resource Class
2425

25-
Click **Create Resource Class** on your CircleCI dashboard.
26+
On your CircleCI Dashboard, click Create Resource Class.
2627

27-
**Fill in the following details:**
28+
Fill in the following details:
2829

29-
- **Namespace:** Your CircleCI username or organization name (e.g., `circleci`)
30-
- **Resource Class Name:** A clear, descriptive name for your runner (e.g., `arm64`)
31-
- Click **Create Resource Class**.
30+
* Namespace: Your CircleCI organization or username (e.g., circleci)
31+
* Resource Class Name: A clear, descriptive identifier for your runner (e.g., arm64)
32+
* Once complete, click Create Resource Class to generate it.
3233

3334
![Self-Hosted Runners alt-text#center](images/shrunner1.png "Figure 2: Create Resource Class ")
3435

3536
![Self-Hosted Runners alt-text#center](images/shrunner2.png "Figure 3: Details Resource Class & Namespace")
3637

37-
3. **Save and Copy the Token**
38-
- Once created, CircleCI will generate a **Resource Class Token**.
39-
- Copy this token and store it securely — you will need it to register your runner on the GCP VM.
38+
3. Save and Copy the Token
39+
40+
After creating the resource class, CircleCI automatically generates a Resource Class Token, a secure authentication key used to register your runner. Copy this token immediately and store it in a secure location.
41+
You’ll need this token in the next step to connect your SUSE Arm64 runner on the Google Cloud C4A (Axion) VM to CircleCI.
4042

4143
![Self-Hosted Runners alt-text#center](images/shrunner3.png "Figure 4: Resource Class Token")
4244

0 commit comments

Comments
 (0)