GitHub Actions: Self-hosted runners on ppc64le architectures

Mayur Waghmode
4 min readJul 6, 2022

--

What is GitHub Actions?

GitHub Actions enables you to “automate, customize, and execute your CICD pipeline right in your [GitHub] repository.” This means that you can create workflows or pipelines without ever leaving GitHub, assuming your source code is hosted there.

GitHub Actions officially supports self-hosted runners on the x86, ARM, and ARM64 architectures. However, it does not have official support for ppc64le architecture yet.

The aim of the blog is to help interested users in executing the GitHub Actions workflow on a ppc64le machine from the self-hosted runner registered on the x86 machine. To achieve this we are going to do an SSH from the x86 machine (self-hosted runner will be registered here) to the ppc64le machine.

Pre-requisites

  • Account on GitHub
  • x86 VM for adding a self-hosted runner to the GitHub repository and it will also act as a bastion for SSHing into the ppc64le VM
  • ppc64le VM for executing the GitHub Actions workflow

You can use the PowerVS service at IBM Cloud or Minicloud to get your ppc64le virtual machine.

This example uses both centos 8 VMs.

Step 0: Generate SSH key

If you already do not have the ssh key pair then follow the below steps to generate it.

i] First, navigate to the .ssh directory on your x86 machine,

cd ~/.ssh

ii]Generate the SSH key,

ssh-keygen -o -t rsa

Press Enter to complete with the default configurations, we will leave that passphrase empty for now but, you can use it to add extra security to your key.

iii] When you type ls you should find two files: id_rsa and id_rsa.pub.

id_rsa has the private key while id_rsa.pub has the public key.

Step 1: Add public ssh key to the authorized_keys file of a ppc64le VM

First view/copy the contents of your recently generated public key id_rsa.pub on the x86 machine. The public ssh key begins with "ssh-rsa" and ends with your email address:

cat ~/.ssh/id_rsa.pub

Login to your ppc64le VM and editauthorized_keys file by putting the contents of your public key below any other keys in that file:

vi ~/.ssh/authorized_keys

Step 2: Test SSH connection using the private key

Just to make sure that the public ssh key is added correctly to the authorized_keys file of a ppc64le VM, try SSHing into the ppc64le machine from the x86 machine with the corresponding private key.

ssh -i /root/.ssh/id_rsa username@hostname

The above output confirms that our ssh connection is working as expected :)

Step 3: Setup the Github repository

Create a new repository or simply fork this repository into your GitHub account.

Step 4: Create a repository secret for customizing your build

To avoid exposing the IP address of your ppc64le machine, create an Environment variable for storing it. Go to Settings > Secrets > Actions > New repository secret and add PPC64LE_MACHINE_IP variable.

Step 5: Adding a self-hosted runner to a GitHub repository

Follow these instructions for adding a self-hosted runner to the GitHub repository on an x86 machine.

During configuration, the CLI will prompt you to answer a few questions, including naming the runner and determining the output directory for any jobs.

Once your runner is successfully configured and listening for jobs, it will display as idle which means you’re ready to update your workflow.

Step 6: Configure the GitHub Actions workflow

For the very first time, you need to enable a workflow for your GitHub repository, follow this to do that.

For triggering the workflow, commit the changes in any of the files of your GitHub repository. Doing that, our workflow named “Github Actions runner on ppc64le” will get triggered. To view the workflow results, follow this.

In no time, this script will get executed on a ppc64le machine.

Troubleshooting

While configuring the self-hosted runner on an x86 machine if you encountered an error Must not run with sudothen export the below variable. After this, re-run the configuration commands.

export RUNNER_ALLOW_RUNASROOT="1"

That’s it! Thanks for reading! I hope you found this tutorial helpful. Feel free to reach out in case of any queries. Happy learning!

--

--