← All tools

actions-batch

Popularity 85 Updated Development & Build

Time-sharing supercomputer built on GitHub Actions

homebrewauto-collected

Installation

Homebrew
brew install actions-batch

Install with Homebrew.

actions-batch

Time-sharing supercomputer built on GitHub Actions.

In the 1970s - or so I hear, time-sharing was all the rage, with users being able to submit tasks or batch jobs to large computers, and to collect the results when the jobs where done.

Read the blog post: GitHub Actions as a time-sharing supercomputer

Goal

Run a shell script in an isolated, immutable environment, collect the logs or results.

This works well with self-hosted runners managed by actuated (which use a full VM) or GitHub's hosted runners. It may also work with container-based runners, with some limitations on what software can be used securely i.e. docker.

Example output from examples/cows-docker.sh:

If your job creates output files, they can be fetched to your machine by making sure you copy them into the "uploads" file in your bash script.

What's supported?

  • [x] Public repos
  • [x] Private repos
  • [x] Self-hosted runners
  • [x] GitHub-hosted runners
  • [x] Using secrets via repository secrets
  • [x] Downloading the results of a build as an artifact

You might also be interested in

  • alexellis/run-job - run one-shot jobs on Kubernetes
  • OpenFaaS - portable, open-source FaaS for Kubernetes and standalone containerd

How it works

  • You write a bash script like the ones in examples and pass it in as an argument
  • A new repo is created with a random name in the specified organisation
  • A workflow file is written to the repo along with the shell script, the workflow's only job is to run the shell script and exit
  • The workflow is triggered and you can check the results

-owner is intended to be a GitHub organisation, but this can be adapted to a personal account by passing --org false to the command.

git clone git@github.com:alexellis/actions-batch
cd actions-batch

You'll need a Personal Access Token (PAT) with: deleterepo, repo, workflow, write:packages.