-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
nixos/gitea-actions-runner: init #228422
nixos/gitea-actions-runner: init #228422
Conversation
75618bc
to
1023382
Compare
4566198
to
fa83a92
Compare
fa83a92
to
f314914
Compare
nixos/modules/services/continuous-integration/gitea-actions-runner.nix
Outdated
Show resolved
Hide resolved
nixos/modules/services/continuous-integration/gitea-actions-runner.nix
Outdated
Show resolved
Hide resolved
1b7ebc1
to
fcc964e
Compare
nixos/modules/services/continuous-integration/gitea-actions-runner.nix
Outdated
Show resolved
Hide resolved
95dc0a0
to
ff2372e
Compare
Is it possible to make a NixOS VM test for this? |
If you know how to programmatically retrieve a runner registration token from a gitea instance. Not keen on mocking the gitea API. |
I guess we could start by running a test that checks runner registration. A test that actually tries to build something might be more difficult as that requires networking and other weird stuff... |
Apparently using docker/podman is optional. |
Only in 1.20, didn't get backported into 1.19. |
ff2372e
to
a4b56e6
Compare
Have a draft for the test in the linked PR, that we can look into, once 1.20 is out. |
Looks good at first glance :) I thought about suggesting Unfortunately, I don't think I'll be able to dedicate any time to do proper in-depth tests over the next few days, as I am busy with a lot of other stuff. But I also don't want to block this PR, so eeehhh go ahead I guess? |
So when someone has docker/podman enabled in their system config this module will act differently than if they have them disabled, what if someone has docker/podman enabled but doesn't actually want to use it with gitea runner and instead use native runner? Right now what will happen is that gitea runner will be configured slightly differently and the systemd service will have to wait for docker/podman. |
a4b56e6
to
ed1f9da
Compare
nixos/modules/services/continuous-integration/gitea-actions-runner.nix
Outdated
Show resolved
Hide resolved
ed1f9da
to
253cb34
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a first proper look.
This is what I got so far.
Will try to test more later today or this week :)
nixos/modules/services/continuous-integration/gitea-actions-runner.nix
Outdated
Show resolved
Hide resolved
nixos/modules/services/continuous-integration/gitea-actions-runner.nix
Outdated
Show resolved
Hide resolved
nixos/modules/services/continuous-integration/gitea-actions-runner.nix
Outdated
Show resolved
Hide resolved
nixos/modules/services/continuous-integration/gitea-actions-runner.nix
Outdated
Show resolved
Hide resolved
253cb34
to
c6e1c9c
Compare
nixos/modules/services/continuous-integration/gitea-actions-runner.nix
Outdated
Show resolved
Hide resolved
406b883
to
fa50c96
Compare
Updating the labels against the gitea/forgejo instance requires getting a new registration token and dropping the runner config. Guess we need to account for that. |
Not sure how we should compare the labels and re-register based on that, as it involves state. The $ jq .labels /var/lib/gitea-runner/test/.runner
[
"ubuntu-latest:docker://node:16-bullseye",
"ubuntu-22.04:docker://node:16-bullseye",
"ubuntu-20.04:docker://node:16-bullseye",
"ubuntu-18.04:docker://node:16-buster"
] Additionally, there are custom labels, that can be configured in the runner registration page. |
fa50c96
to
d712216
Compare
Also accounting for label changes now, in which case I purge the existing registration to make the runner fail, as a new token needs to be inserted, to apply the labels. Lastly we should probably talk about the proper runtime environments, that users will want to have, so that actions like One idea was to provide an image based on https://github.com/nix-community/docker-nixpkgs, that includes e.g. |
d712216
to
eae126b
Compare
nixos/modules/services/continuous-integration/gitea-actions-runner.nix
Outdated
Show resolved
Hide resolved
eae126b
to
4f50fd5
Compare
I think I covered all remaining issues for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a final test run of the current version.
Works great :)
Except native:host
😅
Not blocking.
nixos/modules/services/continuous-integration/gitea-actions-runner.nix
Outdated
Show resolved
Hide resolved
Many common actions require bash or nodejs, as well as a filesystem | ||
that follows the filesystem hierarchy standard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment/pointer for other reviewers:
An example where FHS is hardcoded is
https://gitea.com/gitea/act/src/commit/a18648ee7359dbff7a8d3f022270874b840039fa/pkg/runner/run_context.go#L306
The original act
repo on GitHub, on the other hand, does not hardcode it :'(
https://github.com/nektos/act/blob/aa212773804561eaee04c3b4a7d9399dfbb9cad1/pkg/runner/run_context.go#L273
ebf01cc
to
afee6e8
Compare
afee6e8
to
1c963ce
Compare
Description of changes
Module to set up gitea-action-runner instances.
https://blog.gitea.io/2023/03/hacking-on-gitea-actions/
Tested against Forgejo 1.19.1 using the
token
option. The runner by default wants to connect to a docker instance, but I was able to substitute that with the compatible podman socket.Untested, but assumed maybe working:
tokenFile
optionThings done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)