Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support GitHub Enterprise Server using ARC #59

Merged

Conversation

grahamc
Copy link
Member

@grahamc grahamc commented Dec 4, 2023

Description

This PR improves the action's support for environments unlike GitHub's own hosted runners. In particular, runners that don't expose systemd as PID1. This is common for GitHub Enterprise Server users, which often use something called ARC: https://github.com/actions/actions-runner-controller.

As a happy coincidence, this also closely matches other third party runners, like Namespace.

The implementation here is to fall back to borrowing Docker as a process supervisor if all three of the following are true:

  1. The machine is running Linux
  2. Docker is available
  3. Systemd is not available

This PR includes a pre-built Docker image for arm64 and amd64 in the repository, since the images are completely empty other than some configuration. This patch also updates the trusted-users configuration option, to use the OS to get the username instead of using an environment variable, which is not always available.

This patch has been tested in GHES and on Namespace, and confirmed to work.

Checklist
  • Tested changes against a test repository
  • Added or updated relevant documentation (leave unchecked if not applicable)
  • (If this PR is for a release) Updated README to point to the new tag (leave unchecked if not applicable)

It is special in that it doesn't have systemd, and it'd be great to
support Namespace.so. It is also a good test case for a variety
of self-hosted GHA runner use cases.
…stemd

This change introduces a Docker container shim which spawns the Nix
daemon after bind mounting all the relevant paths into the container.

The image is actually completely empty, other than metadata about what
to run.

This is a cheap and cheerful way to get decent process supervision in
environments that don't bring systemd, but do have docker ... which
is most everywhere in the GHA ecosystem.
@grahamc grahamc force-pushed the graham/fh-82-nix-installer-action-explore-how-to-support-arc branch from 8f4a865 to 6f44f1f Compare December 4, 2023 16:49
src/main.ts Show resolved Hide resolved
src/main.ts Show resolved Hide resolved
src/main.ts Outdated Show resolved Hide resolved
src/main.ts Show resolved Hide resolved
docker-shim/README.md Show resolved Hide resolved
@grahamc grahamc force-pushed the graham/fh-82-nix-installer-action-explore-how-to-support-arc branch from a4821ae to 1aa8f3f Compare December 4, 2023 17:27
Copy link
Member

@cole-h cole-h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine.

@grahamc grahamc merged commit cd46bde into main Dec 4, 2023
5 checks passed
@grahamc grahamc deleted the graham/fh-82-nix-installer-action-explore-how-to-support-arc branch December 4, 2023 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants