[PATCH] services: guix-build-coordinator: Remove duplicate log timestamp.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal

Debbugs page

Christopher Baines wrote 2 years ago
(address . guix-patches@gnu.org)
20221110140852.24447-1-mail@cbaines.net
* gnu/services/guix.scm (guix-build-coordinator-shepherd-services,
guix-build-coordinator-agent-shepherd-services,
guix-build-coordinator-queue-builds-shepherd-services): Set
%current-logfile-date-format to "".
---
gnu/services/guix.scm | 246 +++++++++++++++++++++++-------------------
1 file changed, 134 insertions(+), 112 deletions(-)

Toggle diff (274 lines)
diff --git a/gnu/services/guix.scm b/gnu/services/guix.scm
index 907824ac61..cc31ec271b 100644
--- a/gnu/services/guix.scm
+++ b/gnu/services/guix.scm
@@ -333,31 +333,38 @@ (define (guix-build-coordinator-shepherd-services config)
(documentation "Guix Build Coordinator")
(provision '(guix-build-coordinator))
(requirement '(networking))
- (start #~(make-forkexec-constructor
- (list #$(make-guix-build-coordinator-start-script
- database-uri-string
- allocation-strategy
- "/var/run/guix-build-coordinator/pid"
- package
- #:agent-communication-uri-string
- agent-communication-uri-string
- #:client-communication-uri-string
- client-communication-uri-string
- #:hooks hooks
- #:parallel-hooks parallel-hooks
- #:guile guile))
- #:user #$user
- #:group #$group
- #:pid-file "/var/run/guix-build-coordinator/pid"
- ;; Allow time for migrations to run
- #:pid-file-timeout 60
- #:environment-variables
- `(,(string-append
- "GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale")
- "LC_ALL=en_US.utf8"
- "PATH=/run/current-system/profile/bin") ; for hooks
- #:log-file "/var/log/guix-build-coordinator/coordinator.log"))
- (stop #~(make-kill-destructor))))))
+ (start #~(lambda args
+ (parameterize ((%current-logfile-date-format ""))
+ (apply
+ (make-forkexec-constructor
+ (list #$(make-guix-build-coordinator-start-script
+ database-uri-string
+ allocation-strategy
+ "/var/run/guix-build-coordinator/pid"
+ package
+ #:agent-communication-uri-string
+ agent-communication-uri-string
+ #:client-communication-uri-string
+ client-communication-uri-string
+ #:hooks hooks
+ #:parallel-hooks parallel-hooks
+ #:guile guile))
+ #:user #$user
+ #:group #$group
+ #:pid-file "/var/run/guix-build-coordinator/pid"
+ ;; Allow time for migrations to run
+ #:pid-file-timeout 60
+ #:environment-variables
+ `(,(string-append
+ "GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale")
+ "LC_ALL=en_US.utf8"
+ "PATH=/run/current-system/profile/bin") ; for hooks
+ #:log-file "/var/log/guix-build-coordinator/coordinator.log")
+ args))))
+ (stop #~(make-kill-destructor))
+ (modules
+ `((shepherd comm)
+ ,@%default-modules))))))
(define (guix-build-coordinator-activation config)
#~(begin
@@ -419,61 +426,69 @@ (define (guix-build-coordinator-agent-shepherd-services config)
(documentation "Guix Build Coordinator Agent")
(provision '(guix-build-coordinator-agent))
(requirement '(networking))
- (start #~(make-forkexec-constructor
- (list #$(file-append package "/bin/guix-build-coordinator-agent")
- #$(string-append "--coordinator=" coordinator)
- #$@(match authentication
- (($ <guix-build-coordinator-agent-password-auth>
- uuid password)
- #~(#$(string-append "--uuid=" uuid)
- #$(string-append "--password=" password)))
- (($ <guix-build-coordinator-agent-password-file-auth>
- uuid password-file)
- #~(#$(string-append "--uuid=" uuid)
- #$(string-append "--password-file="
- password-file)))
- (($ <guix-build-coordinator-agent-dynamic-auth>
- agent-name token)
- #~(#$(string-append "--name=" agent-name)
- #$(string-append "--dynamic-auth-token=" token)))
- (($
- <guix-build-coordinator-agent-dynamic-auth-with-file>
- agent-name token-file)
- #~(#$(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-allocated-builds
- #~(#$(simple-format #f "--max-allocated-builds=~A"
- max-allocated-builds))
- #~())
- #$@(if max-1min-load-average
- #~(#$(simple-format #f "--max-1min-load-average=~A"
- max-1min-load-average))
- #~())
- #$@(if derivation-substitute-urls
- #~(#$(string-append
- "--derivation-substitute-urls="
+ (start
+ #~(lambda args
+ (parameterize ((%current-logfile-date-format ""))
+ (apply
+ make-forkexec-constructor
+ (list #$(file-append package "/bin/guix-build-coordinator-agent")
+ #$(string-append "--coordinator=" coordinator)
+ #$@(match authentication
+ (($ <guix-build-coordinator-agent-password-auth>
+ uuid password)
+ #~(#$(string-append "--uuid=" uuid)
+ #$(string-append "--password=" password)))
+ (($ <guix-build-coordinator-agent-password-file-auth>
+ uuid password-file)
+ #~(#$(string-append "--uuid=" uuid)
+ #$(string-append "--password-file="
+ password-file)))
+ (($ <guix-build-coordinator-agent-dynamic-auth>
+ agent-name token)
+ #~(#$(string-append "--name=" agent-name)
+ #$(string-append "--dynamic-auth-token=" token)))
+ (($
+ <guix-build-coordinator-agent-dynamic-auth-with-file>
+ agent-name token-file)
+ #~(#$(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-allocated-builds
+ #~(#$(simple-format #f "--max-allocated-builds=~A"
+ max-allocated-builds))
+ #~())
+ #$@(if max-1min-load-average
+ #~(#$(simple-format #f "--max-1min-load-average=~A"
+ max-1min-load-average))
+ #~())
+ #$@(if derivation-substitute-urls
+ #~(#$(string-append
+ "--derivation-substitute-urls="
(string-join derivation-substitute-urls " ")))
- #~())
- #$@(if non-derivation-substitute-urls
- #~(#$(string-append
- "--non-derivation-substitute-urls="
- (string-join non-derivation-substitute-urls " ")))
- #~())
- #$@(map (lambda (system)
- (string-append "--system=" system))
- (or systems '())))
- #:user #$user
- #:environment-variables
- `(,(string-append
- "GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale")
- ;; XDG_CACHE_HOME is used by Guix when caching narinfo files
- "XDG_CACHE_HOME=/var/cache/guix-build-coordinator-agent"
- "LC_ALL=en_US.utf8")
- #:log-file "/var/log/guix-build-coordinator/agent.log"))
- (stop #~(make-kill-destructor))))))
+ #~())
+ #$@(if non-derivation-substitute-urls
+ #~(#$(string-append
+ "--non-derivation-substitute-urls="
+ (string-join non-derivation-substitute-urls " ")))
+ #~())
+ #$@(map (lambda (system)
+ (string-append "--system=" system))
+ (or systems '())))
+ #:user #$user
+ #:environment-variables
+ `(,(string-append
+ "GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale")
+ ;; XDG_CACHE_HOME is used by Guix when caching narinfo files
+ "XDG_CACHE_HOME=/var/cache/guix-build-coordinator-agent"
+ "LC_ALL=en_US.utf8")
+ #:log-file "/var/log/guix-build-coordinator/agent.log")
+ args)))
+ (stop #~(make-kill-destructor))
+ (modules
+ `((shepherd comm)
+ ,@%default-modules))))))
(define (guix-build-coordinator-agent-activation config)
#~(begin
@@ -526,39 +541,46 @@ (define (guix-build-coordinator-queue-builds-shepherd-services config)
(provision '(guix-build-coordinator-queue-builds))
(requirement '(networking))
(start
- #~(make-forkexec-constructor
- (list
- #$(file-append
- package
- "/bin/guix-build-coordinator-queue-builds-from-guix-data-service")
- #$(string-append "--coordinator=" coordinator)
- #$@(map (lambda (system)
- (string-append "--system=" system))
- (or systems '()))
- #$@(map (match-lambda
- ((system . target)
- (string-append "--system-and-target=" system "=" target)))
- (or systems-and-targets '()))
- #$@(if guix-data-service
- #~(#$(string-append "--guix-data-service=" guix-data-service))
- #~())
- #$@(if guix-data-service-build-server-id
- #~(#$(simple-format
- #f
- "--guix-data-service-build-server-id=~A"
- guix-data-service-build-server-id))
- #~())
- #$@(if processed-commits-file
- #~(#$(string-append "--processed-commits-file="
- processed-commits-file))
- #~()))
- #:user #$user
- #:environment-variables
- `(,(string-append
- "GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale")
- "LC_ALL=en_US.utf8")
- #:log-file "/var/log/guix-build-coordinator/queue-builds.log"))
- (stop #~(make-kill-destructor))))))
+ #~(lambda args
+ (parameterize ((%current-logfile-date-format ""))
+ (apply
+ (make-forkexec-constructor
+ (list
+ #$(file-append
+ package
+ "/bin/guix-build-coordinator-queue-builds-from-guix-data-service")
+ #$(string-append "--coordinator=" coordinator)
+ #$@(map (lambda (system)
+ (string-append "--system=" system))
+ (or systems '()))
+ #$@(map (match-lambda
+ ((system . target)
+ (string-append "--system-and-target=" system "=" target)))
+ (or systems-and-targets '()))
+ #$@(if guix-data-service
+ #~(#$(string-append "--guix-data-service=" guix-data-service))
+ #~())
+ #$@(if guix-data-service-build-server-id
+ #~(#$(simple-format
+ #f
+ "--guix-data-service-build-server-id=~A"
+ guix-data-service-build-server-id))
+ #~())
+ #$@(if processed-commits-file
+ #~(#$(string-append "--processed-commits-file="
+ processed-commits-file))
+ #~()))
+ #:user #$user
+ #:environment-variables
+ `(,(string-append
+ "GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale")
+ "LC_ALL=en_US.utf8")
+ #:log-file "/var/log/guix-build-coordinator/queue-builds.log")
+ args))))
+ (stop #~(make-kill-destructor))
+ (modules
+ `((shepherd comm)
+ ,@%default-modules))))))
(define (guix-build-coordinator-queue-builds-activation config)
#~(begin
--
2.38.1
Ludovic Courtès wrote 2 years ago
(name . Christopher Baines)(address . mail@cbaines.net)(address . 59171@debbugs.gnu.org)
87k03xo3bh.fsf@gnu.org
Hi,

Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (5 lines)
> * gnu/services/guix.scm (guix-build-coordinator-shepherd-services,
> guix-build-coordinator-agent-shepherd-services,
> guix-build-coordinator-queue-builds-shepherd-services): Set
> %current-logfile-date-format to "".

[...]

Toggle quote (29 lines)
> + (start #~(lambda args
> + (parameterize ((%current-logfile-date-format ""))
> + (apply
> + (make-forkexec-constructor
> + (list #$(make-guix-build-coordinator-start-script
> + database-uri-string
> + allocation-strategy
> + "/var/run/guix-build-coordinator/pid"
> + package
> + #:agent-communication-uri-string
> + agent-communication-uri-string
> + #:client-communication-uri-string
> + client-communication-uri-string
> + #:hooks hooks
> + #:parallel-hooks parallel-hooks
> + #:guile guile))
> + #:user #$user
> + #:group #$group
> + #:pid-file "/var/run/guix-build-coordinator/pid"
> + ;; Allow time for migrations to run
> + #:pid-file-timeout 60
> + #:environment-variables
> + `(,(string-append
> + "GUIX_LOCPATH=" #$glibc-utf8-locales "/lib/locale")
> + "LC_ALL=en_US.utf8"
> + "PATH=/run/current-system/profile/bin") ; for hooks
> + #:log-file "/var/log/guix-build-coordinator/coordinator.log")
> + args))))

It’s not pretty but I don’t have anything else to offer.

Perhaps you can make it slightly less verbose by writing it like this:

(start #~(lambda ()
;; Arrange so that shepherd does not add a timestamp to
;; the logs produced by the Coordinator.
(parameterize …
(fork+exec-command (list …) …))))

There are other services in a similar situation. I wonder what we
should recommend.

Ludo’.
Christopher Baines wrote 2 years ago
(address . 59171-done@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
87leo5x21f.fsf@cbaines.net
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (11 lines)
> Perhaps you can make it slightly less verbose by writing it like this:
>
> (start #~(lambda ()
> ;; Arrange so that shepherd does not add a timestamp to
> ;; the logs produced by the Coordinator.
> (parameterize …
> (fork+exec-command (list …) …))))
>
> There are other services in a similar situation. I wonder what we
> should recommend.

Thanks, I've gone ahead and pushed this with the tweak suggested above
as dafab37110677e2968deed817ba4872fe5a8f07c.

Chris
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmN6GG1fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XcYng//eIZa3fJ06Siw13DwvxgDgQnGQl3XDEWT
NfN0bjl75CuN4VoY1Nbo+wBAbeu8EPDhBkiiscyMBeXvQHf+STbEVwjGeJyYdksS
gBrVBJ+QX+aAAycXQ2R/8eFd6TBP95K1Wlfr6+f3zi3YhBLtnuVpPFi0qUwbDj92
1KcHa93CQNSkeZNlXBnl22AHHI5hG32eeO96xpXbHXst58e4iEln8dukpB5GiuGs
a00F6LGWN1AmF9CnZkldbrQAknYUAEma0G6DjSwdvlEwKNdr6LdipOwkRvwjTfar
PNWP5fbR9F4/NkZcGtHo/GmLYJUaDHtmQH1yAgYcnblpXoJELj7n7gEKU9j7Jjeu
S0Do+4dT1AE9pAHQdTG4na67gRg8IPK/9TU3R0yC7K3dAPNre42UMmnkqYvu/BBA
h1J59Rb9oHazwyNzEXzuzxjLug1uKyFzYXo9rUXe8nw3ukTF8QrjrJfZdSVUqAtY
vYdfLzrag2upx//H/g7u3qqZM9sOcu/DhRLmJ8I44RZR4P7J1F9Y7rk9wRx36QVh
tsQUwi28YurtUUeBTXinnM7+O+V+26Fi/IYSYClEA58L3UMffRnvo23M9QNknjs4
xR8tUEhaeLw+J3ignbmMhUlU//AMRZfGnVonnrhfH5MeNXFHPhkjRWSqHwE6Udw5
AAHQfWh/qUw=
=S20X
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 59171
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
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help