-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the installation of nnpdf
packages
#1773
Comments
Note that this hugely increases the surface area for hard to diagnose user-specific problems that the current setup seeks to minimize. And would make the corresponding documentation harder. A hard requirement is for this to work on linux university clusters where one cannot install packages and in general cannot assume that anything is installed in the right way in the right place. I'd also note that this is introducing a problem we don't currently have. Note also that even in Python we have some build steps (in particular writing the versions, which I like very much in the way it's done). So that would need to be replicated.
I think this is my biggest concern: It is not clear to me how you go about having reasonable "editable" and environment dependent data folders that can be found by other tools. This is the concern expressed here basically: https://gitlab.com/hepcedar/lhapdf/-/merge_requests/12#note_944200133. For example, ideally we would like the pdfs downloaded by vp to be in the folder where lhapdf (the original from hepforge) would find them. In terms of cost benefit, it seems to me that doing #1690 would alleviate a lot of the issues with the current setup more easily than figuring all the details here. Especially if we go further such as disabling the c build stuff by default. |
There is a secondary problem with conda (which afaik only affects me) which is that because of licensing concerns it might be blocked at cern. So for me it is solving a problem that I currently have. I can create an environment in the node where I run and do
This is already the case, isn't it? |
I guess that would also more simply solved by using the conda-forge channel, ie #1487?
It is now. I am not sure how one would go about making sure it works in the setup you described. |
Given my experience every time we change something in conda I challenge the simply :P
In the same way? |
Fair enough. But then again "simply" relative to rewriting the whole setup and associated docs. |
Just to note that another thing to be figured out in this framework would be how to install pandoc properly. |
Worst case scenario we limit the package to |
I think this would make it a lot easier to install, so I would welcome it. To implement this myself though I don't know enough about the nnpdf infrastructure, nor about poetry. What I can of course do is provide you with lists of versions that worked for me for example, and test things. We also have a new colleague Carlos @Cmurilochem joining this project on our side, who also has an M1 Mac and installed nnpdf this week. (to keep it short I'm only listing the packages that were installed explicitly, not their dependencies. For the pip ones there is no way to do this, so I just listed ones that I think are relevant). Here is mine:
|
@APJansen the problem would be close to its solution (thanks to the various refactoring in vp and on the theory side), up to the Pandoc problem. The only realistic solution I see for the time being would be to dynamically install it (essentially, add installation scripts to vp/reportengine for some platforms, on top of the checker). In the longer term, we could drop Pandoc usage, and use a different Markdown-to-HTML compiler, like Python-Markdown. For templating, Jinja is already being used, so there is no problem there. |
As a follow-up on @APJansen's suggestion, I also share here my complete conda (version 22.9.0)
I did some experiments with it and generated a fresh conda enviroment using the above env file with
With this env, my installation of
Although this does not solve this issue, it may be useful for near-term Mac users. |
Note that several of these tools, which are necessary to install the whole code currently in the repository, are not needed for a fit. In particular However, changing the installation method means that the data needs to be installed as part of the python project (it is currently done by the Essentially |
FWIW I would suggest looking at this thing https://prefix.dev/docs/pixi/overview in a year or so time (at any rate, after it has gained a build command). It has the potential of being less disruptive than the suggestions being made here while addressing the actual problems. |
All of Keeping the complications of a generic package manager for the sake of using a pair of dependencies (that might not be packaged in other places as well, e.g. LHAPDF) it's not worth to me. However, I'm also interested in a similar business, and soon enough I will start packaging all our projects (i.e. the pineline) for Nix (but because Nix itself is coming with some other benefits). |
I think by using |
Currently both
validphys
andn3fit
are completely free of C++ dependence. In addition, the C++ part of the code is no longer used (some people are still usingevolven3fit
but it is no longer a requirement).The only external dependency that is not available as a python package is
lhapdf
, which for the moment would need to be installed by the user. However, in some of the systems that we use to run there is eitherlhapdf
available by default or an official package for your favourite linux (or macos) flavour so I think we can sidestep the issue for the moment.So the idea would be to write a
pyproject.toml
file such that it:n3fit
lhapdf
andpandoc
validphys
vp-get
will create theshare/NNPDF/
structure as neededAll
libnnpdf
,evolven3fit
, etc, can be skipped. If anyone needs any part of it they can still use conda (for the time being we will have to maintain both) but this gives an extra option to people.Some notes:
in principle the list of dependencies is not very different from conda https://github.com/NNPDF/nnpdf/blob/master/conda-recipe/meta.yaml only the C++-specific ones need to be dropped:
swig
,apfel
,libarchive
, etc.python is not allowed to write to
share
during installation, the data and profile should go as a package-data (both in the conda installation and the pip package) andshare
would be for things that are "vp-downloaded". This is also more consistent with how other programs do it and also ensures that installation and data are always in sync as we intended.since
validphys
needspandoc
we might want to start by having a package that only works forn3fit
(which is what needs to run in clusters and might benefit the most from an unmanaged pip installation), validphys would still be installed but would crash badly when creating reports if pandoc is not available (or with a nice error).cc @APJansen I've added you here since you already worked quite a bit on things adjacent to that when you had to install for MacOS so I'd be grateful if you could chime in (or even take this task if you wish since you already have some experience with the installation!)
A minimal requirements.txt file with packages needed in order for the fit to start running
Only LHAPDF is missing from this list.
The text was updated successfully, but these errors were encountered: