From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePxCF-00078v-SH for guix-patches@gnu.org; Fri, 15 Dec 2017 16:07:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePxCA-0001xU-Qr for guix-patches@gnu.org; Fri, 15 Dec 2017 16:07:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:55714) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePxCA-0001ww-JP for guix-patches@gnu.org; Fri, 15 Dec 2017 16:07:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ePxCA-0001w4-Ag for guix-patches@gnu.org; Fri, 15 Dec 2017 16:07:02 -0500 Subject: [bug#29699] [PATCH] guix: offload: Add "status" sub-command. Resent-Message-ID: References: <20171213224409.417-1-rekado@elephly.net> <87lgi4jmqk.fsf@gnu.org> From: Ricardo Wurmus In-reply-to: <87lgi4jmqk.fsf@gnu.org> Date: Fri, 15 Dec 2017 22:05:42 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <87d13fvh09.fsf@elephly.net> 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 29699@debbugs.gnu.org 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 only= once. >> + (let ((machines (filter pred >> + (delete-duplicates (build-machines machine-fi= le) >> + build-machine=3D?)))) >> + (for-each machine-load machines))) > > Perhaps we could also display information from =E2=80=98uname=E2=80=99, a= s in > ? I didn=E2=80=99t even notice machine-status.scm! Should we just fold that = into offload.scm instead of accepting my simplistic =E2=80=9Ccheck-machine-load= =E2=80=9D procedure? -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net