[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27386: offloading documentation and env

From: Ludovic Courtès
Subject: bug#27386: offloading documentation and env
Date: Fri, 07 Jul 2017 12:00:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Oleg Pykhalov <address@hidden> skribis:

> address@hidden (Ludovic Courtès) writes:
>> Hmm could it be that ‘machine-load’ in (guix scripts offload) always
>> returns +inf.0, for instance because it fails to run “cat /proc/loadavg”
>> on the remote machine?  (If it succeeded we would see the message “load
>> on machine XYZ is N”.)
>> https://git.savannah.gnu.org/cgit/guix.git/tree/guix/scripts/offload.scm#n393
> Can I actually look what is happening somehow?

Yes, you can make a checkout of Guix, add ‘pk’ calls in (guix scripts
offload) (see below), and run the daemon from there:

  ./pre-inst-env guix-daemon --build-users-group=guixbuild

‘pk’ is a function that prints its argument and returns it, so you could

diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm
index 566d117b0..0dd849942 100644
--- a/guix/scripts/offload.scm
+++ b/guix/scripts/offload.scm
@@ -398,7 +398,7 @@ allowed on MACHINE.  Return +∞ if MACHINE is unreachable."
     ((? session? session)
      (let* ((pipe (open-remote-pipe* session OPEN_READ
                                      "cat" "/proc/loadavg"))
-            (line (read-line pipe)))
+            (line (pk 'line (read-line pipe))))
        (close-port pipe)
        (if (eof-object? line)
to print the line that is read.

>> What does “ssh address@hidden -i KEY cat /proc/loadavg” return,
>> where USER and KEY are those specified in your machines.scm file?
> address@hidden ~$ 
> (list (build-machine
>              (name "magnolia.local")
>              (system "x86_64-linux")
>            (host-key "ssh-ed25519 
>              (user "natsu")
>            (private-key
>             (string-append (getenv "HOME")
>                            "/.ssh/identity-for-guix"))
>              (speed 2.)))
> ssh address@hidden -i $HOME/.ssh/identity-for-guix cat /proc/loadavg
> 0.05 0.08 0.02 1/247 13756

Hmm, looks good.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]