From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#27386: offloading documentation and env Date: Fri, 07 Jul 2017 12:00:43 +0200 Message-ID: <87inj4d0s4.fsf@gnu.org> References: <20170615223456.z5w2oaxifbah2ak2@abyayala> <87podq7cae.fsf@gnu.org> <20170626211511.ox5smekycmqz2vc3@abyayala> <87injh5z3h.fsf@gnu.org> <20170627145418.iq54zrhfzbr7vdtn@abyayala> <87d19p43wg.fsf@gnu.org> <20170627203136.rvl4dr6d3byzjein@abyayala> <8737ak1pji.fsf@gnu.org> <20170628114530.ca43xv4guqoa4mtv@abyayala> <87k23vzsyb.fsf@gnu.org> <20170628223636.h3k24txegftwmlmk@abyayala> <87podnovvh.fsf@gnu.org> <87lgo41fan.fsf@clover.i-did-not-set--mail-host-address--so-tickle-me> <87k23nsx3w.fsf@gnu.org> <878tk27r0g.fsf@clover.i-did-not-set--mail-host-address--so-tickle-me> <87mv8inhoh.fsf@gnu.org> <8737a9n1ur.fsf@clover.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTQ4N-0006F7-LO for bug-guix@gnu.org; Fri, 07 Jul 2017 06:01:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTQ4M-0007l7-Ew for bug-guix@gnu.org; Fri, 07 Jul 2017 06:01:03 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:53074) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dTQ4M-0007ky-B1 for bug-guix@gnu.org; Fri, 07 Jul 2017 06:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dTQ4M-0001t6-3C for bug-guix@gnu.org; Fri, 07 Jul 2017 06:01:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <8737a9n1ur.fsf@clover.i-did-not-set--mail-host-address--so-tickle-me> (Oleg Pykhalov's message of "Thu, 06 Jul 2017 16:15:08 +0300") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Oleg Pykhalov Cc: 27386@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Oleg Pykhalov skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Hmm could it be that =E2=80=98machine-load=E2=80=99 in (guix scripts off= load) always >> returns +inf.0, for instance because it fails to run =E2=80=9Ccat /proc/= loadavg=E2=80=9D >> on the remote machine? (If it succeeded we would see the message =E2=80= =9Cload >> on machine XYZ is N=E2=80=9D.) >> >> https://git.savannah.gnu.org/cgit/guix.git/tree/guix/scripts/offload.s= cm#n393 > > Can I actually look what is happening somehow? Yes, you can make a checkout of Guix, add =E2=80=98pk=E2=80=99 calls in (gu= ix scripts offload) (see below), and run the daemon from there: ./pre-inst-env guix-daemon --build-users-group=3Dguixbuild =E2=80=98pk=E2=80=99 is a function that prints its argument and returns it,= so you could do: --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 +=E2=88=9E if MACHINE is un= reachable." ((? 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) =20 (if (eof-object? line) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable to print the line that is read. >> What does =E2=80=9Cssh USER@magnolia.local -i KEY cat /proc/loadavg=E2= =80=9D return, >> where USER and KEY are those specified in your machines.scm file? > > natsu@clover ~$=20 > (list (build-machine > (name "magnolia.local") > (system "x86_64-linux") > (host-key "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMRy+enQECs2CsjrbSIf= nNHExcUwzHFa7KUnhwDIeWOV") > (user "natsu") > (private-key > (string-append (getenv "HOME") > "/.ssh/identity-for-guix")) > (speed 2.))) > ssh natsu@magnolia.local -i $HOME/.ssh/identity-for-guix cat /proc/loadavg > 0.05 0.08 0.02 1/247 13756 Hmm, looks good. Ludo=E2=80=99. --=-=-=--