unofficial mirror of guix-science@gnu.org 
 help / color / mirror / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: Thibault Lestang <t.lestang@imperial.ac.uk>
Cc: guix-science <guix-science@gnu.org>
Subject: Re: Conda environments and reproducibility
Date: Tue, 29 Nov 2022 15:25:07 +0100	[thread overview]
Message-ID: <86mt897s8s.fsf@gmail.com> (raw)
In-Reply-To: <87v8myypsg.fsf@imperial.ac.uk>

Hi Thibault,

On Tue, 29 Nov 2022 at 10:41, Thibault Lestang <t.lestang@imperial.ac.uk> wrote:

> I think the tweet above is about reproducing an enviroment after
> effectively freezing constitutive packages and their dependenies as you
> describe. They probably used something like
>
> conda env export
>
> Which outputs something similar to (trimmed)
>
> name: justnumpy
> channels:
>   - defaults
> dependencies:

[...]

>   - ncurses=6.3=h5eee18b_3
>   - numpy=1.23.4=py310hd5efca6_0
>   - numpy-base=1.23.4=py310h8e6c178_0
>   - ...

Do you list all the dependencies?  Other said, dependencies of
dependencies?  Is it only run-time dependencies?

Konrad pointed, (it = Conda)

                                         it claims that it cannot find a
     combination of package known to work together and available in the
     archive.

and from my understanding, I think it is because the solver (SAT or
else).  Well, for instance,

        Theorem 1 Checking whether a single package P can be installed, given a
        repository R, is NP-complete.

        https://www.mancoosi.org/edos/algorithmic/#toc15

Here (conda env export), you generated the Conda requirements using the
repository in the state R.  Then, later the repository becomes R’
(somehow it increases the number of combinations) and it does not matter
if the constraints are foo <= 1.23 or are foo=1.2.3 or are
foo=1.2.3=abcd456.

Maybe I am wrong, from my understanding, Conda builds the graph of
dependencies by resolving a combinatorial problem.  When you run,

    conda env create -f environment.yml

then Conda relies on a “dependency” solver documented here [1].  And,
IMHO, it is where it fails.  Well, if instead of ’conda env export’ you
run,

    conda list --explicit > spec-file.txt

then later and elsewhere,

    conda create --name myenv --file spec-file.txt

it should bypass the solver.  But the documentation [1] reads,

        Since the solver is not involved, the dependencies of the
        explicit package(s) are not processed at all. This can leave the
        environment in an inconsistent state, which can be fixed by
        running conda update --all, for example.

Done. :-)  Conda environments are hard, if not impossible, to reproduce
when time is flying.  It is by design, IMHO.


1: <https://conda.io/projects/conda/en/latest/dev-guide/deep-dives/solvers.html>
2: <https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>

Cheers,
simon


      reply	other threads:[~2022-11-29 14:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 17:28 Conda environments and reproducibility Thibault Lestang
2022-11-28 19:45 ` Konrad Hinsen
2022-11-29 10:32   ` Thibault Lestang
2022-11-29 13:12     ` Hugo Buddelmeijer
2022-11-29 13:39       ` Konrad Hinsen
2022-12-01 14:01         ` Hugo Buddelmeijer
2022-12-02 13:01           ` Konrad Hinsen
2022-11-29 20:10       ` Simon Tournier
2022-12-16 10:16         ` Thibault Lestang
2023-03-11 11:05           ` Ludovic Courtès
2023-03-11 11:43             ` Simon Tournier
2023-03-13 10:26               ` Lestang, Thibault
2023-03-13 11:00                 ` Ricardo Wurmus
2023-03-13 12:38                   ` Simon Tournier
2023-03-16 10:26                     ` Ludovic Courtès
2023-03-16 13:40                       ` Thibault Lestang
2023-04-03 15:22                         ` Simon Tournier
2023-04-04 12:19                           ` Thibault Lestang
2022-12-02 10:52       ` Ludovic Courtès
2022-12-02 11:05       ` Ludovic Courtès
2022-12-02 13:59         ` Simon Tournier
2022-12-02 14:06         ` Hugo Buddelmeijer
2022-11-28 20:46 ` Simon Tournier
2022-11-29 10:41   ` Thibault Lestang
2022-11-29 14:25     ` Simon Tournier [this message]

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=86mt897s8s.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=guix-science@gnu.org \
    --cc=t.lestang@imperial.ac.uk \
    /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.
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).