SNAP and conda

Hello!

We use conda quite a lot for the development of EO applications that are dockerized and thus all installation steps are unattended.

As of SNAP 7, we dropped SNAP packaging as a RPM using maven and then YUM as a repo to move to a conda package.

You then get to install SNAP in a conda environment with something like:

conda install -n <your env> snap

jpy and the java sdk are installed as conda dependencies.

The $HOME/.snap is also created and set (kind of a nightmare to be honest but we have to live with it).

We were wondering if this approach is of interest to some of you.

Drop a comment in this thread if you’re interested in getting to know how we do it and maybe help consolidate it.

6 Likes

Hi @fabricebrito,
I just wanted to say thanks for all the effort you are putting into this, much appreciated.
It sure would be extremely convenient to be able to install SNAP using conda.
I am not sure how I can contribute though as I am more on the application side and not so familiar with Java and software packaging. However I am already using the yum repo in cooperation with your colleagues. Feel free to drop me a message if I can do something for testing the installation.
Cheers,
John

Hi @fabricebrito,

that’s really nice. Also the Notebook you show here SNAP/snappy on Binder

I wonder if the snap/conda instance can be updated by module updates or extended with additional plugins. Can this easily be done?
And does this instance intefere with a normal SNAP installation? Because to normal SNAP installations do. You said it already in your post. The $HOME/.snap is not good.

Hi @marpet,

I wonder if the snap/conda instance can be updated by module updates or extended with additional plugins. Can this easily be done?

Here’s the repo terradue-ogctb16 / EOAP / D169-Jupyter-NB / EO processing SNAP · GitLab, there’s a postBuild installing Idepix for OLCI as an example.

And does this instance intefere with a normal SNAP installation? Because to normal SNAP installations do. You said it already in your post. The $HOME/.snap is not good.

The snap conda package has a post-build script that takes care of putting the right bits in the right places.
It kind of creates a workaround for the $HOME/.snap issue

I wonder if you could take the conda packaging on board for the next versions?

Cheers John!

If ESA says that we shall include it. We could do it. But currently I think the todo list for the next version is already pretty long. But priorities can change…

@fabricebrito this is very cool. I’m not a conda user myself, but might adopt it into our next project if this makes installing SNAP for folks a lot easier.

Is there a repo for this project?

The snap conda package is available here: https://anaconda.org/Terradue/snap

And there’s a binder demo here: https://gitlab.com/terradue-ogctb16/eoap/d169-jupyter-nb/eo-processing-snap

Guessing the repo for the package is private then? :slight_smile:

I’ve checked internally the setup and there are two repos actually: snap and jpy
They’re private due to their integration in our CI/CD process.

If we expose them, we would have to maintain two instances and this something we want to avoid.

Actually the perfect scenario would for ESA and BC to agree on a strategy to take over the conda packaging of SNAP as a community contribution to SNAP.
I hope @marpet, @mengdahl, @clopes can start discussing this.

Grazie for your proposal Fabrice, let’s continue over email.

Source accessible here: https://github.com/snap-contrib/

1 Like