-
Notifications
You must be signed in to change notification settings - Fork 0
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
Redundant package storage #1
Comments
@kephale I agree that the redundancy is unfortunate. Would you be satisfied with hard links? This is what I do in jrun and it seems to work very well, even on Windows. That way, if someone wipes or messes with However, while jrun leans on mvn for the heavy lifting, scijava-grab does its own downloading; hence, the downside here is that if something is grabbed by Therefore, we could opt to go a different direction and make scijava-grab load directly from |
Hard links are fine and a definite improvement. What led me to scijava-grab was using it from scijava-jupyter-kernel to fetch a Clojure dependency manager (https://github.com/cemerick/pomegranate) which populates dependencies into .m2/repository using Sonatype Aether under the hood. The reason for the circuitous route only being that I setup my older Beaker notebooks to work that way. Practically speaking, I suspect the standard workflow will be (at least for me): prototype in jupyter then migrate code to a proper Maven project. For that workflow I suspect it would be better if scijava-grab populated the .m2/repository, since the notebooks will likely fetch the newer dependencies before Maven is used to fetch them. Then of course one could bring up the ability to use .m2/repository artifacts with imagej-updater somehow which would take this discussion down a rabbit hole, but it should probably at least be mentioned in this context. Any improvement would be great, but since everything is functioning now there isn't a need to rush.
|
Cool, I didn't know about pomegranate. Would it be possible to consume the pomegranate API from Java? Then we could use it instead of Groovy Grape under the hood. If not, we can look into porting the relevant portion of pomegranate (i.e.: just directly calling Aether—which is unclear to me whether it is still called Aether since it left the Eclipse umbrella...).
That would be awesome. PRs very welcome, ha ha.
Agreed. Certainly, I think we need to reach a place where the SciJava Jupyter Kernel ships as few artifacts as possible. We want all notebooks to begin with As for ImageJ itself via the Updater: the first step would be updating the Please feel free to file an issue in imagej-updater about this. But it is unlikely anyone at LOCI will have time to work on it this year. This may sound weird, but on the totem pole of priorities, imagej-updater is quite low, since it only impacts the ImageJ application itself, and not all the other use cases like Jupyter, KNIME, OMERO, etc. |
pomegranate would require minimal adaptation to be consumable from Java; however, it would not be very comfortable to use it because of the number of native Clojure types it uses as arguments to functions. pomegranate basically has 2 namespaces: 1 is the primary public facing one that can be easily ported, but the other does a fair amount of legwork and from a quick skim, it will be unpleasant to port. The path of least resistance would probably be to write a thin Clojure library that exposes pomegranate using native Java types instead of Clojure ones. I may regret this, but I could take care of that. I completely understand putting imagej-updater Maven support at the back of the queue. I just wanted to get it on the radar, with the hope of getting more backend overlap with imagej-updater and other scijava dependency management. One other thought: if a good solution for integrating Maven into scijava-grab can be achieved, then perhaps an updater plugin could be put together from scratch that makes no attempt at backwards compatibility and only focuses on providing Maven-based package management within ImageJ. I know that there are a bunch of perks of the way imagej-updater works currently, so what I'm suggesting is not necessarily a replacement, but a thought-experiment that could be useful to some folks (I think @fjug was interested in Maven support in imagej-updater as well). |
I thought about it, and came up with a simple way to move forward that does not require too much development time:
There are some subtleties, such as ensuring the Maven metadata files are updated correctly, but all in all I think it is doable, and does not require us to rewrite things to use Aether or pomegranate. As an aside, we may want to change the default SciJava location to
I think you are right that a clean break here is the easiest route forward. There are actually several reasons this would be more realistic. 👍 |
If scijava-grab avoided packages that are already on the classpath when fetching dependencies, then I believe the issues that I have been running into about multiple copies of libraries on the classpath would not arise. |
Sure, we could do that. But along with that, I'd like to reduce the system classpath to be as small as possible, to make as many things as possible be grabbable. I am concerned about the "bootstrapping problem" of Perhaps scijava-grab should be standalone and not require scijava-common at all. And SJJK should use some scheme so that scijava-common can be grabbed and then utilized to execute cells. Maybe just |
The issue I posted as scijava/scijava-jupyter-kernel#83 should probably just be a bump on this thread. At the moment I find myself just wanting to be able at least exclude some packages from a #@dependency() fetch. Specifically, I wish something like this could work (even if I have to enumerate everything that needs to be excluded, if it comes down to that):
|
I think the hardcoded dependencies are a different issue than minimizing the storage requirement of cached JARs using hard (or soft) links. Regarding dependency excludes: while they "would be nice" for sure, I think it's paramount that we minimize the SJJK classpath, as I described above. Resolving this is one of my main hackathon priorities, so that SJJK Jupyter notebooks are fully reproducible. My first approach will be the |
Okey doke, got it! Thank you!! Looking forward to this one in particular, it is the last thing holding back fun.imagej notebooks. |
@kephale Have you tried BeakerX lately? It has a Clojure notebook kernel. I ask because we are migrating all the existing SJJK-based notebooks to the BeakerX Groovy kernel instead. I asked on the beakerx Gitter channel whether the BeakerX |
Many of the files that end up getting stored in .scijava are already in people's .m2 repositories (as well as Fiji.app/jars in some cases). It would be great if scijava-grab could work from the .m2 local Maven storage.
The text was updated successfully, but these errors were encountered: