-
Notifications
You must be signed in to change notification settings - Fork 1k
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
check for your own process pid instead #2720
base: main
Are you sure you want to change the base?
check for your own process pid instead #2720
Conversation
fixes #2007 |
0ecd517
to
dd267c0
Compare
ec0e965
to
9e01682
Compare
9e01682
to
040303c
Compare
Hey @ilyakooo0, is there something preventing this PR from getting merged? |
I don't have write access |
Ah, you where mentioned as reviewer :) |
Would be great to have this merged! |
Is there any workaround for this issue? |
@paksk-pcs here is how i use it on NixOS:
|
@TingluoHuang this fixes an issue on systems where the |
@peterromfeldhk there is my workaround for nix with flakes. This way you don't need to fork runner repo. It uses overlay to patch package from nixpkgs and use it in diff --git a/configuration.nix b/configuration.nix
index a46a3a6..73d9958 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -188,6 +188,7 @@
name = "test-github-runner";
# user = "github-runner";
# replace = true;
+ package = pkgs.patched-github-runner;
tokenFile = config.age.secrets."test-github-runner-token".path;
url = "https://github.com/artslob/test-github-runner";
extraPackages = with pkgs; [ curl wget rustup gcc docker_27 ];
diff --git a/flake.nix b/flake.nix
index c399a46..f1dc993 100644
--- a/flake.nix
+++ b/flake.nix
@@ -16,6 +16,17 @@
nixosConfigurations.vps = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
+ {
+ nixpkgs.overlays = [
+ (final: prev: {
+ patched-github-runner = prev.github-runner.overrideAttrs
+ (oldAttrs: {
+ patches = oldAttrs.patches or [ ]
+ ++ [ ./github-runner.patch ];
+ });
+ })
+ ];
+ }
# Import the previous configuration.nix we used,
# so the old configuration file still takes effect
./configuration.nix
diff --git a/github-runner.patch b/github-runner.patch
new file mode 100644
index 0000000..b278d77
--- /dev/null
+++ b/github-runner.patch
@@ -0,0 +1,11 @@
+--- a/src/Runner.Worker/ContainerOperationProvider.cs
++++ b/src/Runner.Worker/ContainerOperationProvider.cs
+@@ -527,7 +527,7 @@ private async Task AssertCompatibleOS(IExecutionContext executionContext)
+ }
+ #pragma warning restore CA1416
+ #else
+- var initProcessCgroup = File.ReadLines("/proc/1/cgroup");
++ var initProcessCgroup = File.ReadLines("/proc/self/cgroup");
+ if (initProcessCgroup.Any(x => x.IndexOf(":/docker/", StringComparison.OrdinalIgnoreCase) >= 0))
+ {
+ throw new NotSupportedException("Container feature is not supported when runner is already running inside container.");
\ No newline at end of file |
fix issue where you get
when trying to use service with a less privileged runner