* The “binary cache” format
@ 2014-02-07 13:02 Ludovic Courtès
0 siblings, 0 replies; only message in thread
From: Ludovic Courtès @ 2014-02-07 13:02 UTC (permalink / raw)
To: Nikita Karetnikov; +Cc: guix-devel
Hello,
We were discussing on IRC about the “binary cache” format (in Nix
parlance) that Hydra uses, and that ‘guix substitute-binary’ expects.
Basically a “binary cache” HTTP server is expected to serve three kinds
of files:
• The ‘nix-cache-info’ file contains two recutils-style fields, saying
what its store directory is (e.g., “/nix/store”) and whether it
accepts mass queries (IOW, whether ‘guix substitute-binary’ should
use a bunch of threads to make HTTP queries in parallel.)
• For each substitutable store item, it serves a HASH.narinfo file,
which contains recutils-formatted meta-data about the corresponding
substitute: URL and size of the substitute, compression format, etc.
• Each substitutable store item is served as a ‘.nar’ file–an archive
as created by ‘write-file’ in (guix nar).
An example of these three things is the “substitute” test in
tests/store.scm. If creates these three kinds of files in the very same
format that Hydra does.
Now, in addition, ‘guix substitute-binary’ caches .narinfo lookups
locally, to reduce the amount of HTTP requests [0]. This cache is
typically under /var/nix/substitute-binary/cache. That directory
contains one file per looked up substitute. Each file is an
s-expression that contains a time-stamp, and either #f (if the
substitute lookup was negative), or the .narinfo in a string (if the
substitute lookup was positive.)
This caching can be seen in ‘lookup-narinfo’, in substitute-binary.scm.
But note that this cache and its file format is something internal to
‘guix substitute-binary’, and must not be confused with the “binary
cache” format produced by Hydra.
HTH!
Ludo’.
[0] https://lists.gnu.org/archive/html/bug-guix/2013-04/msg00082.html
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-02-07 13:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-07 13:02 The “binary cache” format Ludovic Courtès
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).