DevSecOps and Automation on Power

DevSecOps and Automation on Power

Connect, learn, share, and engage with IBM Power.

 View Only

Building multi-arch images using self-hosted runners on CircleCI

By Mayur Waghmode posted Mon October 03, 2022 09:30 AM

  

Pre-requisites:

  • A user account on GitHub
  • An x86 VM for adding a self-hosted runner to the CircleCI
  • An ppc64le VM for executing the CircleCI job
  • Install Podman and Buildah on the x86 and ppc64le VMs:
sudo yum -y install podman buildah

Step 0: Create accounts on the basic services required

Step 1: Setup the Quay repository with a new Robot account

Step 2: Generate SSH key

cd ~/.ssh
ssh-keygen -o -t rsa

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

cat ~/.ssh/id_rsa.pub
vi ~/.ssh/authorized_keys

Step 4: Test SSH connection using the private key

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

Step 5: Setup the Github repository

Step 6: Set up your Build on CircleCI

  1. For this step, you will need a CircleCI account. Visit the CircleCI signup page and click “Sign Up with GitHub”. You will need to give CircleCI access to your GitHub account to run your builds. If you already have a CircleCI account then you can navigate to your dashboard.
  2. Next, you need to add your repo as a new project on CircleCI. To add your new repo, ensure that your GitHub account is selected in the dropdown in the upper-left, find the repository you just created below, and click the Setup project button next to it.
  3. On the redirected page, you will notice three options (Fastest, Faster and Fast), with Fastest selected as the default. We’ll use this default option.
  4. Enter hosted-multi-arch in the input field for the GitHub branch (notice the text underneath the field confirming the presence of the .circleci/config.yml file) and click Set Up Project.

Step 7: Add a self-hosted runner to CircleCI

Step 8: Set an environment variable in a project

  1. On the CircleCI web app, click the Project Settings button on the project’s individual Pipelines page.
  2. Click on Environment Variables in the side navigation.
  3. Click the Add Variable button to enter the name and value of the new environment variable.
GH_REPO : Name of your GitHub Repo
PPC64LE_MACHINE_IP : IP of ppc64le
VM
QUAY_REPO : Quay repository url for publishing images eg. quay.io/<user>/<repository-name>
QUAY_USER : Quay Robot user
QUAY_PASS : Quay Robot token

Step 9: Re-trigger the CircleCI build

0 comments
747 views

Permalink