Skip to content

Enhance ARC runner image dockerfiles for RunnerScaleSet compatibility - #2616

Open
mumoshu wants to merge 3 commits into
masterfrom
enhancec-arc-runner-images-for-scaleset-compat
Open

mumoshu wants to merge 3 commits into
masterfrom
enhancec-arc-runner-images-for-scaleset-compat

Conversation

@mumoshu

@mumoshu mumoshu commented May 23, 2023 •

Copy link
Copy Markdown
Collaborator

Hi! I made our current runner images work with the new RunnerScaleSet.

Let me share how so everyone can try and figure out how to build custom runner images that contain more tools and software you like 👋

I'm submitting this as a pull request because it doesn't break our current runner images and is worth merging for a better experience migrating to the new ARC!


There are only a few differences between the new and the current runner images.

TL;DR; We can add some dockerfile build args and envs and make the part that calls config.sh to be conditional and that's all you need to make it work with RunnerScaleSet.

Here are the differences:

Current New
Images https://hub.docker.com/r/summerwind/actions-runner, https://github.com/orgs/actions-runner-controller/packages https://github.com/actions/runner/pkgs/container/actions-runner
Dockerfiles https://github.com/actions/actions-runner-controller/tree/master/runner https://github.com/actions/runner/tree/main/images
$HOME /runner /home/runner
Location of source "externals" dir /runner/externalstmp /home/runner/externals
How you copy externals for dind sidecar startup.sh within runner container runs cp Init container runs cp
Token registration Controller creates a registration token and config.sh within runner obtains another token for actions/runner Controller obtains the token and runner uses it as-is, without config.sh

And apparently, the changes introduced via this pull request is all you need to make it work for both.

You can build e.g., an Ubuntu 20.04 runner image that seems to work with the new RunnerScaleSet by overriding some paths via new build args added in this PR:

# Whatever version you want to use for this
DOCKER_REPO=yourcontainerregistry/arc-runner-temp-v1-ubuntu-20.04
VER=0.1
docker build \
  --build-arg RUNNER_ASSETS_DIR=/home/runner \
  --build-arg TARGETPLATFORM=linux/amd64 \
  --build-arg RUNNER_VERSION=2.304.0 \
  --build-arg EXTERNALS_DIR_NAME=externals \
  -t $DOCKER_REPO:$VER \
  -f runner/actions-runner.ubuntu-20.04.dockerfile \
  runner
# Add `--load ` or `--push` if you're using buildx!

@mumoshu
mumoshu requested review from a team, nikola-jokic and toast-gear as code owners May 23, 2023 02:15
@Link- Link- added attention Requires attention gha-runner-scale-set Related to the gha-runner-scale-set mode labels May 23, 2023
@Link-

Link- commented May 25, 2023

Copy link
Copy Markdown
Member

Awesome work as usual @mumoshu ! Do you want me to test this or you're confident with your tests?

@int128

int128 commented May 30, 2023

Copy link
Copy Markdown
Contributor

JFY: I tested this pull request as int128/actions-runner-controller-in-actions#6.
I'm not sure but found the following issues:

  • actions-runner image works perfectly 👍
  • actions-runner-dind image:
  • actions-runner-dind-rootless image:
    • actions/checkout did not work due to this error: An error occurred trying to start process '/home/runner/externals/node16/bin/node' with working directory '/home/runner/_work/actions-runner-controller-in-actions/actions-runner-controller-in-actions'. No such file or directory

@int128

int128 commented Jun 2, 2023

Copy link
Copy Markdown
Contributor

I hope this would be an official image for RunnerScaleSets.

We tried ghcr.io/actions/runner image in our organization, but some actions such as ruby/setup-ruby did not work since that image is Debian based.

@Link-

Link- commented Jun 14, 2023 •

Copy link
Copy Markdown
Member

Switch from Debian to Ubuntu 22.04 actions/runner#2651

@apr-1985

Copy link
Copy Markdown
Contributor

Hello.
Is this going to get in? I like that this image comes with most required software included, makes it more closely aligned to using the GHA Cloud Runners.

@Link-

Link- commented Sep 7, 2023

Copy link
Copy Markdown
Member

Pending testing

@Link- Link- added the community Community contribution label Sep 7, 2023
@rs1986x

rs1986x commented Sep 17, 2023

Copy link
Copy Markdown

I really like both old and new setups, but in the new setup I do miss the option to run dind in a single image and be able to set precise requests and limits for the whole thing.

- `should_work_use_disable_once_switch` was failing since the support for --once has been removed a while ago. Removed the test.
- Added `cd` before running `startup.sh` for access to the logger.sh library from within the script
- Included the runner directory into `$PATH` for access to `update-status` from within the script
@mumoshu
mumoshu force-pushed the enhancec-arc-runner-images-for-scaleset-compat branch from 74617c1 to fb1a7cc Compare September 25, 2023 03:40
@Link- Link- added the hold Important but cannot be addressed at the moment label Dec 8, 2023

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

attention Requires attention community Community contribution gha-runner-scale-set Related to the gha-runner-scale-set mode hold Important but cannot be addressed at the moment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants