GNU bug report logs - #52517
inconstency with offloading

Previous Next

Package: guix;

Reported by: zimoun <zimon.toutoune <at> gmail.com>

Date: Wed, 15 Dec 2021 17:04:02 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52517 in the body.
You can then email your comments to 52517 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#52517; Package guix. (Wed, 15 Dec 2021 17:04:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to zimoun <zimon.toutoune <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 15 Dec 2021 17:04:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: inconstency with offloading
Date: Wed, 15 Dec 2021 18:02:52 +0100
Hi,

The manual provides [1] the example:

--8<---------------cut here---------------start------------->8---
      (build-machine
        (name "armeight.example.org")
        (systems (list "aarch64-linux"))
        (host-key "ssh-rsa AAAAB3Nza…")
        (user "alice")
        (private-key
         (string-append (getenv "HOME")
                        "/.ssh/identity-for-guix")))
--8<---------------cut here---------------end--------------->8---

but what is not clear is 'getenv' from who.  Concretly, adding 'pk' it
reads:

--8<---------------cut here---------------start------------->8---
$ guix offload test

;;; ("/home/simon")
guix offload: testing 2 build machines defined in '/etc/guix/machines.scm'...
--8<---------------cut here---------------end--------------->8---

however, when really building with offload:

--8<---------------cut here---------------start------------->8---
$ guix build -L /tmp/mine r-cipr
The following derivation will be built:
   /gnu/store/mzixy5hhx79xx33k03acaasml87c0knc-r-cipr-0.1.0-1.4b01bb8.drv

;;; ("/root")
process 6815 acquired build slot '/var/guix/offload/x.x.x.x:22/0'
process 6815 acquired build slot '/var/guix/offload/x.x.x.x:22/0'
normalized load on machine 'x.x.x.x' is 0.00
--8<---------------cut here---------------end--------------->8---


"guix offload tes" does the correct thing, not "guix build".


Cheers,
simon


1: <https://guix.gnu.org/en/manual/devel/en/guix.html#Daemon-Offload-Setup>




Information forwarded to bug-guix <at> gnu.org:
bug#52517; Package guix. (Thu, 16 Dec 2021 04:10:02 GMT) Full text and rfc822 format available.

Message #8 received at 52517 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 52517 <at> debbugs.gnu.org
Subject: Re: bug#52517: inconstency with offloading
Date: Wed, 15 Dec 2021 23:09:35 -0500
Hello Simon!

zimoun <zimon.toutoune <at> gmail.com> writes:

> Hi,
>
> The manual provides [1] the example:
>
>       (build-machine
>         (name "armeight.example.org")
>         (systems (list "aarch64-linux"))
>         (host-key "ssh-rsa AAAAB3Nza…")
>         (user "alice")
>         (private-key
>          (string-append (getenv "HOME")
>                         "/.ssh/identity-for-guix")))
>
>
> but what is not clear is 'getenv' from who.  Concretly, adding 'pk' it
> reads:
>
> $ guix offload test
>
> ;;; ("/home/simon")
> guix offload: testing 2 build machines defined in '/etc/guix/machines.scm'...
>
>
> however, when really building with offload:
>
> $ guix build -L /tmp/mine r-cipr
> The following derivation will be built:
>    /gnu/store/mzixy5hhx79xx33k03acaasml87c0knc-r-cipr-0.1.0-1.4b01bb8.drv
>
> ;;; ("/root")

Good observation; a similar issue I had reported is
https://issues.guix.gnu.org/39366.

Maxim




Information forwarded to bug-guix <at> gnu.org:
bug#52517; Package guix. (Mon, 03 Jan 2022 16:53:01 GMT) Full text and rfc822 format available.

Message #11 received at 52517 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 52517 <at> debbugs.gnu.org
Subject: Re: bug#52517: inconstency with offloading
Date: Mon, 03 Jan 2022 17:52:47 +0100
[Message part 1 (text/plain, inline)]
Hi,

zimoun <zimon.toutoune <at> gmail.com> skribis:

> The manual provides [1] the example:
>
>       (build-machine
>         (name "armeight.example.org")
>         (systems (list "aarch64-linux"))
>         (host-key "ssh-rsa AAAAB3Nza…")
>         (user "alice")
>         (private-key
>          (string-append (getenv "HOME")
>                         "/.ssh/identity-for-guix")))
>
>
> but what is not clear is 'getenv' from who.  Concretly, adding 'pk' it
> reads:
>
> $ guix offload test
>
> ;;; ("/home/simon")
> guix offload: testing 2 build machines defined in '/etc/guix/machines.scm'...
>
>
> however, when really building with offload:
>
> $ guix build -L /tmp/mine r-cipr
> The following derivation will be built:
>    /gnu/store/mzixy5hhx79xx33k03acaasml87c0knc-r-cipr-0.1.0-1.4b01bb8.drv
>
> ;;; ("/root")

This is because guix-daemon spawns ‘guix offload’ as root.

But yeah, I agree that the example contributes to the confusion.

How about changing the manual as shown below?

Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/doc/guix.texi b/doc/guix.texi
index 43549da388..9c1f30e83f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -1250,9 +1250,10 @@ The @file{/etc/guix/machines.scm} file typically looks like this:
         (systems (list "aarch64-linux"))
         (host-key "ssh-rsa AAAAB3Nza <at> dots{}")
         (user "alice")
-        (private-key
-         (string-append (getenv "HOME")
-                        "/.ssh/identity-for-guix"))))
+
+        ;; Remember 'guix offload' is spawned by
+        ;; 'guix-daemon' as root.
+        (private-key "/root/.ssh/identity-for-guix")))
 @end lisp
 
 @noindent

Information forwarded to bug-guix <at> gnu.org:
bug#52517; Package guix. (Mon, 03 Jan 2022 17:18:01 GMT) Full text and rfc822 format available.

Message #14 received at 52517 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 52517 <at> debbugs.gnu.org
Subject: Re: bug#52517: inconstency with offloading
Date: Mon, 03 Jan 2022 18:16:50 +0100
Hi,

On Mon, 03 Jan 2022 at 17:52, Ludovic Courtès <ludo <at> gnu.org> wrote:

> This is because guix-daemon spawns ‘guix offload’ as root.

Yes.  The issue is I cannot offload to a machine where I have an SSH
account and where Guix is installed if the sysadmin does not configure
correctly this /root/.ssh/.


> diff --git a/doc/guix.texi b/doc/guix.texi
> index 43549da388..9c1f30e83f 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -1250,9 +1250,10 @@ The @file{/etc/guix/machines.scm} file typically looks like this:
>          (systems (list "aarch64-linux"))
>          (host-key "ssh-rsa AAAAB3Nza <at> dots{}")
>          (user "alice")
> -        (private-key
> -         (string-append (getenv "HOME")
> -                        "/.ssh/identity-for-guix"))))
> +
> +        ;; Remember 'guix offload' is spawned by
> +        ;; 'guix-daemon' as root.
> +        (private-key "/root/.ssh/identity-for-guix")))

This patch LGTM.  At least, it could save time for people configuring
offload. :-)

I am fine to close the issue but, as I said, the fix seems to be able to
offload without root access but just an SSH access.


Cheers,
simon





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 03 Jan 2022 18:31:01 GMT) Full text and rfc822 format available.

Notification sent to zimoun <zimon.toutoune <at> gmail.com>:
bug acknowledged by developer. (Mon, 03 Jan 2022 18:31:02 GMT) Full text and rfc822 format available.

Message #19 received at 52517-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 52517-done <at> debbugs.gnu.org
Subject: Re: bug#52517: inconstency with offloading
Date: Mon, 03 Jan 2022 19:30:37 +0100
Hi,

zimoun <zimon.toutoune <at> gmail.com> skribis:

> On Mon, 03 Jan 2022 at 17:52, Ludovic Courtès <ludo <at> gnu.org> wrote:
>
>> This is because guix-daemon spawns ‘guix offload’ as root.
>
> Yes.  The issue is I cannot offload to a machine where I have an SSH
> account and where Guix is installed if the sysadmin does not configure
> correctly this /root/.ssh/.

True.  That’s admittedly not as flexible as it could be.

Interestingly, GUIX_DAEMON_SOCKET=ssh://… almost achieves that.

Perhaps we could implement “user-level offloading”, probably in addition
to system-wide offloading?  Food for thought…

>> diff --git a/doc/guix.texi b/doc/guix.texi
>> index 43549da388..9c1f30e83f 100644
>> --- a/doc/guix.texi
>> +++ b/doc/guix.texi
>> @@ -1250,9 +1250,10 @@ The @file{/etc/guix/machines.scm} file typically looks like this:
>>          (systems (list "aarch64-linux"))
>>          (host-key "ssh-rsa AAAAB3Nza <at> dots{}")
>>          (user "alice")
>> -        (private-key
>> -         (string-append (getenv "HOME")
>> -                        "/.ssh/identity-for-guix"))))
>> +
>> +        ;; Remember 'guix offload' is spawned by
>> +        ;; 'guix-daemon' as root.
>> +        (private-key "/root/.ssh/identity-for-guix")))
>
> This patch LGTM.  At least, it could save time for people configuring
> offload. :-)

Alright, committing.

> I am fine to close the issue but, as I said, the fix seems to be able to
> offload without root access but just an SSH access.

Yes, we can discuss that separately.

A simple design would be to have clients install a “build handler”; when
the handler is called, it selects a machine, open a remote store
connection, copies missing inputs, starts the build, retrieves
outputs—all that from the client.  Of course admins still have to
authorize keys both ways, but at least that gives more flexibility.  (We
could also have a model where keys are authorized just one-way.)

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#52517; Package guix. (Mon, 03 Jan 2022 19:30:02 GMT) Full text and rfc822 format available.

Message #22 received at 52517-done <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 52517-done <at> debbugs.gnu.org
Subject: Re: bug#52517: inconstency with offloading
Date: Mon, 03 Jan 2022 20:19:32 +0100
Hi Ludo,

On Mon, 03 Jan 2022 at 19:30, Ludovic Courtès <ludo <at> gnu.org> wrote:

> Interestingly, GUIX_DAEMON_SOCKET=ssh://… almost achieves that.

Thanks for the hint.

> Alright, committing.

Cool!  Thanks.


>> I am fine to close the issue but, as I said, the fix seems to be able to
>> offload without root access but just an SSH access.
>
> Yes, we can discuss that separately.

Yes…

> A simple design would be to have clients install a “build handler”; when
> the handler is called, it selects a machine, open a remote store
> connection, copies missing inputs, starts the build, retrieves
> outputs—all that from the client.  Of course admins still have to
> authorize keys both ways, but at least that gives more flexibility.  (We
> could also have a model where keys are authorized just one-way.)

…and it is not easy.  And somehow it is similar as the issue of «Public
guix offload server» discussed [1] recently (Oct. 2021).

1: <https://yhetil.org/guix/878rynh0yq.fsf <at> systemreboot.net>

Cheers,
simon




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 01 Feb 2022 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 77 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.