From patchwork Thu Jan 20 10:04:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guillaume Le Vaillant X-Patchwork-Id: 36640 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 069B027BBEA; Thu, 20 Jan 2022 12:05:10 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7B60927BBE9 for ; Thu, 20 Jan 2022 12:05:09 +0000 (GMT) Received: from localhost ([::1]:36652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAWBg-0007t3-8T for patchwork@mira.cbaines.net; Thu, 20 Jan 2022 07:05:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAUKZ-0008Ik-Ri for guix-patches@gnu.org; Thu, 20 Jan 2022 05:06:11 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35295) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAUKQ-0007Ok-Oe for guix-patches@gnu.org; Thu, 20 Jan 2022 05:06:10 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nAUKQ-0005Rb-Kn for guix-patches@gnu.org; Thu, 20 Jan 2022 05:06:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53384] [PATCH] services: guix-publish: Add negative-ttl parameter. Resent-From: Guillaume Le Vaillant Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 20 Jan 2022 10:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53384 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53384@debbugs.gnu.org Cc: Guillaume Le Vaillant X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164267315620909 (code B ref -1); Thu, 20 Jan 2022 10:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 Jan 2022 10:05:56 +0000 Received: from localhost ([127.0.0.1]:56431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAUKJ-0005RB-Jq for submit@debbugs.gnu.org; Thu, 20 Jan 2022 05:05:55 -0500 Received: from lists.gnu.org ([209.51.188.17]:49166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAUKI-0005R3-1S for submit@debbugs.gnu.org; Thu, 20 Jan 2022 05:05:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAUKF-000871-R8 for guix-patches@gnu.org; Thu, 20 Jan 2022 05:05:53 -0500 Received: from mout01.posteo.de ([185.67.36.65]:40149) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAUJx-0007J3-5w for guix-patches@gnu.org; Thu, 20 Jan 2022 05:05:34 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 3D55024002A for ; Thu, 20 Jan 2022 11:05:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1642673129; bh=wt2cafVNTPnVGceylTU2AF0QRyUxvv0iUU5i5XFPAgs=; h=From:To:Cc:Subject:Date:From; b=VEiJd0OQXwAoUIFFU+wNbUFSalkJPrStyCVsr+2SVw3vVQBYQ+8+pqZa4JvGnX2cq gFPJpJHE8YCCte141Uj5ww93ZHKj4BRixEdSyoBU2TmHlCoNNHhoS0p57jK5YNvsqy //CA54TVdnu6mQl99GCCRoK6f4Fc2GehK7IqTRzDJpz8BfLHrD9+IBtQcjlvK9zlzs 3o/vRjHAPbfna0kHbej2XWdW0ayMWrd1ak36KZIeGVX7OoAfbB7kaUADvZI8bI+h+n s/RtNlLNRGM0Kkdxmg7cX/Sy0fa3FDW0LO4yJGYGkQPyU2NBtjAypbw9ZxlXX3sH+6 CFSwS/8Klktlw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4JfdRq3hLDz9rxM; Thu, 20 Jan 2022 11:05:27 +0100 (CET) From: Guillaume Le Vaillant Date: Thu, 20 Jan 2022 10:04:18 +0000 Message-Id: <20220120100418.8490-1-glv@posteo.net> MIME-Version: 1.0 Received-SPF: pass client-ip=185.67.36.65; envelope-from=glv@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services/base.scm (guix-publish-configuration): Add 'negative-ttl' field. (guix-publish-sheperd-service): Process it. * doc/guix.texi (Base Services)[guix-publish-service-type]: Add item for negative-ttl. --- doc/guix.texi | 7 ++++++- gnu/services/base.scm | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 28eaf8338c..912a8e3c5a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -69,7 +69,7 @@ Copyright @copyright{} 2019 Ivan Petkov@* Copyright @copyright{} 2019 Jakob L. Kreuze@* Copyright @copyright{} 2019 Kyle Andrews@* Copyright @copyright{} 2019 Alex Griffin@* -Copyright @copyright{} 2019, 2020, 2021 Guillaume Le Vaillant@* +Copyright @copyright{} 2019, 2020, 2021, 2022 Guillaume Le Vaillant@* Copyright @copyright{} 2020 Liliana Marie Prikler@* Copyright @copyright{} 2019, 2020, 2021, 2022 Simon Tournier@* Copyright @copyright{} 2020 Wiktor Żelazny@* @@ -16888,6 +16888,11 @@ cache miss. @xref{Invoking guix publish, When it is an integer, this denotes the @dfn{time-to-live} in seconds of the published archives. @xref{Invoking guix publish, @option{--ttl}}, for more information. + +@item @code{negative-ttl} (default: @code{#f}) +When it is an integer, this denotes the @dfn{time-to-live} in +seconds for the negative lookups. @xref{Invoking guix publish, +@option{--negative-ttl}}, for more information. @end table @end deftp diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 345e0ca0f7..fbd01e84d6 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -16,6 +16,7 @@ ;;; Copyright © 2021 qblade ;;; Copyright © 2021 Hui Lu ;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2022 Guillaume Le Vaillant ;;; ;;; This file is part of GNU Guix. ;;; @@ -196,6 +197,7 @@ (define-module (gnu services base) guix-publish-configuration-nar-path guix-publish-configuration-cache guix-publish-configuration-ttl + guix-publish-configuration-negative-ttl guix-publish-service-type gpm-configuration @@ -1828,7 +1830,9 @@ (define-record-type* (workers guix-publish-configuration-workers ;#f | integer (default #f)) (ttl guix-publish-configuration-ttl ;#f | integer - (default #f))) + (default #f)) + (negative-ttl guix-publish-configuration-negative-ttl ;#f | integer + (default #f))) (define-deprecated (guix-publish-configuration-compression-level config) "Return a compression level, the old way." @@ -1863,8 +1867,8 @@ (define (config->compression-options config) lst)))) (match-record config - (guix port host nar-path cache workers ttl cache-bypass-threshold - advertise?) + (guix port host nar-path cache workers ttl negative-ttl + cache-bypass-threshold advertise?) (list (shepherd-service (provision '(guix-publish)) (requirement `(user-processes @@ -1890,6 +1894,11 @@ (define (config->compression-options config) #$(number->string ttl) "s")) #~()) + #$@(if negative-ttl + #~((string-append "--negative-ttl=" + #$(number->string negative-ttl) + "s")) + #~()) #$@(if cache #~((string-append "--cache=" #$cache) #$(string-append