Skip to content
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

Do not attempt to install kvm on self-hosted runners #132

Open
dpc opened this issue Nov 20, 2024 · 3 comments
Open

Do not attempt to install kvm on self-hosted runners #132

dpc opened this issue Nov 20, 2024 · 3 comments

Comments

@dpc
Copy link

dpc commented Nov 20, 2024

I have a CI that have some things working on self-hosted runners, and some on normal Github runners.

Currently, after switching:

-      - uses: cachix/install-nix-action@v30
+      - uses: DeterminateSystems/nix-installer-action@v16

The CI fails on self-hosted runners, because it tries to install KVM, but there is no sudo.

It seems to me that if the Nix was already installed, the machine is probably a self-hosted one, and there's no point trying to install KVM.

I will probably end up disabling KVM, but ideally I would be happy to have it enabled on non-self-hosted machines.

Edit:

Seems like currently the existing Nix installation is not even correctly detected.

self-hosted runners just have nix in the PATH, and do not actually require installing anything. The action is still useful if it needs to run on a Github Actions standard runner in a VM.

@dpc
Copy link
Author

dpc commented Feb 7, 2025

Ehh... I forgot this doesn't work. Bummer. I really would love to switch.

@grahamc
Copy link
Member

grahamc commented Feb 7, 2025

Hmm... interesting. So, installing Nix requires sudo. @dpc does your machine already have Nix? I have a fix for the KVM + sudo issue, but obviously it won't help if you don't have Nix installed.

@dpc
Copy link
Author

dpc commented Feb 7, 2025

Hmm... interesting. So, installing Nix requires sudo. @dpc does your machine already have Nix? I have a fix for the KVM + sudo issue, but obviously it won't help if you don't have Nix installed.

Yes. It's a self-hosted runner. A hetzner box with NixOS installed and github runners configured.

It does require some working around actions sometimes, because some github actions assume that they are running on a fresh VM Ubuntu, etc. but most github actions don't touch any system-level stuff, so it just works for them.

I wouldn't really need nix-installer-action in the first place there BUT the same workflows are used when using MacOS builders, and possibly in the VM when people fork our repo. So it would be really nice if DeterminateSystems/nix-installer-action could just detect that Nix is installed and sudo doesn't work and just assumed it's OK instead of failing, so I we can have the best Nix installer when it is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants