unofficial mirror of guix-science@gnu.org 
 help / color / mirror / Atom feed
From: "Ludovic Courtès" <ludovic.courtes@inria.fr>
To: "Sébastien Lerique" <sl@eauchat.org>
Cc: guix-science@gnu.org,  zimoun <zimon.toutoune@gmail.com>
Subject: Re: Introducing Guix to HPC at my institution
Date: Mon, 29 Mar 2021 14:03:08 +0200	[thread overview]
Message-ID: <87k0pqrwub.fsf@inria.fr> (raw)
In-Reply-To: <877dlucsur.fsf@eauchat.org> ("Sébastien Lerique"'s message of "Fri, 26 Mar 2021 17:22:43 +0900")

Hi Sébastien,

Sébastien Lerique <sl@eauchat.org> skribis:

> It turns out the HPC cluster I have access to has user namespaces
> activated \o/, so I'm looking into getting things running as an 
> unpriviliged user to show other people how useful Guix can be (before
> approaching higher levels in the administration).

Good!

> and am now following Guix's binary installation inside a user
> namespace. After decompressing the binary distribution of guix 
> inside `~/local-guix`, my naïve next step was `unshare -mrf chroot
> ~/local-guix 
> gnu/store/mmhimfwmmidf09jw1plw3aw1g1zn2nkh-bash-static-5.0.16/bin/bash`.

Instead of installing the “regular” binary tarball inside a namespace,
it might be easier to create a tarball like so:

  guix pack -RR -S /bin=bin -S /etc=etc guix bash

… and to unpack the resulting tarball.

From there, you can run ./bin/sh to get a shell that “sees” /gnu/store.
You can then run:

  . ./etc/profile

And then, you should be able to run the daemon, like so:

  export GUIX_STATE_DIRECTORY=$HOME/.local/var/guix
  guix-daemon --disable-chroot &

(Adapted from
<https://lists.gnu.org/archive/html/guix-devel/2018-05/msg00139.html>.)

Does that work for you?

> But my knowledge of linux namespaces is hindering my next steps :). A
> few questions:
>
> - after setting $GUIX_PROFILE and sourcing
>   `/root/.config/guix/current`, running `guix` warns with:
>
>  GC Warning: pthread_getattr_np or pthread_attr_getstack failed   for
> main thread
>  GC Warning: Couldn't read /proc/stat
>
>  The first warning I don't know what to do with. About the   second:
> should I be binding `/proc` somehow?

Yes, you should expose /proc.  The wrappers created by ‘guix pack -RR’
in the example above bind-mount everything + /gnu/store, such that you
can’t tell the difference.

> - is it possible to create build users inside the user-namespaced
>   chroot?

No: you still have a single UID at hand, so there’s no way to allocate
new ones.

> - last but not least, how would I go about sharing this setup with
>   other users on the cluster? Ideally I would like to have a 
>  non-priviliged build daemon that other users can call on. (Is   there
> such a thing as kernel group namespaces?)

It’s not really sharable.  To share it, you would need some sort of a
shared trusted “proxy”; that’s precisely what guix-daemon is in normal
multi-user setups.

HTH!

Ludo’.


  reply	other threads:[~2021-03-29 12:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15  3:12 Introducing Guix to HPC at my institution Sébastien Lerique
2021-03-15 13:47 ` zimoun
2021-03-16  1:54   ` Sébastien Lerique
2021-03-16  8:06     ` zimoun
2021-03-16  9:05     ` Ludovic Courtès
2021-03-18  2:26       ` Sébastien Lerique
2021-03-26  8:22         ` Sébastien Lerique
2021-03-29 12:03           ` Ludovic Courtès [this message]
2021-03-30  1:54             ` Sébastien Lerique
2021-03-30  7:21               ` Ludovic Courtès
2021-03-31  5:23                 ` Sébastien Lerique
2021-04-01  8:35                   ` Ludovic Courtès
2021-04-01 14:34                     ` Sébastien Lerique
2021-04-10 20:43                       ` Ludovic Courtès
2021-04-12  1:21                         ` Sébastien Lerique
2021-04-12 12:43                           ` Ludovic Courtès

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87k0pqrwub.fsf@inria.fr \
    --to=ludovic.courtes@inria.fr \
    --cc=guix-science@gnu.org \
    --cc=sl@eauchat.org \
    --cc=zimon.toutoune@gmail.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).