NNPDF / pineappl

PineAPPL is not an extension of APPLgrid
https://nnpdf.github.io/pineappl/
GNU General Public License v3.0
12 stars 3 forks source link

Provide an 'I don't care'-easy installation option #129

Closed cschwan closed 2 months ago

cschwan commented 2 years ago

After talking with @AleCandido yesterday, we decided it useful to have a third and very easy installation option. This would be a feature for people who don't care about/don't want Rust. We should write a script which

This works because everything is statically linked. Maybe we'd also like to a have a similar installer for the Rust C API (could be automatically used inside Madgraph5_aMC@NLO).

Zaharid commented 2 years ago

Uh, make a conda package instead!

alecandido commented 2 years ago

Already available: https://anaconda.org/conda-forge/pineappl

But a binary installation is more general than conda, not everyone would like to install conda on its system, nor to rely on conda's environment.

alecandido commented 2 years ago

At the moment runcardsrunner installs PineAPPL on its own, cloning the repository and compiling it (it needs the C API for MadGraph).

Since GitHub changed cloning policy, it is no longer possible to use unauthenticated https:// protocol to do it. In e5d1ce27 I fixed with the git:// protocol, but even that is not going to work unauthenticated, as @Radonirinaunimi noticed.

Then, I'd like to deliver soon the extra installation script (leveraging rustup it shouldn't take much), and to base rr on some released version of PineAPPL instead of master. Thus I would make a version argument, to be passed to cargo install (default latest, i.e. the Cargo default). Installation of master should be a manual installation, that is always a good thing, since it is the development version.

cschwan commented 2 years ago

@AleCandido are you sure that https isn't working anymore/will not work at some point in the future? I checked that (unauthenticated) cloning is still possible and the site you mentioned explicitly states that nothing will change for https. I think the real problem might be that pygit2 tries to use authentication.

alecandido commented 2 years ago

One of the two blog posts I mentioned was SSH specific, so it was saying nothing will change for https, but the other one was.

Actually, I don't remember exactly why, but the change in the URL was consequential to a bug report (not even sure I found myself, it was in February and yadism was already settled, so I should look in Issues + Mails + Telegram to hunt for it).

Maybe there is a way to make it work, but I'm really inclined towards removing git operations as much as possible, and use instead released version on crates.io (it should be the official way for users).

cschwan commented 2 years ago

@AleCandido I agree. The only tricky installation is the C API, for which we can use the release tarballs, for instance https://github.com/N3PDF/pineappl/archive/refs/tags/v0.5.2.tar.gz.

cschwan commented 2 years ago

BTW: if one really wants to use git, you can using cargo install --git ....

alecandido commented 2 years ago

@AleCandido I agree. The only tricky installation is the C API, for which we can use the release tarballs, for instance https://github.com/N3PDF/pineappl/archive/refs/tags/v0.5.2.tar.gz.

That's fine as well, but can't cargo cinstall make use of the pineappl_capi crate? Something like:

cargo cinstall pineappl_capi
cschwan commented 2 years ago

That doesn't work unfortunately.

cschwan commented 1 year ago

We might have discovered an easier option: https://github.com/N3PDF/pineappl/pull/176. And here's yet another option: https://rust-cli.github.io/book/tutorial/packaging.html#distributing-binaries.

alecandido commented 1 year ago

Second part of the note referred in #183, but it is relevant here:

Installation script

While for Windows I don't care the less (people that uses Windows might want to use the respective binary manually, and otherwise use cargo install), for Linux (and MacOS if working the same way) we might host on the website (i.e. https://n3pdf.github.io/pineappl) an install script (e.g. https://n3pdf.github.io/pineappl/install.sh) in order to use it with just curl, like:

curl -fsSL https://n3pdf.github.io/pineappl/install.sh | sh

(in principle it should be possible to do the same for Windows with a install.ps1 script, but I don't care). It might be very simple, something like:

curl https://github.com/N3PDF/pineappl/archive/refs/tags/pineappl-vX.Y.Z-x86_64-unknown-linux-gnu.tar.gz --output pineappl.tar.gz
tar -xvzf pineappl.tar.gz
rm -f pineappl.tar.gz
install pineappl $PREFIX/bin
rm -f pineappl
cschwan commented 1 year ago

This could help making releases easier: https://github.com/axodotdev/cargo-dist#way-too-quick-start.

alecandido commented 1 year ago

Great!

I forgot to mention before, but another relevant cargo command (that I like for my personal use) is https://github.com/cargo-bins/cargo-binstall. However, this is really going to be lower priority, since it is just a matter of automate binary updates (so first we need to have binary installation in the first place), and of course it's dependent on cargo (so it doesn't help with non-Rust users, while Rust users can already compile the crate on their own).

cschwan commented 1 year ago

We've got pre-built binaries for the CAPI now, and we can do the same for the CLI, for which we'll need our LHAPDF replacement first, however.

cschwan commented 2 months ago

I think we can close this, we now have two methods of installing pre-built binaries.