GNU bug report logs - #77585
[PATCH] services: mumi: Add Debbugs rsync as shepherd timer.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Arun Isaac <arunisaac@HIDDEN>; Keywords: patch; dated Sun, 6 Apr 2025 19:32:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Apr 2025 19:31:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 06 15:31:29 2025
Received: from localhost ([127.0.0.1]:49785 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u1ViL-00063B-CA
	for submit <at> debbugs.gnu.org; Sun, 06 Apr 2025 15:31:29 -0400
Received: from lists.gnu.org ([2001:470:142::17]:56200)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <arunisaac@HIDDEN>)
 id 1u1ViH-00062R-MC
 for submit <at> debbugs.gnu.org; Sun, 06 Apr 2025 15:31:26 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <arunisaac@HIDDEN>)
 id 1u1Vi4-0008Vl-LL
 for guix-patches@HIDDEN; Sun, 06 Apr 2025 15:31:12 -0400
Received: from mugam.systemreboot.net ([139.59.75.54])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <arunisaac@HIDDEN>)
 id 1u1Vhz-0007d2-Uh; Sun, 06 Apr 2025 15:31:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=systemreboot.net;
 s=default; t=1743967848;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding;
 bh=vveJcJXC7/7PlJkZNcGAv0/D7kGh4o1ufowB6lDbTRQ=;
 b=lIkaeOk2KWLtQrp0K7JZcNJxrhiNwP1g0xHKU5ewHYZQ5OrhUgySRnPIX9NOCzekRTvOKr
 oYPpLHLrkrkr7Rr6/Poq+c663bktWMaR2flOlWfYOTUQByuhSKLRVq412jAXBU/aAuIATk
 cI66gVPPJtLm4wbAm0KeTQgrXfDilDLMLqFkjQfqbsCfOdoW2Pp1JV5dfsOu3YTMG1SSq2
 M0pOHwmlbKzi36yu2SZ/Tk0zviKwpfdWCUHtdCGGXtDn5t2TSbMi4hGshxC/Qq756tk6e5
 I4HWHIrvDBy1SscNtqvf8SzgKctV11od2I3zdx2de8574mBWWw8UGJ32TIM0jA==
Received: from localhost.localdomain (<unknown> [192.168.2.1])
 by mugam.systemreboot.net (OpenSMTPD) with ESMTPSA id 2338637a
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Sun, 6 Apr 2025 19:30:47 +0000 (UTC)
From: Arun Isaac <arunisaac@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] services: mumi: Add Debbugs rsync as shepherd timer.
Date: Sun,  6 Apr 2025 20:30:27 +0100
Message-ID: <4977368b813a68f775050ff3b00a39139cf2b762.1743967795.git.arunisaac@HIDDEN>
X-Mailer: git-send-email 2.49.0
MIME-Version: 1.0
X-Debbugs-Cc: Ludovic Courtès <ludo@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=139.59.75.54;
 envelope-from=arunisaac@HIDDEN; helo=mugam.systemreboot.net
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
Cc: Arun Isaac <arunisaac@HIDDEN>,
 =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>,
 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

* gnu/services/web.scm (<mumi-configuration>)[data-directory, rsync-remote,
rsync-flags]: New fields.
(%mumi-worker-log): Delete variable.
(%mumi-rsync-and-index-log): New variable.
(mumi-rsync-and-index-gexp): New function.
(mumi-shepherd-services): Remove mumi-worker service. Add mumi-rsync-and-index
service.
(mumi-service-type): Remove default value.
* doc/guix.texi (Web Services)[mumi]: Document data-directory, rsync-remote
and rsync-flags fields.

Co-authored-by: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
---
 doc/guix.texi        |  9 +++++++
 gnu/services/web.scm | 57 ++++++++++++++++++++++++++++++++------------
 2 files changed, 51 insertions(+), 15 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 12f155e912..b6c0e64a53 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -33999,6 +33999,15 @@ Web Services
 @item @code{mumi} (default: @code{mumi})
 The Mumi package to use.
 
+@item @code{data-directory} (default: @file{"/var/mumi/data"})
+Data directory to store Debbugs data from upstream Debbugs instance.
+
+@item @code{rsync-remote}
+Remote rsync path from which to download Debbugs data.
+
+@item @code{rsync-flags} (default: @code{'()})
+Additional flags to pass to @command{rsync}.
+
 @item @code{mailer?} (default: @code{#true})
 Whether to enable or disable the mailer component.
 
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index f8cf06fb48..eea9a19426 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2023 Bruno Victal <mirai@HIDDEN>
 ;;; Copyright © 2023 Miguel Ángel Moreno <mail@HIDDEN>
 ;;; Copyright © 2024 Leo Nikkilä <hello@HIDDEN>
+;;; Copyright © 2025 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -51,6 +52,7 @@ (define-module (gnu services web)
   #:use-module (gnu packages php)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-web)
+  #:use-module (gnu packages rsync)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages logging)
@@ -295,6 +297,9 @@ (define-module (gnu services web)
             mumi-configuration
             mumi-configuration?
             mumi-configuration-mumi
+            mumi-configuration-data-directory
+            mumi-configuration-rsync-remote
+            mumi-configuration-rsync-flags
             mumi-configuration-mailer?
             mumi-configuration-sender
             mumi-configuration-smtp
@@ -2033,6 +2038,11 @@ (define-record-type* <mumi-configuration>
   mumi-configuration make-mumi-configuration
   mumi-configuration?
   (mumi    mumi-configuration-mumi (default mumi))
+  (data-directory mumi-configuration-data-directory
+                  (default "/var/mumi/data"))
+  (rsync-remote mumi-configuration-rsync-remote)
+  (rsync-flags mumi-configuration-rsync-flags
+               (default '()))
   (mailer? mumi-configuration-mailer? (default #t))
   (sender  mumi-configuration-sender (default #f))
   (smtp    mumi-configuration-smtp (default #f))
@@ -2080,7 +2090,7 @@ (define %mumi-log "/var/log/mumi.log")
 
 (define %mumi-mailer-log "/var/log/mumi.mailer.log")
 
-(define %mumi-worker-log "/var/log/mumi.worker.log")
+(define %mumi-rsync-and-index-log "/var/log/mumi.rsync-and-index.log")
 
 (define mumi-package-configuration->alist
   (match-record-lambda <mumi-package-configuration>
@@ -2118,6 +2128,23 @@ (define mumi-config-file
                                           packages)))
                               <>))))))
 
+(define (mumi-rsync-and-index-gexp config)
+  (match-record config <mumi-configuration>
+    (data-directory rsync-remote rsync-flags)
+    (with-imported-modules '((guix build utils))
+      #~(begin
+          (use-modules (guix build utils))
+
+          (invoke #$(file-append rsync "/bin/rsync")
+                  "--delete" "--archive" "--verbose"
+                  "--timeout" "120"
+                  #$@rsync-flags
+                  #$rsync-remote
+                  #$data-directory)
+          (invoke #$(file-append mumi "/bin/mumi") "fetch"
+                  (string-append "--config="
+                                 #$(mumi-config-file config)))))))
+
 (define (mumi-shepherd-services config)
   (define environment
     #~(list "LC_ALL=en_US.utf8"
@@ -2140,17 +2167,19 @@ (define (mumi-shepherd-services config)
                       #:log-file #$%mumi-log))
             (stop #~(make-kill-destructor)))
            (shepherd-service
-            (provision '(mumi-worker))
-            (documentation "Mumi bug-tracking web interface database worker.")
-            (requirement '(user-processes networking))
-            (start #~(make-forkexec-constructor
-                      `(#$(file-append mumi "/bin/mumi") "worker"
-                        ,(string-append "--config="
-                                        #$(mumi-config-file config)))
-                      #:environment-variables #$environment
-                      #:user "mumi" #:group "mumi"
-                      #:log-file #$%mumi-worker-log))
-            (stop #~(make-kill-destructor)))
+            (provision '(mumi-rsync-and-index))
+            (modules '((shepherd service timer)))
+            (start #~(make-timer-constructor
+                      (calendar-event)
+                      (command
+                       (program-file "mumi-rsync-and-index"
+                                     (mumi-rsync-and-index-gexp config)))
+                      #:log-file #$%mumi-rsync-and-index-log
+                      #:max-duration (* 60 60)
+                      #:wait-for-termination? #t))
+            (stop #~(make-timer-destructor))
+            (actions (list shepherd-trigger-action))
+            (documentation "Rsync and index the GNU Debbugs data"))
            (shepherd-service
             (provision '(mumi-mailer))
             (documentation "Mumi bug-tracking web interface mailer.")
@@ -2181,9 +2210,7 @@ (define mumi-service-type
           (service-extension shepherd-root-service-type
                              mumi-shepherd-services)))
    (description
-    "Run Mumi, a Web interface to the Debbugs bug-tracking server.")
-   (default-value
-     (mumi-configuration))))
+    "Run Mumi, a Web interface to the Debbugs bug-tracking server.")))
 
 (define %default-gmnisrv-config-file
   (plain-file "gmnisrv.ini" "

base-commit: ada14197fb465c1c90efbc450308c14f077ff167
-- 
2.49.0





Acknowledgement sent to Arun Isaac <arunisaac@HIDDEN>:
New bug report received and forwarded. Copy sent to ludo@HIDDEN, maxim.cournoyer@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to ludo@HIDDEN, maxim.cournoyer@HIDDEN, guix-patches@HIDDEN:
bug#77585; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 6 Apr 2025 19:45:01 UTC

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