Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: CircleCI Arm Native Workflows on SUSE Arm (GCP VM)

draft: true
cascade:
draft: true

minutes_to_complete: 45

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.

learning_objectives:
- Provision a SUSE Arm64 virtual machine on Google Cloud (C4A with Axion processors)
- Install and configure CircleCI self-hosted machine runners on Arm64
- Create a cloud-native Node.js demo app to run on the self-hosted Arm runner
- Write and execute a CircleCI workflow using a custom Arm resource class
- Test CircleCI workflows locally and understand job execution on Arm64 runners

prerequisites:
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free) account with billing enabled
- Basic familiarity with Linux command line, Node.js, and npm
- Basic understanding of CircleCI concepts such as
[workflows](https://circleci.com/docs/guides/orchestrate/workflows/),
[jobs](https://circleci.com/docs/guides/orchestrate/jobs-steps/),
[resource classes](https://circleci.com/docs/guides/execution-managed/resource-class-overview/), and
[runners](https://circleci.com/docs/guides/execution-runner/runner-overview/)


author: Pareena Verma

##### Tags
skilllevels: Introductory
subjects: CI-CD
cloud_service_providers: Google Cloud

armips:
- Neoverse

tools_software_languages:
- CircleCI
- Node.js
- npm
- Express
- Docker

operatingsystems:
- Linux

# ================================================================================
# FIXED, DO NOT MODIFY
# ================================================================================
further_reading:
- resource:
title: Google Cloud documentation
link: https://cloud.google.com/docs
type: documentation

- resource:
title: CircleCI Self-Hosted Runner Documentation
link: https://circleci.com/docs/guides/execution-runner/install-machine-runner-3-on-linux/
type: documentation

- resource:
title: CircleCI CLI Documentation
link: https://circleci.com/docs/guides/toolkit/local-cli/
type: documentation

- resource:
title: Node.js Express Documentation
link: https://expressjs.com/
type: documentation

weight: 1
layout: "learningpathall"
learning_path_main_page: "yes"
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# ================================================================================
# FIXED, DO NOT MODIFY THIS FILE
# ================================================================================
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
title: "Next Steps" # Always the same, html page title.
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Getting started with CircleCI on Google Axion C4A (Arm Neoverse-V2)

weight: 2

layout: "learningpathall"
---

## Google Axion C4A Arm instances in Google Cloud

Google Axion C4A 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 for modern cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications.

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

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

## CircleCI

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

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**.

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.

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/).
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
---
title: CircleCI Arm64 Cloud-Native Demo
weight: 8

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Deploying a Cloud-Native Arm64 Node.js App using self-hosted CircleCI Runner on GCP

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**.


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

- **Install Docker**: Refresh your package manager and install Docker on your system.
- **Enable Docker Service**: Ensure Docker starts on boot and is running.
- **Add User to Docker Group**: Add both your user and the CircleCI runner to the Docker group to grant access.

```console
sudo zypper refresh
sudo zypper install docker
sudo systemctl enable docker
sudo systemctl start docker
sudo systemctl status docker
sudo usermod -aG docker $USER
sudo usermod -aG docker circleci
```
### Validate Docker access
This command switches to the CircleCI user and checks if Docker is working correctly.

```console
sudo -u circleci -i
docker ps
exit
```

### Verify Docker Permissions
Check Docker socket permissions and ensure that the CircleCI runner is active and running.

```console
ls -l /var/run/docker.sock
ps -aux | grep circleci-runner
```
- **Check Docker Socket Permissions**: This command ensures the Docker socket is accessible.
- **Verify CircleCI Runner Process**: Confirm the CircleCI runner service is active and running.

### **Install Node.js and npm**

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.

- **Install Node.js**: Use the official Node.js package for Arm64 architecture.
- **Install npm**: npm is automatically installed when Node.js is installed.

```console
sudo zypper install nodejs
sudo zypper install npm
```
### Clone Your App Repository
Clone your application repository (or create one locally):

```console
git clone https://github.com/<your-repo>/arm64-node-demo.git
cd arm64-node-demo
```

### Create a Dockerfile
In the root of your project, create a `Dockerfile` that defines how to build and run your application container.

```dockerfile
# Dockerfile
FROM arm64v8/node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
```
- **Use Arm64 Node.js Image**: The `arm64v8/node` image is specifically designed for Arm64 architecture.
- **Install Dependencies**: `RUN npm install` installs the project dependencies listed in `package.json`.
- **Expose Port**: The app will run on port 3000.
- **Start the App**: The container will execute `npm start` to launch the Node.js server.

### Add a CircleCI Configuration
Create a `.circleci/config.yml` file to define the CircleCI pipeline for building and testing your Node.js app on Arm64 architecture.

```yaml
version: 2.1

jobs:
arm64-demo:
machine: true
resource_class: <Your_resource_class>
steps:
- checkout
- run:
name: Show Architecture
command: |
ARCH=$(uname -m)
echo "Detected architecture: $ARCH"
if [ "$ARCH" = "aarch64" ]; then
echo "✅ Running on ARM64 architecture!"
else
echo "Not running on ARM64!"
exit 1
fi
- run:
name: Build Docker Image
command: docker build -t arm64-node-demo .
- run:
name: Run Docker Container
command: docker run -d -p 3000:3000 arm64-node-demo
- run:
name: Test Endpoint
command: |
sleep 5
curl http://localhost:3000

workflows:
version: 2
arm64-workflow:
jobs:
- arm64-demo
```
- **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.
- **resource_class**: Specify the resource class for the CircleCI runner (e.g., a custom Arm64 runner if using self-hosted).
- **Test Endpoint**: The job sends a request to the app to verify it’s working.

### Node.js Application
Here’s the basic code for the Node.js app.

`index.js`:

```javascript
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;

app.get('/', (req, res) => {
res.send('Hello from ARM64 Node.js app! 🚀');
});

app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
```
package.json

```json
{
"name": "arm64-node-demo",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"No tests yet\""
},
"dependencies": {
"express": "^4.18.2"
}
}
```
- **Express Server**: The application uses Express.js to handle HTTP requests and respond with a simple message.
- **Package Dependencies**: The app requires the `express` package for handling HTTP requests.

### Push Code to GitHub

Once all files (`Dockerfile`, `index.js`, `package.json`, `.circleci/config.yml`) are ready, push your project to GitHub so CircleCI can build it automatically.

```console
git add .
git commit -m "Add ARM64 CircleCI Node.js demo project"
git push -u origin main
```
- **Add and Commit Changes**: Stage and commit your project files.
- **Push to GitHub**: Push your code to the GitHub repository so that CircleCI can trigger the build.

### Start CircleCI Runner and Execute Job
Ensure that your CircleCI runner is enabled and started. This will allow your self-hosted runner to pick up jobs from CircleCI.

```console
sudo systemctl enable circleci-runner
sudo systemctl start circleci-runner
sudo systemctl status circleci-runner
```
- **Enable CircleCI Runner**: Ensure the CircleCI runner is set to start automatically on boot.
- **Start and Check Status**: Start the CircleCI runner and verify it is running.

After pushing your code to GitHub, open your **CircleCI Dashboard → Projects**, and confirm that your **ARM64 workflow** starts running using your **self-hosted runner**.

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

### Output
Once the job starts running, CircleCI will:

- Detect the ARM64 architecture.

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

- Build the Docker image.

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

- Runs a container from that image.

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

- Test the application by hitting the endpoint.

![CircleCI Dashboard alt-text#center](images/output3.png "Figure 3: Verify App")

If successful, you will see your CircleCI job running and the app deployed in the CircleCI Dashboard.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Create Resource Class in CircleCI
weight: 5

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Create a Resource Class for Self-Hosted Runner in CircleCI
This guide explains how to create a **Resource Class** in the **CircleCI Web Dashboard** for a **self-hosted runner**.
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.

### Steps

1. **Go to the CircleCI Web Dashboard**
- From the left sidebar, navigate to **Self-Hosted Runners**.
- You’ll see a screen asking you to accept the **terms of use**.
- **Check the box** that says **“Yes, I agree to the terms”** to enable runners.
- Then click **Self-Hosted Runners** to continue setup.

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

2. **Create a New Resource Class**

Click **Create Resource Class** on your CircleCI dashboard.

**Fill in the following details:**

- **Namespace:** Your CircleCI username or organization name (e.g., `circleci`)
- **Resource Class Name:** A clear, descriptive name for your runner (e.g., `arm64`)
- Click **Create Resource Class**.

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

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

3. **Save and Copy the Token**
- Once created, CircleCI will generate a **Resource Class Token**.
- Copy this token and store it securely — you will need it to register your runner on the GCP VM.

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

Now that your resource class and token are generated, proceed to the next section to set up the CircleCI self-hosted runner.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading