Skip to content

sw360cab/arc-tideline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arc Tideline

This projects shows how to create a Kubernetes cluster provided with a set of autoscaling self-hosted runners handling Github Actions and driven by ARC and Karpenter.

Any existing Github action is able to point to this infra just by adding the ARC runner label in the runs-on directing in the GH Actions manifest.

A placeholder application and relative GH workflows are provided to show of this can be seamlessly usded in any dev/production environment.

Architecture

The whole system while be composed on 3 pilars:

  • ARC system: allowing deployment of self-hosted runner on this cluster
  • Dagger system: a DaemonSet running the Dagger engine on each allocated ARC runner
  • Buildkit: providing consistent caches across multiple runs of building of Docker images
  • Karpenter (on AWS EKS cluster): handling scaling, upsizing, downszing of node pools which hanldes the runner according to specific policies

Provisioning

Terraform plan provisioning by spinning:

  • one Kube cluster (EKS in this case but can be KinD locally for dev testing)
  • generic nodes for Karpenter scheduler

See Provisioning

Local cluster (KinD)

For local development a KinD cluster can be used is. The config at cluster/kind/kind.yaml pre-labels the control-plane node with dagger.sh/engine=true, which is required by the Dagger engine DaemonSet's node affinity.

kind create cluster --name arc-ci --config=cluster/kind/kind.yaml

Deployment

Helm and Devspace spin the full deployment of releases, manifests

Autoscaling

Karpenter handles autoscaling of self-hosted runners using different classes that are taylored to the type of workload.

As a placeholder 3 classes are provided, they should be tuned but aim to mimic different kind of workloads:

  • medium
  • large
  • xlarge

Persistence

For specifik cases (e.g. building Docker images) a persistent layer provided with Buildkit can be added. it allows to have consistent Buildkit caches across multiple runs of any workload using any Docker buliding procedure.

Running

Prerequisites

Deploy in Local Environment

  • Run
cd cluster/devspace
devspace deploy

Deploy in AWS EKS Kube Environment

  • Run (including Karpenter node pools)
cd cluster/devspace
devspace run-pipeline deploy-prod

Cleanup

  • Run
cd cluster/devspace
devspace purge

See Also

Dagger

ARC

Karpenter

About

Autoscaling Self-hosted Github Runners leveraging ARC and Karpenter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors