From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Subject: bug#33370: guix publish: at least one user will have to build a given substitute Date: Wed, 14 Nov 2018 00:48:40 +0100 Message-ID: <87ftw4wnc7.fsf@lassieur.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMiQd-0002gK-Fv for bug-guix@gnu.org; Tue, 13 Nov 2018 18:49:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMiQY-0005BS-EV for bug-guix@gnu.org; Tue, 13 Nov 2018 18:49:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:46479) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gMiQY-0005Am-Aj for bug-guix@gnu.org; Tue, 13 Nov 2018 18:49:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gMiQY-0005Hy-61 for bug-guix@gnu.org; Tue, 13 Nov 2018 18:49:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMiQK-0002g3-Ps for bug-guix@gnu.org; Tue, 13 Nov 2018 18:48:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMiQF-0004zc-Ro for bug-guix@gnu.org; Tue, 13 Nov 2018 18:48:48 -0500 Received: from mail.lassieur.org ([83.152.10.219]:35316) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gMiQF-0004yq-Ke for bug-guix@gnu.org; Tue, 13 Nov 2018 18:48:43 -0500 Received: from rodion (88.191.118.83 [88.191.118.83]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id 71fe4aaa (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO) for ; Tue, 13 Nov 2018 23:48:41 +0000 (UTC) List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 33370@debbugs.gnu.org Hi, I've noticed that narinfo baking is triggered by user requests when the '--cache' option of 'guix publish' is used. It means that the first user who will want it will get the 404 response and will have to build it manually. (See guix/scripts/publish.scm, make-request-handler.) I was reluctant to send this email to bug-guix@gnu.org because it's fairly well documented, but I don't like this behaviour... As a matter of fact I'm often the first user downloading substitutes on my 'guix publish' server. Would it be possible to trigger the baking right after the build is done? So that every user can be sure that they will get the substitute once they know that Cuirass has built it. If 'guix publish' has no way to get the notification that a build is done, maybe Cuirass could trigger the baking? (But that would be hackish in my opinion.) Cheers, Cl=C3=A9ment --8<---------------cut here---------------start------------->8--- =E2=80=98--cache=3DDIRECTORY=E2=80=99 =E2=80=98-c DIRECTORY=E2=80=99 Cache archives and meta-data (=E2=80=98.narinfo=E2=80=99 URLs) to DIRE= CTORY and only serve archives that are in cache. When this option is omitted, archives and meta-data are created on-the-fly. This can reduce the available bandwidth, especially when compression is enabled, since this may become CPU-bound. Another drawback of the default mode is that the length of archives is not known in advance, so =E2=80=98guix publish=E2=80=99 does not ad= d a =E2=80=98Content-Length=E2=80=99 HTTP header to its responses, which i= n turn prevents clients from knowing the amount of data being downloaded. Conversely, when =E2=80=98--cache=E2=80=99 is used, the first request = for a store item (via a =E2=80=98.narinfo=E2=80=99 URL) returns 404 and triggers a= background process to =E2=80=9Cbake=E2=80=9D the archive=E2=80=94computing its = =E2=80=98.narinfo=E2=80=99 and compressing the archive, if needed. Once the archive is cached in DIRECTORY, subsequent requests succeed and are served directly from the cache, which guarantees that clients get the best possible bandwidth. The =E2=80=9Cbaking=E2=80=9D process is performed by worker threads. = By default, one thread per CPU core is created, but this can be customized. See =E2=80=98--workers=E2=80=99 below. When =E2=80=98--ttl=E2=80=99 is used, cached entries are automatically= deleted when they have expired. --8<---------------cut here---------------end--------------->8---