Skip to content

daelious/multi-architecture-cicd

 
 

Repository files navigation

multi-architecture-cicd

This project deploys self-hosted GitHub runners to be used for multi-architecture builds and offers up to 90% faster builds. The implementation is reflective of a CI/CD solution we built for a mid-size security startup.

Typically, multi-architecture builds leverage an emulation tool like QEMU to enable cross-platforms builds from a single machine. This offers a simpler configuration, but delivers a significant perfomance hit when emulating another architecture.

Our solution uses the native node strategy to give us the performance gains of native architecture builds, but still supporting multi-architecture manifests.

Going through the guide, you will notice how the native-build action (self-hosted runners) runs roughly 90% faster than the emulated-build action (github-hosted runners).

Business Impact

Improving build times has a direct impact on DORA metrics. Primarily on the Lead time for changes and Time to restore, but has an impact on all metrics. If this use-case fits your purposes, the drop in build times could have a significant impact on your teams DORA report.

Pre-requisuites

Guide

  1. Generate GitHub PAT

    Follow these docs to generate a PAT that the self-hosted runners will use to register with the target repository/organization.

  2. Update the variables.tf

    You can update the variables.tf with the config url and pat or create a .tfvars file

      variable "github_config" {
        type = object({
          config_url = string
          pat = string
        })
        default = {
        config_url = "https://github.com/${organization}/${repo}"
        pat = "${github_pat}"
      }
    }
  3. Initialize AZ CLI

run the following commands to initialize your az cli

az cloud set --name AzureCloud
az login
az account set --subscription ${subscription}
  1. Deploy Cluster
terraform init
terraform plan
terraform apply -auto-approve
  1. Create a PR to validate pipelines

Update the REGISTRY value to match your ghcr repository, push your changes, and create a Pull Request. This will trigger the emulated-build and native-build to kickoff.

Tooling Docs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 83.6%
  • Dockerfile 16.4%