unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: 26201@debbugs.gnu.org, guix-sysadmin@gnu.org
Subject: bug#26201: hydra.gnu.org uses ‘guix publish’ for nars and narinfos
Date: Wed, 03 May 2017 11:25:38 +0200	[thread overview]
Message-ID: <87k25ywaul.fsf@gnu.org> (raw)
In-Reply-To: <877f1yjr64.fsf@netris.org> (Mark H. Weaver's message of "Wed, 03 May 2017 04:11:31 -0400")

Hello,

Mark H Weaver <mhw@netris.org> skribis:

> Actually, IIUC, the build slaves are _already_ compressing everything,
> and they always have.  They compress the build outputs for transmission
> back to the master machine.  In the current framework, the master
> machine immediately decompresses them upon receipt, and this compression
> and decompression is considered an internal detail of the network
> transport.
>
> Currently, the master machine stores all build outputs uncompressed in
> /gnu/store, and then later recompresses them for transmission to users
> and other build slaves.  The needless decompression and recompression is
> a tremendous amount of wasted work on our master machine.  That it's all
> stored uncompressed is also a significant waste of disk space, which
> leads to significant additional costs during garbage collection.
>
> Essentially, my proposal is for the build slaves to be modified to
> prepare the compressed NARs in a form suitable for delivery to end users
> (and other build slaves) with minimal processing by our master node.
> The master node would be significantly modified to receive, store, and
> forward NARs explicitly, without ever decompressing them.  As far as I
> can tell, this would mean strictly less work to do and less data to
> store for every machine and in every case.

I agree that the redundant compression/decompression is terrible.  Yet
I’m not sure how to architect a solution where compression is performed
by build machines.  The main issue is that offloading and publication
are two independent mechanisms, as things are.

Maybe each build machine for a build farm use-case we could have a
“semi-offloading” mechanism whereby the master spawns a remote build
without retrieving its result, something akin to:

  GUIX_DAEMON_SOCKET=ssh://build-machine.example.org \
  guix build /gnu/store/…-foo.drv

In addition, the build machine would publish its result via ‘guix
publish’, which the master could then simply mirror and cache with
nginx.

There’s the issue of signatures, but perhaps we could have a more
sophisticated PKI and have the master delegate to build machines…

Then there are other issues such as that of synchronizing the TTL of a
narinfo and its corresponding nar, which --cache addresses.

Tricky!

> Ludovic has pointed out that we cannot do this because Hydra must add
> its digital signature, and that this digital signature is stored within
> the compressed NAR.  Therefore, we cannot avoid having the master
> machine decompress and recompress every NAR that is delivered to users.
>
> In my opinion, we should change the way we sign NARs.  Signatures should
> be external to the NARs, not internal.  Not only would this allow us to
> decentralize production of our NARs, but more importantly, it would
> enable a community of independent builders to add their signatures to a
> common pool of NARs.  Having a common pool of NARs enables us to store
> these NARs in a shared distribution network without duplication.  We
> cannot even have a common pool of NARs if they contain
> build-farm-specific data such as signatures.

Currently the signature is in the narinfos, not in nars proper¹.  So we
can already add signatures on an externally provided nar, for instance.

There’s a silly limitation currently, which is that the signature is
computed over all the fields of the narinfo.  That’s silly because it
means that if you change, say, the compression format or the URL of the
nar, then the signature becomes invalid.  We should fix that at some
point.

Ludo’.

¹ For ‘guix publish’.  ‘guix archive --export’ appends a signature to
  the nar set.

  reply	other threads:[~2017-05-03  9:26 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21  1:44 bug#26201: No notification of cache misses when downloading substitutes dian_cecht
2017-03-21  2:46 ` Tobias Geerinckx-Rice
2017-03-21  2:52   ` dian_cecht
2017-03-21  3:57     ` Tobias Geerinckx-Rice
2017-03-21  4:48       ` dian_cecht
2017-03-21  6:21         ` Tobias Geerinckx-Rice
2017-03-21  6:49           ` dian_cecht
2017-03-21 14:55             ` Tobias Geerinckx-Rice
2017-03-21 15:32               ` dian_cecht
2017-03-21 16:07                 ` Tobias Geerinckx-Rice
2017-03-24  2:15                   ` Maxim Cournoyer
2017-03-21 12:59         ` Florian Pelz
2017-03-21 15:35           ` dian_cecht
2017-03-21 16:43       ` Ludovic Courtès
2017-03-21 17:08         ` Tobias Geerinckx-Rice
2017-03-22 22:06           ` Ludovic Courtès
2017-03-23 19:25             ` bug#26201: hydra.gnu.org uses ‘guix publish’ for nars and narinfos Tobias Geerinckx-Rice
2017-03-22 22:22           ` Ludovic Courtès
2017-03-23 10:29             ` Ricardo Wurmus
2017-03-23 18:36             ` Mark H Weaver
2017-03-23 18:52               ` Tobias Geerinckx-Rice
2017-03-24  8:12                 ` Mark H Weaver
2017-03-24  9:25                   ` Ludovic Courtès
2017-04-17 21:36                     ` Ludovic Courtès
2017-04-18 21:27                     ` Ludovic Courtès
2017-04-19 14:24                       ` bug#26201: Heads-up: hydra.gnu.org uses ‘guix publish --cache’ Ludovic Courtès
2017-03-26 17:35                   ` bug#26201: hydra.gnu.org uses ‘guix publish’ for nars and narinfos Tobias Geerinckx-Rice
2017-03-27 18:47                     ` Tobias Geerinckx-Rice
2017-03-28 14:47                       ` Ludovic Courtès
2017-05-03  8:11                     ` Mark H Weaver
2017-05-03  9:25                       ` Ludovic Courtès [this message]
2017-03-27 11:20             ` bug#26201: Bandwidth when retrieving substitutes Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k25ywaul.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=26201@debbugs.gnu.org \
    --cc=guix-sysadmin@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).