From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePyg9-0000X5-Rp for guix-patches@gnu.org; Fri, 15 Dec 2017 17:42:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePyg5-0007Xg-Ud for guix-patches@gnu.org; Fri, 15 Dec 2017 17:42:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:55768) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePyg5-0007X5-RM for guix-patches@gnu.org; Fri, 15 Dec 2017 17:42:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ePyg5-00043X-Kr for guix-patches@gnu.org; Fri, 15 Dec 2017 17:42:01 -0500 Subject: [bug#29699] [PATCH] guix: offload: Add "status" sub-command. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20171213224409.417-1-rekado@elephly.net> <87lgi4jmqk.fsf@gnu.org> <87d13fvh09.fsf@elephly.net> Date: Fri, 15 Dec 2017 23:41:13 +0100 In-Reply-To: <87d13fvh09.fsf@elephly.net> (Ricardo Wurmus's message of "Fri, 15 Dec 2017 22:05:42 +0100") Message-ID: <87wp1nehrq.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ricardo Wurmus Cc: 29699@debbugs.gnu.org Ricardo Wurmus skribis: > Ludovic Court=C3=A8s writes: > >> Ricardo Wurmus skribis: >> >>> * guix/scripts/offload.scm (check-machine-load): New procedure. >>> (guix-offload): Call it when the argument is "status". >>> * doc/guix.texi (Daemon Offload Setup): Document it. >> >> Nice, LGTM! >> >>> +(define (check-machine-load machine-file pred) >>> + "Print the load of each machine matching PRED in MACHINE-FILE." >>> + (define (build-machine=3D? m1 m2) >>> + (and (string=3D? (build-machine-name m1) (build-machine-name m2)) >>> + (=3D (build-machine-port m1) (build-machine-port m2)))) >>> + >>> + ;; A given build machine may appear several times (e.g., once for >>> + ;; "x86_64-linux" and a second time for "i686-linux"); test them onl= y once. >>> + (let ((machines (filter pred >>> + (delete-duplicates (build-machines machine-f= ile) >>> + build-machine=3D?)))) >>> + (for-each machine-load machines))) >> >> Perhaps we could also display information from =E2=80=98uname=E2=80=99, = as in >> ? > > I didn=E2=80=99t even notice machine-status.scm! Should we just fold tha= t into > offload.scm instead of accepting my simplistic =E2=80=9Ccheck-machine-loa= d=E2=80=9D > procedure? Sure, I guess it=E2=80=99s just a matter of adding (node-eval node '(uname)= ) in =E2=80=98check-machine-load=E2=80=99 and printing that. Thanks, Ludo=E2=80=99.