-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
github-runner: fix package layout and script patches #186325
Conversation
cc @veehaitch @newAM |
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.
- Can you explain what crashes you saw? I tested the last pull-request on
aarch64-linux
and had no issues. If you experienced problems I would like to know what I can test in the future to catch this :) - What problem are you trying to solve by setting
RUNNER_ROOT
? I tried to find what this variable does, but the only relevant result was this nixpkgs issue: GitHub runner failing #158970
Unfortunately with this pull-request I can no longer start a runner on aarch64-linux
.
systemd[1]: Starting GitHub Actions runner...
systemd[1]: Started GitHub Actions runner.
runsvc.sh[30835]: /nix/store/97dfdd78d6rf580wj11x3knfpr1f2qpd-github-runner-2.295.0/bin/runsvc.sh: line 17: ./externals/node16/bin/node: No such file or directory
systemd[1]: github-runner.service: Main process exited, code=exited, status=127/n/a
systemd[1]: github-runner.service: Failed with result 'exit-code'.
With #186173 it works on aarch64-linux
:
systemd[1]: Starting GitHub Actions runner...
systemd[1]: Started GitHub Actions runner.
runsvc.sh[31296]: Starting Runner listener with startup type: service
runsvc.sh[31296]: Started listener process, pid: 31310
runsvc.sh[31296]: Started running service
runsvc.sh[31296]: √ Connected to GitHub
runsvc.sh[31296]: Current runner version: '2.295.0'
runsvc.sh[31296]: 2022-08-13 15:09:49Z: Listening for Jobs
|
I'm realizing now I should also test that these changes work with the NixOS module. I'll update this PR with the relevant fixes as soon as possible. |
I undid the change that broke compatibility with the NixOS service module. I've verified that a basic usage of the service module now works again on |
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.
Thanks for the PR. This makes sense.
# Set working dir in config.sh | ||
sed -i '2 i cd $RUNNER_ROOT' $out/lib/env.sh | ||
sed -i '2 i cd '$out/ $out/lib/config.sh | ||
|
||
# Set default value for RUNNER_ROOT | ||
sed -i '2 i export RUNNER_ROOT="$\{RUNNER_ROOT:-$HOME/.github-runner}"' $out/lib/config.sh | ||
sed -i '3 i mkdir -p $RUNNER_ROOT' $out/lib/config.sh | ||
sed -i '2 i export RUNNER_ROOT="$\{RUNNER_ROOT:-$HOME/.github-runner}"' $out/lib/run.sh | ||
|
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.
I'd try to integrate those changes into host-context-dirs.patch
which introduces the RUNNER_ROOT
environment variable.
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.
I agree that could be cleaner. What should we do about the root dir in env.sh
then? It's called in config.sh
before the dotnet package in invoked at all. We'd need to hardcode the runner root default in both places, which actually feels worse. For reference: https://github.com/actions/runner/blob/main/src/Misc/layoutroot/env.sh
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.
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.
So far, we created wrappers in bin/
for the shell scripts. As far as I can tell, makeWrapper
(particularly, --set-default
and --chdir
) would work well here as well (though I'd move the invocations to postFixup
).
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.
Thanks for the pointers. I've refactored the change to use those helper functions. Looks much cleaner now.
Given some quirks with bash quote escaping, I wasn't able to use --set-default
, but --run
did the trick.
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.
The systemd service works now on x86_64-linux, and the changes look reasonable to me. @veehaitch should also review this before it gets merged though.
@veehaitch Like I mentioned here, all of those proposed changes would cause breakage due to their escape/quote handling. Making those proposed changes would break this PR. |
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.
@veehaitch Like I mentioned here, all of those proposed changes would cause breakage due to their escape/quote handling. Making those proposed changes would break this PR.
Sorry, I missed that!
Something I'm confused about is why these errors seemingly happen inconsistently (see #187009 and #182189 (review)). Does anyone (@cmoog maybe) have any clue why this is? |
That is likely due to the code paths introduced by the service module wrapper. This PR fixes the derivation itself, which is broken on master 100% of the time. |
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.
Can you rebase so we can get rid of the merge commit? (Also, it might be worth squashing the changes down, at least a little, since the state of the first commit is drastically different than the last one. Your call, though.)
Successfully created backport PR #187909 for |
Description of changes
RUNNER_ROOT
.How to test:
Things 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/
)nixos/doc/manual/md-to-db.sh
to update generated release notes