-
Notifications
You must be signed in to change notification settings - Fork 1.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
Unable to Install Nix within Runner #2289
Comments
Hey @gthomson31! Isn't this an issue in nix? They seem to provide their own docker image https://nixos.org/manual/nix/stable/installation/installing-docker.html. Perhaps building a custom runner image based on the nix image would be a more viable way to go? 🤔 I've read the linked issues, and at least unmounting parts of /proc didn't make sense to me, as I don't think it's possible within a container, and also, it won't be a good idea to let it unmount the host OS' /proc (if we added a host volume mount there...). |
Thanks for the feedback nix I was new to me but we have managed a workaround in just installing onto the runner as part of the actions workflow for the time being |
Hey @gthomson31! Awesome to hear you found a workaround. |
Yeah no problem @mumoshu steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: true
ssh-key: ${{ secrets.GLOBAL_SSH_KEY }}
- name: Setup SSH Keys and known_hosts
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.GLOBAL_SSH_KEY }}"
ssh-keyscan -t rsa github.com >> /home/runner/.ssh/known_hosts
- name: Install nix
run: |
sudo mkdir -p /nix /etc/nix
sudo chmod a+rwx /nix
sudo sh -c "echo 'sandbox = false' > /etc/nix/nix.conf"
sh <(curl -L https://nixos.org/nix/install) --no-daemon
mkdir -p /home/runner/.config/nix/
echo 'experimental-features = nix-command flakes' > /home/runner/.config/nix/nix.conf
- name: Run e2e-test seeds
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
. /home/runner/.nix-profile/etc/profile.d/nix.sh
export PATH="/home/runner/.nix-profile/bin:/nix/var/nix/profiles/default/bin:$PATH"
nix develop -c task-github-actions-e2e-seed
- name: Run e2e-test
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
. /home/runner/.nix-profile/etc/profile.d/nix.sh
export PATH="/home/runner/.nix-profile/bin:/nix/var/nix/profiles/default/bin:$PATH"
nix develop -c task-go-test-e2e
|
Checks
Controller Version
0.22.0
Helm Chart Version
0.22.0
CertManager Version
v1.9.2
Deployment Method
Helm
cert-manager installation
Yes installed and working
Checks
Resource Definitions
To Reproduce
FROM summerwind/actions-runner:latest
USER root
Hashistack installation , etcUSER runner
Run cachix/install-nix-action@v19
Run /runner/_work/_actions/cachix/install-nix-action/v19/install-nix.sh
/runner/_work/_actions/cachix/install-nix-action/v19/install-nix.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
INPUT_EXTRA_NIX_CONFIG:
INPUT_GITHUB_ACCESS_TOKEN:
INPUT_INSTALL_OPTIONS:
INPUT_INSTALL_URL:
INPUT_NIX_PATH:
GITHUB_TOKEN: ***
Installing Nix
/runner/_work/_actions/cachix/install-nix-action/v19/install-nix.sh: line 23: USER: unbound variable
Error: Process completed with exit code 1.
Run sh <(curl -L https://nixos.org/nix/install) --no-daemon --no-channel-add
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 4052 100 4052 0 0 16635 0 --:--:-- --:--:-- --:--:-- 565k
downloading Nix 2.13.2 binary tarball for x86_64-linux from 'https://releases.nixos.org/nix/nix-2.13.2/nix-2.13.2-x86_64-linux.tar.xz' to '/tmp/nix-binary-tarball-unpack.p6cjhhcO1H'...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 20.0M 100 20.0M 0 0 72.7M 0 --:--:-- --:--:-- --:--:-- 72.9M
Note: a multi-user installation is possible. See https://nixos.org/manual/nix/stable/installation/installing-binary.html#multi-user-installation
performing a single-user installation of Nix...
directory /nix does not exist; creating it by running 'mkdir -m 0755 /nix && chown runner /nix' using sudo
copying Nix to /nix/store...
installing 'nix-2.13.2'
error: mounting /proc: Operation not permitted
(use '--show-trace' to show detailed location information)
/tmp/nix-binary-tarball-unpack.p6cjhhcO1H/unpack/nix-2.13.2-x86_64-linux/install: unable to install Nix into your default profile
Error: Process completed with exit code 1.
Whole Runner Pod Logs
Additional Context
Associated Issues
cachix/install-nix-action#122
NixOS/nix#4107 (comment)
The text was updated successfully, but these errors were encountered: