[PATCH 0/2] Modify guix-build-coordinator-agent-service

  • Done
  • quality assurance status badge
Details
2 participants
  • Andreas Enge
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Andreas Enge
Severity
normal
A
A
Andreas Enge wrote on 5 Jul 2024 14:27
(address . guix-patches@gnu.org)(name . Andreas Enge)(address . andreas@enge.fr)
cover.1720182298.git.andreas@enge.fr
The following two patches modify the guix-build-coordinator-agent-service
to not have default numerical values for two parameters (setting them to #f
instead, which means that they will be taken from the package). And they
add extra-options.

The motivation is to be able to change them on the fly, by letting
extra-options read them from environment variables.
Andreas Enge (2):
services: guix-build-coordinator-agent: Remove defaults.
services: guix-build-coordinator-agent: Add extra-options.

doc/guix.texi | 8 +++++---
gnu/services/guix.scm | 18 +++++++++++++-----
2 files changed, 18 insertions(+), 8 deletions(-)


base-commit: cb57a3fd9f09f4158f1e2ff122ac855be422f374
prerequisite-patch-id: e0c8dd359305affa867e537d444f0cf688b5e342
--
2.45.2
A
A
Andreas Enge wrote on 5 Jul 2024 14:32
[PATCH 1/2] services: guix-build-coordinator-agent: Remove defaults.
(address . 71947@debbugs.gnu.org)(name . Andreas Enge)(address . andreas@enge.fr)
b95a332f3a2cdb9d3d28d273e3328eed09051fde.1720182298.git.andreas@enge.fr
* gnu/services/guix.scm (<guix-build-coordinator-agent-configuration>)
[max-parallel-builds, max-parallel-uploads]: Set default to #f.
(guix-build-coordinator-agent-shepherd-services): Check for
max-parallel-builds.
* doc/guix.texi (Guix Services): Adapt the documentation.

If set to #f, the default values are now taken as the defaults of the
guix-build-coordinator-agent command.

Change-Id: Ide6dde0e88aa0dc851b6295095f414ca2ddc72ac
---
doc/guix.texi | 6 +++---
gnu/services/guix.scm | 10 ++++++----
2 files changed, 9 insertions(+), 7 deletions(-)

Toggle diff (58 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 7d0824784d..d4d00fd4b8 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -23,7 +23,7 @@
@copying
Copyright @copyright{} 2012-2024 Ludovic Courtès@*
-Copyright @copyright{} 2013, 2014, 2016 Andreas Enge@*
+Copyright @copyright{} 2013, 2014, 2016, 2024 Andreas Enge@*
Copyright @copyright{} 2013 Nikita Karetnikov@*
Copyright @copyright{} 2014, 2015, 2016 Alex Kost@*
Copyright @copyright{} 2015, 2016 Mathieu Lirzin@*
@@ -39656,10 +39656,10 @@ Guix Services
The systems for which this agent should fetch builds. The agent process
will use the current system it's running on as the default.
-@item @code{max-parallel-builds} (default: @code{1})
+@item @code{max-parallel-builds} (default: @code{#f})
The number of builds to perform in parallel.
-@item @code{max-parallel-uploads} (default: @code{1})
+@item @code{max-parallel-uploads} (default: @code{#f})
The number of uploads to perform in parallel.
@item @code{max-allocated-builds} (default: @code{#f})
diff --git a/gnu/services/guix.scm b/gnu/services/guix.scm
index 0182c21ea7..fdeaeeb472 100644
--- a/gnu/services/guix.scm
+++ b/gnu/services/guix.scm
@@ -194,10 +194,10 @@ (define-record-type* <guix-build-coordinator-agent-configuration>
(default #f))
(max-parallel-builds
guix-build-coordinator-agent-configuration-max-parallel-builds
- (default 1))
+ (default #f))
(max-parallel-uploads
guix-build-coordinator-agent-configuration-max-parallel-uploads
- (default 1))
+ (default #f))
(max-allocated-builds
guix-build-coordinator-agent-configuration-max-allocated-builds
(default #f))
@@ -443,8 +443,10 @@ (define (guix-build-coordinator-agent-shepherd-services config)
#~(#$(string-append "--name=" agent-name)
#$(string-append "--dynamic-auth-token-file="
token-file))))
- #$(simple-format #f "--max-parallel-builds=~A"
- max-parallel-builds)
+ #$@(if max-parallel-builds
+ #~(#$(simple-format #f "--max-parallel-builds=~A"
+ max-parallel-builds))
+ #~())
#$@(if max-parallel-uploads
#~(#$(simple-format #f "--max-parallel-uploads=~A"
max-parallel-uploads))
--
2.45.2
A
A
Andreas Enge wrote on 5 Jul 2024 14:32
[PATCH 2/2] services: guix-build-coordinator-agent: Add extra-options.
(address . 71947@debbugs.gnu.org)(name . Andreas Enge)(address . andreas@enge.fr)
85cae78febb3d22547365e4ed3b2d77308927e89.1720182298.git.andreas@enge.fr
* gnu/services/guix.scm (<guix-build-coordinator-agent-configuration>):
Add field extra-options.
(guix-build-coordinator-agent-shepherd-services): Add and use EXTRA-OPTIONS
argument.
* doc/guix.texi (Guix Services): Adapt the documentation.

Change-Id: I9e7e258e03e2b6553aa1570f5fcfaf3b0ada3e15
---
doc/guix.texi | 2 ++
gnu/services/guix.scm | 8 +++++++-
2 files changed, 9 insertions(+), 1 deletion(-)

Toggle diff (55 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index d4d00fd4b8..8bfb342253 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -39682,6 +39682,8 @@ Guix Services
URLs from which to attempt to fetch substitutes for build inputs, if the
input store items aren't already available.
+@item @code{extra-options} (default: @var{'()})
+Extra command line options for @code{guix-build-coordinator-agent}.
@end table
@end deftp
diff --git a/gnu/services/guix.scm b/gnu/services/guix.scm
index fdeaeeb472..6c58b3a292 100644
--- a/gnu/services/guix.scm
+++ b/gnu/services/guix.scm
@@ -66,6 +66,7 @@ (define-module (gnu services guix)
guix-build-coordinator-agent-configuration-max-1min-load-average
guix-build-coordinator-agent-configuration-derivation-substitute-urls
guix-build-coordinator-agent-configuration-non-derivation-substitute-urls
+ guix-build-coordinator-agent-configuration-extra-options
guix-build-coordinator-agent-password-auth
guix-build-coordinator-agent-password-auth?
@@ -209,7 +210,10 @@ (define-record-type* <guix-build-coordinator-agent-configuration>
(default #f))
(non-derivation-substitute-urls
guix-build-coordinator-agent-configuration-non-derivation-substitute-urls
- (default #f)))
+ (default #f))
+ (extra-options
+ guix-build-coordinator-agent-configuration-extra-options
+ (default '())))
(define-record-type* <guix-build-coordinator-agent-password-auth>
guix-build-coordinator-agent-password-auth
@@ -410,6 +414,7 @@ (define (guix-build-coordinator-agent-shepherd-services config)
max-parallel-builds max-parallel-uploads
max-allocated-builds max-1min-load-average
derivation-substitute-urls non-derivation-substitute-urls
+ extra-options
systems)
(list
(shepherd-service
@@ -469,6 +474,7 @@ (define (guix-build-coordinator-agent-shepherd-services config)
"--non-derivation-substitute-urls="
(string-join non-derivation-substitute-urls " ")))
#~())
+ #$@extra-options
#$@(map (lambda (system)
(string-append "--system=" system))
(or systems '())))
--
2.45.2
M
M
Maxim Cournoyer wrote on 9 Jul 2024 04:40
Re: [bug#71947] [PATCH 0/2] Modify guix-build-coordinator-agent-service
(name . Andreas Enge)(address . andreas@enge.fr)
874j8zxp7b.fsf@gmail.com
Hi Andreas,

Andreas Enge <andreas@enge.fr> writes:

Toggle quote (5 lines)
> The following two patches modify the guix-build-coordinator-agent-service
> to not have default numerical values for two parameters (setting them to #f
> instead, which means that they will be taken from the package). And they
> add extra-options.

The above would have been best expressed by a maybe value using the
define-configuration scheme (but you'd have to migrate from the
define-record-type* to define-configuration first -- perhaps for another
time).

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 9 Jul 2024 04:41
(name . Andreas Enge)(address . andreas@enge.fr)
87zfqrwal4.fsf@gmail.com
Andreas Enge <andreas@enge.fr> writes:

Toggle quote (12 lines)
> The following two patches modify the guix-build-coordinator-agent-service
> to not have default numerical values for two parameters (setting them to #f
> instead, which means that they will be taken from the package). And they
> add extra-options.
>
> The motivation is to be able to change them on the fly, by letting
> extra-options read them from environment variables.
> Andreas Enge (2):
> services: guix-build-coordinator-agent: Remove defaults.
> services: guix-build-coordinator-agent: Add extra-options.
>

Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail>

--
Thanks,
Maxim
A
A
Andreas Enge wrote on 18 Sep 2024 11:24
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
ZuqcRu70cDDdSSU1@jurong
Hello Maxim,

Am Mon, Jul 08, 2024 at 10:40:40PM -0400 schrieb Maxim Cournoyer:
Toggle quote (5 lines)
> The above would have been best expressed by a maybe value using the
> define-configuration scheme (but you'd have to migrate from the
> define-record-type* to define-configuration first -- perhaps for another
> time).

thanks for the review, I have just pushed the patches.
Since this is the first time I have touched a service, I contented myself
with making minimal changes and not daring a bigger rewrite.

Andreas
Closed
M
M
Maxim Cournoyer wrote on 22 Sep 2024 04:30
(name . Andreas Enge)(address . andreas@enge.fr)
87o74gmnbw.fsf@gmail.com
Hi Andreas,

Andreas Enge <andreas@enge.fr> writes:

Toggle quote (12 lines)
> Hello Maxim,
>
> Am Mon, Jul 08, 2024 at 10:40:40PM -0400 schrieb Maxim Cournoyer:
>> The above would have been best expressed by a maybe value using the
>> define-configuration scheme (but you'd have to migrate from the
>> define-record-type* to define-configuration first -- perhaps for another
>> time).
>
> thanks for the review, I have just pushed the patches.
> Since this is the first time I have touched a service, I contented myself
> with making minimal changes and not daring a bigger rewrite.

That's understandable. Thanks for doing it all the same!

Cheers,

--
Maxim
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 71947@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 71947
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch