-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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/github-runner: allow adding custom runner name suffix #210576
Conversation
82240d0
to
a066880
Compare
de07dcd
to
a4d3dfb
Compare
Thanks for the PR @kwbauson! Unfortunately, I didn't see this until now. Feel free to ping me in the future (and I'm quite sure @newAM and @aanderse would also be happy to take a look)! It definitely makes sense to omit the |
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.
What's the advantage of this vs doing it in nix?
{
services.github-runners = listToAttrs (map (runnerName:
{
name = "${runnerName}-${config.networking.hostName}";
value = {
enable = true;
ephemeral = true;
replace = true;
# ...
};
}
runnerNames));
}
@@ -74,6 +74,16 @@ with lib; | |||
default = null; | |||
}); | |||
|
|||
rawNameSuffix = mkOption { |
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.
rawNameSuffix = mkOption { | |
nameSuffix = mkOption { |
Minor bikeshed.
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 ended up just using name
and removing the escapeShellArg
, so removed this option
Yeah, the complexity of this module has grown more than I would like already... this change doesn't help lower the complexity. |
a4d3dfb
to
c02aa1b
Compare
Yeah I don't love that I've had to do this, but unfortunately from what I can tell GitHub rejects multiple runners with the same name (I haven't found documentation except this thread). My use case is that I want multiple runner instances in each machine of an AWS autoscaling group, so I can't use the Hope that makes sense, and if you have any alternatives I'm all ears! Injecting from bash feels a bit gross 😅 |
@kwbauson I will mention that the module authors have done an absolute lovely job of making the Check it out and see if you think the ideas here can help you. If you still feel like this functionality is absolutely necessary and belongs upstream I guess we can keep discussing. |
Yeah I'm a huge fan of this module and its configurability! Also very glad about the systemd hardening, makes me feel a lot more confident using it! The reason for my suggested change is that:
|
Thinking about your issue a little bit more it makes me wonder if we went the right path with generating unique |
Hmmm, I don't think so by itself? It could be an alternative to the existing |
If there was a Maybe you're not understanding what I'm proposing? |
Ahhhh yeah sorry, I wasn't understanding you were suggesting moving away from setting the name in nix. I'll try to make an update to use |
Description of changes
This change can be useful in situations where you may want to run more than a single instance of github-runner per nixos host and auto-scale those hosts, such as in an AWS auto scaling group. Also if no name is provided, it lets
github-runner
discover the hostname of the machine, such assigned hostnames from AWS/GCPExample:
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