guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Towards reproducibly Jupyter notebooks with Guix-Jupyter


From: Konrad Hinsen
Subject: Re: Towards reproducibly Jupyter notebooks with Guix-Jupyter
Date: Tue, 22 Oct 2019 13:12:47 +0200

Hi Ludo,

> Did you define an environment along the lines of the example at
> <https://guix.gnu.org/manual/devel/en/html_node/Inferiors.html>?

No. I did look at this approach briefly, but it looks difficult at
least, if not impossible.

The situation I need to address is re-creating an environment from
- a channel file (from "guix describe")
- a manifest file (typically hand written)

This should not require editing the manifest file, and it should work
for any manifest file, even if it included package transformations or
literal package definitions (yes, I do that, shame on me, I ought to set
up my own channel instead).

A manifest definition using only lookups by package name and version
would be easy to translate into a manifest containing instances of
inferior-package, but I don't see how to deal with the more exotic
cases. I'd have to construct corresponding instances of inferior-package
myself, which is perhaps possible, but not obvious.

> Depending on the use case, another option is to not use inferiors at all
> and simply do:
>
>   guix pull --commit=XYZ -p ./my-old-guix
>   ./my-old-guix/bin/guix environment --ad-hoc whatevern
>
> But maybe I’m missing something, let me know.  :-)

That was my starting point. It's OK for manual execution, but if I want
an Org-Mode file to this automatically, I need to generate a temporary
file in place of ./my-old-guix with all the associated hassles: check
that it doesn't exist before, and clean up in the end even in the case
of errors. Maybe I'd even have to worry about two processes accessing
the same temporary file and do some locking.

Moreover, I may end up having a performance problem with "guix pull"
being run again for every little script in my Org-Mode file. The big
difference between Jupyter and Org-Mode is that Jupyter has only one
kernel process per notebook, whereas Org-Mode by default has one process
per code block.

My dream would be to have something like

  guix environment -C channels.scm -m manifest.scm

with reasonable caching of the pulled channels. That's in fact what I
was trying to implement.

Cheers,
  Konrad.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]