GNU bug report logs - #36404
[PATCH 0/6] Add 'guix deploy'.

Previous Next

Package: guix-patches;

Reported by: zerodaysfordays <at> sdf.lonestar.org (Jakob L. Kreuze)

Date: Thu, 27 Jun 2019 18:38:02 UTC

Severity: normal

Tags: patch

Done: Christopher Lemmer Webber <cwebber <at> dustycloud.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: zerodaysfordays <at> sdf.lonestar.org (Jakob L. Kreuze)
Cc: Christopher Lemmer Webber <cwebber <at> dustycloud.org>, 36404 <at> debbugs.gnu.org, "Thompson, David" <dthompson2 <at> worcester.edu>
Subject: [bug#36404] [PATCH v4 2/4] gnu: Add machine type for deployment specifications.
Date: Fri, 05 Jul 2019 10:24:10 +0200
zerodaysfordays <at> sdf.lonestar.org (Jakob L. Kreuze) skribis:

> +(define (build-machine machine)
> +  "Monadic procedure that builds the system derivation for MACHINE and returning
> +a list containing the path of the derivation file and the path of the derivation
> +output."
> +  (let ((os (machine-system machine)))
> +    (mlet* %store-monad ((osdrv (operating-system-derivation os))
> +                         (_ ((store-lift build-derivations) (list osdrv))))
> +      (return (list (derivation-file-name osdrv)
> +                    (derivation->output-path osdrv))))))
> +
> +(define (machine-remote-eval machine exp)
> +  "Evaluate EXP, a gexp, on MACHINE. Ensure that all the elements EXP refers to
> +are built and deployed to MACHINE beforehand."
> +  (let ((environment (machine-environment machine)))
> +    ((environment-type-machine-remote-eval environment) machine exp)))
> +
> +(define (deploy-machine machine)
> +  "Monadic procedure transferring the new system's OS closure to the remote
> +MACHINE, activating it on MACHINE and switching MACHINE to the new generation."
> +  (let ((environment (machine-environment machine)))
> +    ((environment-type-deploy-machine environment) machine)))

In the SSH case, ‘deploy-machine’ should roughly translate to:

  (remote-eval #~(switch-to-system #$os) machine)

Thus, ‘build-machine’ is unnecessary: the actual build of OS is
automatically triggered by ‘remote-eval’, either locally or remotely,
depending on #:build-locally?.

So I believe you can remove ‘build-machine’ altogether.

> +        (error "unsupported configuration type"))))

It’s a bit verbose, but I’d suggest using SRFI-34/35 instead, like so:

  (raise (condition
          (&message (message "unsupported machine configuration type"))))

That way, if you also add the file to po/guix/POTFILES.in, i18n will do
its magic.  :-)

Otherwise it looks great to me!

Ludo’.




This bug report was last modified 6 years and 11 days ago.

Previous Next


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