Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
efrecon committed Sep 27, 2024
1 parent f267bf3 commit 2fabb40
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ driven by the `RUNNER_ENTRYPOINT` variable in [`runner.sh`](./runner.sh).
## Cleanup

During development, many images might be created. To clean them away, you can
run the following:
run the following command when using the `krunvm` runtime, or `podman image rm`:

```bash
buildah rmi $(buildah images --format '{{.ID}}')
Expand Down
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# krunvm-based GitHub Runner(s)

This project creates [self-hosted][self] (ephemeral) GitHub [runners] based on
[krunvm]. [krunvm] creates [microVM]s, so the project enables fully isolated
[libkrun]. [libkrun] creates [microVM]s, so the project enables fully isolated
[runners] inside your infrastruture. MicroVMs boot fast, providing an experience
close to running containers. [krunvm] creates and starts VMs based on the
close to running containers. [libkrun] creates and starts VMs based on the
multi-platform OCI images created for this project -- [ubuntu] (default) or
[fedora].
[fedora]. The project will create [microVM]s using either [krunvm] or
[krun][crun] and [podman].

![Demo](./demo/demo.gif)

[self]: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners
[runners]: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
[libkrun]: https://github.com/containers/libkrun
[krunvm]: https://github.com/containers/krunvm
[microVM]: https://github.com/infracloudio/awesome-microvm
[ubuntu]: https://github.com/efrecon/gh-runner-krunvm/pkgs/container/runner-krunvm-ubuntu
[fedora]: https://github.com/efrecon/gh-runner-krunvm/pkgs/container/runner-krunvm-fedora
[crun]: https://github.com/containers/crun
[podman]: https://github.com/containers/podman

## Example

Expand Down Expand Up @@ -68,6 +72,7 @@ starting with `RUNNER_` will affect the behaviour of each [runner] (loop).
critical software tools.
+ Good compatibility with the regular GitHub [runners]: same user ID, member of
the `docker` group, password-less `sudo`, etc.
+ Supports both [krunvm] or the [krun][crun] runtime under [podman].
+ In theory, the main [ubuntu] and [fedora] images should be able to be used in
more traditional container-based solutions -- perhaps [sysbox]? Reports and/or
changes are welcome.
Expand All @@ -89,10 +94,11 @@ installed on the host. Installation is easiest on Fedora

+ `curl`
+ `jq`
+ `buildah`
+ `krunvm` (and its [requirements])
+ A compatible runtime, i.e. either:
+ `krun` and [`podman`][podman].
+ `krunvm`, its [requirements] and `buildah`

Note: You do not need `podman`.
Note: When opting for `krunvm`, you do not need `podman`.

[built]: ./.github/workflows/ci.yml
[requirements]: https://github.com/containers/krunvm#installation
Expand Down Expand Up @@ -129,9 +135,9 @@ permissions.
The [orchestrator] creates as many loops of ephemeral runners as requested.
These loops are implemented as part of the [runner.sh][runner] script: the
script will create a microVM based on the default image (see below), memory and
vCPU requirement. It will then start that microVM using `krunvm` and that will
start an (ephemeral) GitHub [runner][self]. As soon as a job has been executed
on that runner, the microVM will end and a new will be created.
vCPU requirement. It will then start that microVM using `krunvm` or `podman` and
the VM will start an (ephemeral) GitHub [runner][self]. As soon as a job has
been executed on that runner, the microVM will end and a new will be created.

The OCI image is built in two parts:

Expand Down
4 changes: 2 additions & 2 deletions orchestrator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ ORCHESTRATOR_SLEEP=${ORCHESTRATOR_SLEEP:-"30"}
ORCHESTRATOR_RUNTIME=${ORCHESTRATOR_RUNTIME:-""}

# shellcheck disable=SC2034 # Used in sourced scripts
KRUNVM_RUNNER_DESCR="Run krunvm-based GitHub runners on a single host"
KRUNVM_RUNNER_DESCR="Run libkrun-based GitHub runners on a single host"


while getopts "s:Il:n:p:R:vh-" opt; do
Expand All @@ -77,7 +77,7 @@ while getopts "s:Il:n:p:R:vh-" opt; do
ORCHESTRATOR_RUNNERS="$OPTARG";;
p) # Prefix to use for the VM name
ORCHESTRATOR_PREFIX="$OPTARG";;
R) # Runtime to use when managing microVMs
R) # Runtime to use when managing microVMs, podman+krun or krunvm. Empty==first available
ORCHESTRATOR_RUNTIME="$OPTARG";;
v) # Increase verbosity, will otherwise log on errors/warnings only
ORCHESTRATOR_VERBOSE=$((ORCHESTRATOR_VERBOSE+1));;
Expand Down

0 comments on commit 2fabb40

Please sign in to comment.