Skip to content

Explore nix as conda alternative #95

@foolnotion

Description

@foolnotion

Hi,

Since this issue does not require other changes in this repo except for flake.nix, I took the liberty of working with the dev branch.

This allows nix to be used as an alternative to conda, with a bunch of advantages:

  • conda lacks sane management of transitive deps leading to conflicts
  • nix is far more robust and allows complete reproducibility
  • faster
  • easy to build the environment (just type nix develop)
  • easy to generate docker images on the fly
    docker run -p 8888:8888 -ti --rm docker.nix-community.org/nixpkgs/nix-flakes nix develop github:cavalab/srbench/dev --no-write-lock-file
    
  • flake-enabled frameworks like pyoperon pull their own dependencies automatically (no need to keep adding things to an environment file)
  • flake.lock files can fix versions/revisions

This is obviously a low priority issue right now, but I've been using it to deploy srbench/operon without conda.
My frustration with conda began with not being able to add gcc/gxx-11.2.0 to the environment.

This issue is meant to track integration of other frameworks with nix. So far I have also integrated FEAT and Ellyn (wip). Other frameworks should be easily integrated as long as they use standard packaging.

There are some aspects that will need attention from other authors:

  • FEAT:

    • seems to be incompatible with latest numpy (this usually gets fixed upstream)
      >>> import feat
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/nix/store/h3gfxkz8a31l60qmpzj15ryq12nqsspm-python3.9-feat_ml-0.5.2/lib/python3.9/site-packages/feat/__init__.py", line 1, in <module>
          from .feat import Feat, FeatRegressor, FeatClassifier
        File "/nix/store/h3gfxkz8a31l60qmpzj15ryq12nqsspm-python3.9-feat_ml-0.5.2/lib/python3.9/site-packages/feat/feat.py", line 12, in <module>
          from .pyfeat import PyFeat
        File "feat/pyfeat.pyx", line 1, in init feat.pyfeat
      ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
      
    • the install script setup.py seems to be really tailored for conda environments, it took some tricks with setting ENV vars to get it to work
  • Ellyn

    • setup.py hardcoded for Conda, does not work with nix (I will try to patch it)

Best,
Bogdan

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions