unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 29699-done@debbugs.gnu.org
Subject: bug#29699: [PATCH] guix: offload: Add "status" sub-command.
Date: Sat, 16 Dec 2017 21:52:36 +0100	[thread overview]
Message-ID: <87bmiyo0ob.fsf@elephly.net> (raw)
In-Reply-To: <87wp1nehrq.fsf@gnu.org>


Ludovic Courtès <ludo@gnu.org> writes:

> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> Ludovic Courtès <ludo@gnu.org> writes:
>>
>>> Ricardo Wurmus <rekado@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

      reply	other threads:[~2017-12-16 20:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13 22:44 [bug#29699] [PATCH] guix: offload: Add "status" sub-command Ricardo Wurmus
2017-12-15 10:42 ` Ludovic Courtès
2017-12-15 21:05   ` Ricardo Wurmus
2017-12-15 22:41     ` Ludovic Courtès
2017-12-16 20:52       ` Ricardo Wurmus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bmiyo0ob.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=29699-done@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).