GitHub Actions Poll Mode AutoScaler (GAPMAS)

Overview

GitHub Actions Poll Mode AutoScaler (GAPMAS)

What

GitHub Actions Poll Mode AutoScaler, or GAPMAS, is a simple tool that helps you run ephemeral GitHub Actions self-hosted runners on your own infrastructure.

Why

  • Simplicity

    Minimal infrastructure is required to use the tool, in its simplest form this could be managed from a crontab entry on any Linux machine.

  • Poll vs. Push

    The tool reaches out to the GitHub API to look for any queued jobs. The benefit of this approach is that you don't need any service exposed to the internet for this to work.

How

  1. Create GitHub Personal Access Token

    • Personal Access Tokens are associated with a GitHub Account.
    • The account itself needs Admin level permissions to the repository you want to manage runners for.
    • The personal access token requires the public_repo scope.
  2. Set up Environment variables

    Environment variables

    GH_ORG

    The GitHub organization the repository given in GH_REPO resides in.

    GH_REPO

    Name of the GitHub repository we operate on.

    GH_USER

    Username for authentication to the GitHub API.

    GH_TOKEN

    GitHub Personal Access Token.

    OS_KEY_NAME

    Name of OpenStack key pair to associate with the instances we create.

    OS_NETWORK_NAME

    Name of OpenStack network to attach to the instances we create.

    OS_TAG

    Tag to apply to instances. The tool will manage the life cycle of instances and uses this tag to know which instances to operate on.

    • OpenStack client environment
      • The OpenStack provider makes use of the standard OpenStack environment variables for authentication.
  3. Set up a job manager to run the tool periodically

    • When a change is proposed to a repository with workflows destined to self-hosted runners, GitHub will queue the job until a runner consumes it.
    • The tool makes use of this behavior to create new runners whenever there are jobs queued.
    • As such choose a cadence for the run which is in line with how long you would expect to wait before your jobs start.
  4. Create workflow in repository

    • Workflow jobs with 'self-hosted' as the first label in runs-on will be scheduled for self hosted runners.

    • Labels on the form 'distro-release' will be used as input for what type of image you want the job to run on. Example:

      name: Take out tests
      
      on:
        - push
        - pull_request
      
      jobs:
        hello:
          runs-on: [self-hosted, ubuntu-21.10]
          steps:
            - name: hello
              run: |
                echo "Hello, world!"
    • If an image matching the requested distro/release can not be found the tool will fall back to look for a Ubuntu 20.04 image.

You might also like...
A GitHub Actions repo for tracking the dummies sending free money to Alex Jones + co.

A GitHub Actions repo for tracking the dummies sending free money to Alex Jones + co.

Automation that uses Github Actions, Google Drive API, YouTube Data API and youtube-dl together to feed BackJam app with new music

Automation that uses Github Actions, Google Drive API, YouTube Data API and youtube-dl together to feed BackJam app with new music

42-event-notifier - 42 Event notifier using 42API and Github Actions
42-event-notifier - 42 Event notifier using 42API and Github Actions

42 Event Notifier 42서울 Agenda에 새로운 이벤트가 등록되면 알려드립니다! 현재는 Github Issue로 등록되므로 상단

GitHub Actions Docker training

GitHub-Actions-Docker-training Training exercise repository for GitHub Actions using a docker base. This repository should be cloned and used for trai

A discord.py bot template with easy deployment through Github Actions
A discord.py bot template with easy deployment through Github Actions

discord.py bot template A discord.py bot template with easy deployment through Github Actions. You can use this template to just run a Python instance

Change between dark/light mode depending on the ambient light intensity
Change between dark/light mode depending on the ambient light intensity

svart Change between dark/light mode depending on the ambient light intensity Installation Install using pip $ python3 -m pip install --user svart Ins

⬇️ Telegram Bot to download TikTok videos without watermark in a snap with Inline mode support.
⬇️ Telegram Bot to download TikTok videos without watermark in a snap with Inline mode support.

⬇️ Tokmate - Telegram Bot to download TikTok videos ⛲ Features Superfast and supports all type of TikTok links Download any TikTok videos without mate

A better rename and convert bot with upload mode option and Auto detection

A better rename and convert bot with upload mode option and Auto detection

GitHub Activity Generator - A script that helps you instantly generate a beautiful GitHub Contributions Graph for the last year.
GitHub Activity Generator - A script that helps you instantly generate a beautiful GitHub Contributions Graph for the last year.

GitHub Activity Generator A script that helps you instantly generate a beautiful GitHub Contributions Graph for the last year. Before 😐 😶 😒 After ?

Owner
Frode Nordahl
Frode Nordahl
A github actions + python code to extract URLs to code repositories to put into standard form, starting with github

A github actions + python code to extract URLs to code repositories to put into standard form, starting with github ---- NOTE: JUS

Justin Gosses 2 Nov 15, 2021
Poll-Bot Repo For Telegram #telegram

Intro This Is A Simple Bot To Create Poll In Channel and Groups And Also This Is our First Project Too.. Enter you tokens at these are very important

BotsUniverse 6 Oct 21, 2022
Use GitHub Actions to create a serverless service.

ActionServerless - Use GitHub Actions to create a serverless service ActionServerless is an action to do some computing and then generate a string/JSO

null 107 Oct 28, 2022
可基于【腾讯云函数】/【GitHub Actions】/【Docker】的每日签到脚本(支持多账号使用)签到列表: |爱奇艺|全民K歌|腾讯视频|有道云笔记|网易云音乐|一加手机社区官方论坛|百度贴吧|Bilibili|V2EX|咔叽网单|什么值得买|AcFun|天翼云盘|WPS|吾爱破解|芒果TV|联通营业厅|Fa米家|小米运动|百度搜索资源平台|每日天气预报|每日一句|哔咔漫画|和彩云|智友邦|微博|CSDN|王者营地|

每日签到集合 基于【腾讯云函数】/【GitHub Actions】/【Docker】的每日签到脚本 支持多账号使用 特别声明: 本仓库发布的脚本及其中涉及的任何解锁和解密分析脚本,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断。

null 87 Nov 12, 2022
Automatic SystemVerilog linting in github actions with the help of Verible

Verible Lint Action Usage See action.yml This is a GitHub Action used to lint Verilog and SystemVerilog source files and comment erroneous lines of co

CHIPS Alliance 10 Dec 26, 2022
Automate HoYoLAB Genshin Daily Check-In Using Github Actions

Genshin Daily Check-In ?? Automate HoYoLAB Daily Check-In Using Github Actions KOR, ENG Instructions Fork the repository Go to Settings -> Secrets Cli

Leo Kim 41 Jun 24, 2022
Mini Tool to lovers of debe from eksisozluk (one of the most famous website -reffered as collaborative dictionary like reddit- in Turkey) for pushing debe (Most Liked Entries of Yesterday) to kindle every day via Github Actions.

debe to kindle Mini Tool to lovers of debe from eksisozluk (one of the most famous website -refered as collaborative dictionary like reddit- in Turkey

null 11 Oct 11, 2022
POC de uma AWS lambda que executa a consulta de preços de criptomoedas, e é implantada na AWS usando Github actions.

Cryptocurrency Prices Overview Instalação Repositório Configuração CI/CD Roadmap Testes Overview A ideia deste projeto é aplicar o conteúdo estudado s

Gustavo Santos 3 Aug 31, 2022
Implement SAST + DAST through Github actions

Implement SAST + DAST through Github actions The repository is supposed to implement SAST+DAST checks using github actions against a vulnerable python

Syed Umar Arfeen 3 Nov 9, 2022
Centralized whale instance using github actions, sourcing metadata from bigquery-public-data.

Whale Demo Instance: Bigquery Public Data This is a fully-functioning demo instance of the whale data catalog, actively scraping data from Bigquery's

Hyperquery 17 Dec 14, 2022