all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Roel Janssen <roel@gnu.org>
To: Ben Woodcroft <b.woodcroft@uq.edu.au>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: Non-privileged daemons and offloading
Date: Mon, 20 Jun 2016 11:06:20 +0200	[thread overview]
Message-ID: <87mvmgfcvn.fsf@gnu.org> (raw)
In-Reply-To: <5766991A.1020505@uq.edu.au>

Hello Ben,

It seems like we are facing a similar problem.  A proper solution takes
a lot more work and a lot more time I believe.  I am also currently
working on a more complete guide to do this, but here I tried to get the
essentials written down.

As far as software deployment goes, I have done the following to get it
on the restricted environment (in my case a cluster, on your case, a
super computer):

1. Get /gnu/store, or bootstrap your own store with a custom prefix
(I've done the latter) on a VM or a machine that has super user
privileges (let's call this the "build host").

For a custom prefix, you need to build guix from source with:

  ./configure --with-store-dir=/hpc/custom/guix-store \
              --localstatedir=/hpc/custom/guix-state/guix

You should change the environment variables: NIX_STATE_DIR and
NIX_STORE_DIR, before running the daemon, and before running the guix
command as a user.  In my case, I used:

  export NIX_STATE_DIR=/hpc/custom/guix-state/guix
  export NIX_STORE_DIR=/hpc/custom/guix-store
  guix-daemon --cores=4 --max-jobs=4 --no-substitutes --build-users-group=guixbuild


2. Build the packages you want to deploy on the HPC on the build host.

  export NIX_STATE_DIR=/hpc/custom/guix-state/guix
  export NIX_STORE_DIR=/hpc/custom/guix-store
  guix package -i <anything-you-need>


3. Copy the store and profiles.  This is a bit more tricky.  In my case,
hardlinks would not work because of the properties of our storage
system.  I used the following to copy the store and the profile (and
update it later on):

  rsync -lrt --delete --exclude=.links /hpc/custom/guix-store user@restricted-machine:/hpc/custom
  rsync -lrt --delete --exclude=.links /hpc/custom/guix-state user@restricted-machine:/hpc/custom

I excluded the .links directory to save space (you could copy them as
normal files instead of hardlinks, and the size of your store will
double).  Without this directory, you cannot efficiently do package
management, so don't remove it on the build host.

I didn't use the offloading mechanism on Guix.  I avoid using the
guix-daemon entirely, and reduce the deployment problem to an rsyncable
thing.

From here on, you can run programs as usual by adding
/hpc/custom/guix-state/guix/profiles/per-user/<username>/guix-profile/bin
to your path (and the other relevant environment variables).

If you install guix in your store, you can run guix-daemon on the
restricted machine and get 'guix package --search-paths', 'guix graph
...' and even 'guix gc' to work.  I haven't tested the other commands
yet.

I hope this helps.

Groet,
Roel


Ben Woodcroft writes:

> Hi there,
>
> I've recently gotten access to a supercomputer where I don't have sudo, 
> and I'm trying to hatch a plan to run guix packaged programs. 
> Unfortunately, I don't have anything substantial like a container-based 
> build environment to add here, only a potential workaround idea.
>
> I could run the daemon normally as a regular user, but I'm afraid of the 
> issues that arise due to inability to chroot as described in the manual. 
> Instead, I'm considering offloading the builds to a separate machine, 
> where a guix-daemon runs as sudo and so can run builds in the chroot. 
> IIUC, this gets around the issue of impurities in builds while not 
> requiring sudo.
>
> One hole the plan I can see is that at least according to the manual, 
> offloads are defined in "/etc/guix/machines.scm" which as a regular user 
> I cannot modify. Is there any other way to specify offload machines e.g. 
> via an argument to 'guix-daemon'? Is there any better ways to go about 
> this whole thing in general?
>
> Thanks,
> ben

  parent reply	other threads:[~2016-06-20  9:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-19 13:07 Non-privileged daemons and offloading Ben Woodcroft
2016-06-20  8:05 ` Ludovic Courtès
2016-06-20 12:23   ` Ludovic Courtès
2016-06-20 12:44   ` Thompson, David
2016-06-20  9:06 ` Roel Janssen [this message]
2016-07-30  4:11   ` Ben Woodcroft

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mvmgfcvn.fsf@gnu.org \
    --to=roel@gnu.org \
    --cc=b.woodcroft@uq.edu.au \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.