all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: guix pack file enumerator?
Date: Wed, 09 Dec 2020 12:04:26 +0100	[thread overview]
Message-ID: <87a6unnsud.fsf@elephly.net> (raw)
In-Reply-To: <877dpswnxl.fsf@gnu.org>


Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> “guix pack” is great for deployment of applications to servers that
>> don’t have Guix.  For a project I have a “deploy” target in my Makefile
>> that essentially does this:
>>
>>     cat $(shell guix pack -RR -e '(load "guix.scm")' -S /bin=bin) | ssh remote-server "tar xvzf - -C /where/i/want/it"
>>
>> This is fine for small deployments, but it’s a little annoying that it
>> transfer *all* the files, even those that haven’t changed.  So I thought
>> I could use rsync here, but it’s inconvenient that “guix pack” will do
>> what it was designed for and produce a single file bundle.
>>
>> What do you think about adding an output format that is no format at all
>> but a file enumeration printed to stdout?  That way I could use “guix
>> pack” to produce a list of files to transfer and use that to transfer
>> only the unchanged files.  Alternatively, perhaps we could have a
>> “directory” format that merely copies (or links) the files to a new
>> directory root.
>
> You could untar the pack and rsync it.  We could have a ‘directory’
> format but I’m afraid it would duplicate too much of the tarball code
> (we’d have to check).

I’m unpacking to rsync now, but it’s not great to duplicate files on the
local disk only to send them over the network.  The ideal workflow for
me would treat the store on my local machine as the source and the
remote machine as the target, without any copying from source to source
in between.

The local-unpack method also requires an empty directory to be
maintained; it needs to be emptied before the next time we try to unpack
anything.

Another downside is the creation of the tarball itself.  I don’t need it
but it’s still created only to be destroyed in the next step.  This is
unfortunate, because Guix could use a different mechanism to “check out”
files from the store to a new location.

> When you think about it, you could just as well have Guix on the other
> side and then use ‘guix copy’… or maybe use Guix directly there.  (As in
> ‘guix pack --localstatedir -RR guix’.)

I didn’t consider this, but yes: this is an option.  It requires the
target to be actively involved, though, which means that I need to spend
more time preparing it.  There’s a certain appeal in treating the target
as a mere dumping ground and coordinating everything from my development
machine.

> I know it’s not what you had in mind, but it seems to me that there’s a
> continuum here, and maybe there’s just a gap to bridge to allow for
> smoother workflows?

Probably.  The only difficulty I see is that none of the formats that
“guix pack” supports allow for arbitrary variations in the packing
process, such as using a different tool for the packing.  To be fair:
none of the currently supported formats need this level of flexibility.
But extending “guix pack” to domains that it was not primarily designed
to cover (such as deploying a pack before it is produced as a local
artifact) may require some of that flexibility.

-- 
Ricardo


  reply	other threads:[~2020-12-09 11:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-06  9:53 guix pack file enumerator? Ricardo Wurmus
2020-12-06 19:33 ` Ryan Prior
2020-12-07 15:14 ` zimoun
2020-12-08 11:13 ` Ludovic Courtès
2020-12-09 11:04   ` Ricardo Wurmus [this message]
2020-12-14  9:48     ` Ludovic Courtès
2020-12-15  2:43       ` Ryan Prior
2020-12-15  9:53         ` Nicolò Balzarotti

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

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

  git send-email \
    --in-reply-to=87a6unnsud.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.