[PATCH] machine: Add 'build-locally?' field for managed hosts.

  • Done
  • quality assurance status badge
Details
2 participants
  • Christopher Lemmer Webber
  • Jakob L. Kreuze
Owner
unassigned
Submitted by
Jakob L. Kreuze
Severity
normal
J
J
Jakob L. Kreuze wrote on 7 Aug 2019 14:44
(address . guix-patches@gnu.org)
87imr9402l.fsf@sdf.lonestar.org
* gnu/machine/ssh.scm (machine-ssh-configuration-build-locally?): New
variable.
(managed-host-remote-eval): Pass 'build-locally?' to 'remote-eval'.
---
gnu/machine/ssh.scm | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)

Toggle diff (53 lines)
diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index ae312597dd..1f16d9a5ea 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -47,6 +47,7 @@
machine-ssh-configuration
machine-ssh-configuration-host-name
+ machine-ssh-configuration-build-locally?
machine-ssh-configuration-port
machine-ssh-configuration-user
machine-ssh-configuration-session))
@@ -69,15 +70,17 @@
make-machine-ssh-configuration
machine-ssh-configuration?
this-machine-ssh-configuration
- (host-name machine-ssh-configuration-host-name) ; string
- (port machine-ssh-configuration-port ; integer
- (default 22))
- (user machine-ssh-configuration-user ; string
- (default "root"))
- (identity machine-ssh-configuration-identity ; path to a private key
- (default #f))
- (session machine-ssh-configuration-session ; session
- (default #f)))
+ (host-name machine-ssh-configuration-host-name) ; string
+ (build-locally? machine-ssh-configuration-build-locally?
+ (default #t))
+ (port machine-ssh-configuration-port ; integer
+ (default 22))
+ (user machine-ssh-configuration-user ; string
+ (default "root"))
+ (identity machine-ssh-configuration-identity ; path to a private key
+ (default #f))
+ (session machine-ssh-configuration-session ; session
+ (default #f)))
(define (machine-ssh-session machine)
"Return the SSH session that was given in MACHINE's configuration, or create
@@ -103,7 +106,10 @@ one from the configuration's parameters if one was not provided."
"Internal implementation of 'machine-remote-eval' for MACHINE instances with
an environment type of 'managed-host."
(maybe-raise-unsupported-configuration-error machine)
- (remote-eval exp (machine-ssh-session machine)))
+ (remote-eval exp (machine-ssh-session machine)
+ #:build-locally?
+ (machine-ssh-configuration-build-locally?
+ (machine-configuration machine))))
;;;
--
2.22.0
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEa1VJLOiXAjQ2BGSm9Qb9Fp2P2VoFAl1Kx6IACgkQ9Qb9Fp2P
2VodWA/+Pn9CjudwlzQylW3A+ULRjej06E/2siVomfgT9gw6JVmfaN2JyUt9ORs3
SwNmDfTIkmp1pWuQeprgU6PCyYRh9FCHHuLKa41xoyl106UR+KJKBYBL1an8OyJ9
vODYyM3HwJjRJIvMnC9uV4+bqrWF9OfJ4C2H55jhgH5uyDReqsOS6eu0s8+mprQf
OulP/5E2v89SSNI2Duyl9iMxg23Eq+kVZrgxbx3xlHTo6bZv/iJlIbnm2n4S+kil
6dt0KcDYhmH0L4k0qezyG+loPfvAZVdfPNUOfNzSPhHMzkM/lR7eYqrLCxxiCw6M
xGcmmAm6Iu9JGcCLXK7SCf+VrkzvzlT9TTSp7c/k21rXRbVlcMv431ymXro9qBsf
M06gd0QFFHLNLak/hOCK+sYeP8iXHh2ofWXWARvw9L30ZAu8XmrfGFXXRZ/Jkb6B
1hQ563MWqlGEEOp8qe/p3G1H1e88M4A5oedHtvUvXgGzIvz0euWBRETBjITp6+l8
rTG13Izqw8ftan+4HS/qmrn4kWm+MVlHaXBzx6pKjb0xReNYjrAuljAe8EyPz2lc
qh5vVYvxdoA2KLV0XurF/IUlNeFxseZaWqk8Pf+ejYsrOJPr3tuyN3fVTOVIPG/l
X50/LwNH8nCs0sYZ+2JfeSFe5gRtLj9UN/U54SuTU0opu1teH9U=
=LaV8
-----END PGP SIGNATURE-----

C
C
Christopher Lemmer Webber wrote on 7 Aug 2019 21:20
(address . guix-patches@gnu.org)(address . 36955@debbugs.gnu.org)
8736icpysk.fsf@dustycloud.org
Looks good, though I assume this is a dependency for another patch
that's coming?

Jakob L. Kreuze writes:

Toggle quote (58 lines)
> * gnu/machine/ssh.scm (machine-ssh-configuration-build-locally?): New
> variable.
> (managed-host-remote-eval): Pass 'build-locally?' to 'remote-eval'.
> ---
> gnu/machine/ssh.scm | 26 ++++++++++++++++----------
> 1 file changed, 16 insertions(+), 10 deletions(-)
>
> diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
> index ae312597dd..1f16d9a5ea 100644
> --- a/gnu/machine/ssh.scm
> +++ b/gnu/machine/ssh.scm
> @@ -47,6 +47,7 @@
> machine-ssh-configuration
>
> machine-ssh-configuration-host-name
> + machine-ssh-configuration-build-locally?
> machine-ssh-configuration-port
> machine-ssh-configuration-user
> machine-ssh-configuration-session))
> @@ -69,15 +70,17 @@
> make-machine-ssh-configuration
> machine-ssh-configuration?
> this-machine-ssh-configuration
> - (host-name machine-ssh-configuration-host-name) ; string
> - (port machine-ssh-configuration-port ; integer
> - (default 22))
> - (user machine-ssh-configuration-user ; string
> - (default "root"))
> - (identity machine-ssh-configuration-identity ; path to a private key
> - (default #f))
> - (session machine-ssh-configuration-session ; session
> - (default #f)))
> + (host-name machine-ssh-configuration-host-name) ; string
> + (build-locally? machine-ssh-configuration-build-locally?
> + (default #t))
> + (port machine-ssh-configuration-port ; integer
> + (default 22))
> + (user machine-ssh-configuration-user ; string
> + (default "root"))
> + (identity machine-ssh-configuration-identity ; path to a private key
> + (default #f))
> + (session machine-ssh-configuration-session ; session
> + (default #f)))
>
> (define (machine-ssh-session machine)
> "Return the SSH session that was given in MACHINE's configuration, or create
> @@ -103,7 +106,10 @@ one from the configuration's parameters if one was not provided."
> "Internal implementation of 'machine-remote-eval' for MACHINE instances with
> an environment type of 'managed-host."
> (maybe-raise-unsupported-configuration-error machine)
> - (remote-eval exp (machine-ssh-session machine)))
> + (remote-eval exp (machine-ssh-session machine)
> + #:build-locally?
> + (machine-ssh-configuration-build-locally?
> + (machine-configuration machine))))
>
>
> ;;;
J
J
Jakob L. Kreuze wrote on 7 Aug 2019 22:47
(name . Christopher Lemmer Webber)(address . cwebber@dustycloud.org)(address . 36955@debbugs.gnu.org)
87a7ckln3t.fsf@sdf.lonestar.org
Hi Chris,

Christopher Lemmer Webber <cwebber@dustycloud.org> writes:

Toggle quote (3 lines)
> Looks good, though I assume this is a dependency for another patch
> that's coming?

Nah, this is standalone. Just so there's an option to offload the builds
when deploying to particularly capable machines.

Regards,
Jakob
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEa1VJLOiXAjQ2BGSm9Qb9Fp2P2VoFAl1LOMYACgkQ9Qb9Fp2P
2VqwWhAAlmQvLuf+eoCLg3WrLwnEbEj5PUajW9MpUJecE9CByzrJmBcA+tSqTQi9
ocD1Rw5OA/GR7voZ4A9Dsv7ToSbOxKjk7pcvkiJJ2jsc8STAfSJyp8ZldgAuWBTA
OgwyVXw7YUpraxfMjclHvoRqEwILZosrBnvB9fFAANxnayZXyolluaNQShw15S5d
HMjt1ejBadJfWxh+87pTCusV5l8+72PD4iV9xRXGP6l0jUG0HoN3ZGWbdxI6lJ9y
DXoAfRT2NFwyMofxYDfmnTtU4SBdUzpuVaah6xVTi6W3lUfqjUaY/97/exK3j2OU
dxyeQEMsXY/1yD+TI6oGiIDVQmE04gPWHGQxP70lNL8hqwiWNyPKga+kkFZiwpPL
fqIS+lxYnW6Ar1MiDocrjuajN1irN8lNEgvrN5LOMh/SySI8ELPQAwxbXOY8FxVA
tMKzCJZ8sPgMJVa6n4gR9gTgbMg0HYJeSdROerMiwGZZQhJ+8mSlLiqBNu7kt/kk
WdkFV4uypJwEb+RGevOR7q9wAtU4mOSE/YVu11/2sLN/3wGXqSMgq7LDLm2cKH/1
fXoawvgS75baPbD3nB9rKJu7U3gcvnXrSfVMB6GqDxcV4tzEwh6cydRSlYYHM+PK
bhGKGHbqwKj0yoWPbE8o08igoRdM4nTAuUD3+PD97+JFgRESy7Y=
=M7oq
-----END PGP SIGNATURE-----

C
C
Christopher Lemmer Webber wrote on 8 Aug 2019 00:29
(name . Jakob L. Kreuze)(address . zerodaysfordays@sdf.lonestar.org)(address . 36955-done@debbugs.gnu.org)
87tvasobhi.fsf@dustycloud.org
Jakob L. Kreuze writes:

Toggle quote (13 lines)
> Hi Chris,
>
> Christopher Lemmer Webber <cwebber@dustycloud.org> writes:
>
>> Looks good, though I assume this is a dependency for another patch
>> that's coming?
>
> Nah, this is standalone. Just so there's an option to offload the builds
> when deploying to particularly capable machines.
>
> Regards,
> Jakob

Ok, thanks for the clarity. Merged and pushed!
Closed
?