Skip to content

Latest commit

 

History

History
73 lines (57 loc) · 2.8 KB

File metadata and controls

73 lines (57 loc) · 2.8 KB

GitHub Actions Builders

Free builders that run on ubuntu-latest. They tunnel to Redis and run build jobs distributed by Chaotic Manager.

What it does

  • It creates builders on free public runners.
  • It opens a tunnel to Redis with autossh.
  • It runs the builder. With BUILDER_EXIT_AFTER_BUILD=true it exits after one package.
  • Without it, it runs for 340m.
  • Then it checks the queue. If jobs remain, it starts new builders.

How it works

  1. Each runner starts a builder. The builder name is gh-1, gh-2, and more.
  2. The builder opens a tunnel: autossh -L 6380:127.0.0.1:6379.
  3. With BUILDER_EXIT_AFTER_BUILD=true the builder builds one package and exits.
  4. Without it, the builder runs for 340m or whatever is given as input.
  5. After the builder stops, https://builds.garudalinux.org/api/queue/stats is checked queued packages.
  6. If processable jobs remain, it starts the builder again, otherwise, the run finishes.

Use

Option A — Call the workflow

Add this file to your repo:

name: Chaotic Builder
on:
  workflow_dispatch:
jobs:
  call-builder:
    uses: chaotic-aur/builders/.github/workflows/builder.yml@main
    with:
      builders: 
      runtime: "340m"
      manager_url: https://builds.garudalinux.org
      builder_class: "6"
    secrets:
      REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
      DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
      REDIS_SSH_HOST: ${{ secrets.REDIS_SSH_HOST }}
      REDIS_SSH_PORT: ${{ secrets.REDIS_SSH_PORT }}
      REDIS_SSH_USER: ${{ secrets.REDIS_SSH_USER }}
      DATABASE_HOST: ${{ secrets.DATABASE_HOST }}

Option B — Copy the file

Copy .github/workflows/builder.yml to your repo. Set the same secrets.

Secrets

Name Required Default
REDIS_PASSWORD yes -
DEPLOY_KEY yes SSH key for tunnel and upload
REDIS_SSH_HOST yes aerialis.garudalinux.org
REDIS_SSH_PORT no 270
REDIS_SSH_USER no package-deployer
REDIS_PORT no 6379
DATABASE_HOST no builds.garudalinux.org:210
MANAGER_URL no https://builds.garudalinux.org

Do not set REDIS_HOST. The tunnel sets it to 127.0.0.1.

Settings

  • builders: 4 starts 4 runners (gh-1 to gh-4). Maximum is 20. If you do not set it, it uses the number of waiting and processable jobs.
  • runtime: 340m leaves time for the queue check.
  • builder_class: "6" builds packages with build_class 6 or less.
  • BUILDER_EXIT_AFTER_BUILD=true makes each runner build one package and exit when no more processable jobs can be handled.