GNU bug report logs - #29699
[PATCH] guix: offload: Add "status" sub-command.

Previous Next

Package: guix-patches;

Reported by: Ricardo Wurmus <rekado <at> elephly.net>

Date: Wed, 13 Dec 2017 22:45:02 UTC

Severity: normal

Tags: patch

Done: Ricardo Wurmus <rekado <at> elephly.net>

Bug is archived. No further changes may be made.

Full log


Message #19 received at 29699-done <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 29699-done <at> debbugs.gnu.org
Subject: Re: [bug#29699] [PATCH] guix: offload: Add "status" sub-command.
Date: Sat, 16 Dec 2017 21:52:36 +0100
Ludovic Courtès <ludo <at> gnu.org> writes:

> Ricardo Wurmus <rekado <at> elephly.net> skribis:
>
>> Ludovic Courtès <ludo <at> gnu.org> writes:
>>
>>> Ricardo Wurmus <rekado <at> elephly.net> 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=? m1 m2)
>>>> +    (and (string=? (build-machine-name m1) (build-machine-name m2))
>>>> +         (= (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-file)
>>>> +                                             build-machine=?))))
>>>> +    (for-each machine-load machines)))
>>>
>>> Perhaps we could also display information from ‘uname’, as in
>>> <https://git.savannah.gnu.org/cgit/guix/maintenance.git/tree/hydra/machine-status.scm#n118>?
>>
>> I didn’t even notice machine-status.scm!  Should we just fold that into
>> offload.scm instead of accepting my simplistic “check-machine-load”
>> procedure?
>
> Sure, I guess it’s just a matter of adding (node-eval node '(uname)) in
> ‘check-machine-load’ and printing that.

Okay, pushed to master with commit dafc3dafe.
I renamed the procedure to “check-machine-status” because it does more
than just print the load.

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net






This bug report was last modified 7 years and 213 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.