From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQJTD-0002PU-LK for guix-patches@gnu.org; Sat, 16 Dec 2017 15:54:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQJT8-0002VI-Pu for guix-patches@gnu.org; Sat, 16 Dec 2017 15:54:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:57286) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eQJT8-0002Uo-MW for guix-patches@gnu.org; Sat, 16 Dec 2017 15:54:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eQJT8-00030m-6x for guix-patches@gnu.org; Sat, 16 Dec 2017 15:54:02 -0500 Subject: bug#29699: [PATCH] guix: offload: Add "status" sub-command. Resent-To: guix-patches@gnu.org Resent-Message-ID: References: <20171213224409.417-1-rekado@elephly.net> <87lgi4jmqk.fsf@gnu.org> <87d13fvh09.fsf@elephly.net> <87wp1nehrq.fsf@gnu.org> From: Ricardo Wurmus In-reply-to: <87wp1nehrq.fsf@gnu.org> Date: Sat, 16 Dec 2017 21:52:36 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <87bmiyo0ob.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-done@debbugs.gnu.org Ludovic Court=C3=A8s writes: > 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 on= ly once. >>>> + (let ((machines (filter pred >>>> + (delete-duplicates (build-machines machine-= file) >>>> + 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 th= at into >> offload.scm instead of accepting my simplistic =E2=80=9Ccheck-machine-lo= ad=E2=80=9D >> procedure? > > Sure, I guess it=E2=80=99s just a matter of adding (node-eval node '(unam= e)) in > =E2=80=98check-machine-load=E2=80=99 and printing that. Okay, pushed to master with commit dafc3dafe. I renamed the procedure to =E2=80=9Ccheck-machine-status=E2=80=9D because i= t does more than just print the load. --=20 Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net