github-act-runner icon indicating copy to clipboard operation
github-act-runner copied to clipboard

Docker Image for armv7?

Open malik-n opened this issue 1 year ago • 8 comments

There were lots of difficulties in trying to package actions-runner inside a docker image for armv7.

What about this alternative? Is it doable? Has someone already done it?

malik-n avatar Dec 06 '24 08:12 malik-n

Has someone already done it?

I didn't, all my running systems are migrated to arm64 a long time ago.

Should be just matter of extracting binary-linux-arm.tar.gz into the image of your favorite armv7 linux distribution.

Then define ACTIONS_RUNNER_INPUT_JITCONFIG with an jitconfig token from the api to run exactly one job.

ChristopherHX avatar Dec 06 '24 22:12 ChristopherHX

I have the following issue. I tried the following line in my entrypoint.sh: github-act-runner new --url ${GH_URL} --name ${name} --token ${GH_TOKEN}. Writing it like github-act-runner new --url ${GH_URL} --name ${name} --token "${GH_TOKEN}" causes the same error:

	ERROR: unknown option: BXJEX2L5AYX7XMHPXXXSBXLHXQAXX

I replaced some letters in the token to make it invalid. So the token is perceived as option?

malik-n avatar Dec 13 '24 09:12 malik-n

In docker you should possible avoid the systemd wrapper.

I would need to check the wrapper later if it has problems, eventually is your $name unset and --token is used as name. Always double quote the varables, to make sure this is never the case. e.g. --name "${name}" --token "${GH_TOKEN}"

The following should apply to the debian package as well (copy from releases page). Did I update the --help text of the wrapper?

replace with
./config.sh github-act-runner configure
./config.sh remove github-act-runner remove
./run.sh github-act-runner run

edit removed ./ as the wrapper is globally accessible

The runner configuration is saved in / loaded from your current working directory, while using the github-act-runner command directly.

So do something like this first if your cwd is / : mkdir -p /data && cd data

ChristopherHX avatar Dec 13 '24 09:12 ChristopherHX

I see so I came to this state:

running as user 'actions-runner'
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
	WARNING: Lingering is not enabled for user 'actions-runner'. Lingering is needed to make user services start at boot and to prevent them from being stopped when user logs out. Enable lingering using command 'loginctl enable-linger'.
mkdir: cannot create directory '/home/actions-runner': Permission denied

So I should not use the systemd wrapper and use the commands from the table github-act-runner configure and github-act-runner run instead?

malik-n avatar Dec 13 '24 12:12 malik-n

So I should not use the systemd wrapper and use the commands from the table github-act-runner configure and github-act-runner run instead?

Yes, use configure and run instead.

This is also worth reading https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#using-just-in-time-runners with the env variable ACTIONS_RUNNER_INPUT_JITCONFIG set to the base64 token you get from rest api

ChristopherHX avatar Dec 13 '24 13:12 ChristopherHX

The entrypoint.sh now looks something like this:

github-act-runner configure --url ${GH_URL} --name "${name}" --token "${GH_TOKEN}" --labels "self-hosted,Linux,$TARGETARCH"
github-act-runner run &

It calls success than disconnects and immediately reruns no matter if there is the & or not

malik-n avatar Dec 19 '24 15:12 malik-n

The & is definetly wrong besides this and you said that you tried without &, I don't know due to the lack of more details from your side e.g. Dockerfile why you have a problem.

Bringing me to write this from scratch myself can take a while.

We could also switch this discussion to the german language.

ChristopherHX avatar Dec 20 '24 17:12 ChristopherHX

Ich denke nicht, dass da noch Information fehlt. Der Runner verbindet sich zwar immer und immer wieder, aber hält die Verbindung nicht aufrecht. Vielleicht sollte ich noch erwähnen, dass ich nicht Nutzer-Token oder Orga-Token sondern Repo-Token verwende. Durch die vielen Versuche ist die Liste der Runner recht voll geworden: image Ja den Rechtschreibfehler hab ich inzwischen ausgebessert 😁

Die vollständige entrypoint.sh:

#!/usr/bin/env sh
name=${hostname:-"default_name$(date +%s)"}
: ${GH_URL:="https://github.com/*redacted*"}

echo This Forrest-Runner instance has the name $name and the architecture $TARGETARCH

github-act-runner configure --url ${GH_URL} --name "${name}" --token "${GH_TOKEN}" --labels "self-hosted,Linux,$TARGETARCH"
github-act-runner run

malik-n avatar Jan 09 '25 16:01 malik-n