guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guix deploy --keep-going equivalent for machine connection failures


From: Carlo Zancanaro
Subject: Re: Guix deploy --keep-going equivalent for machine connection failures
Date: Wed, 17 Jan 2024 20:43:49 +1100
User-agent: Gnus/5.13 (Gnus v5.13)

On Mon, Jan 15 2024, Richard Sent wrote:
> At present this can be worked around by commenting out entries on the
> list, but this requires
> a) Already knowing what machine is offline
> b) Remembering to uncomment it later when the machine goes back online
> c) Generally feels "ugly" in a way that most Guix commands don't.
> d) Makes version control a pain

This is generally what I've done, but I see this as a manual form of
something that could easily be added the machines.scm file itself.

For instance, you could define a helper function and use it to filter
the list of machines, like so:

  (define (reachable-host? machine)
    (let ((configuration (machine-configuration machine)))
      (cond
       ((machine-ssh-configuration? configuration)
        (zero? (system* "ssh" (machine-ssh-configuration-host-name 
configuration)
                        "--" "true")))
       (else
        #f))))

  (filter
   reachable-host?
   (list
    (machine ...)
    (machine ...)))

Using this sort of approach can implement whatever strategy you want, as
long as you can determine the machines which you want to deploy to
up-front (i.e. this can't implement a strategy that handles failure
partway through deployment).

Carlo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]