How should models with conflicting dependencies be handled? #159
Replies: 5 comments 14 replies
-
Dependency hell indeed! Two approaches:
The answer is probably to do (1) but not do anything that precludes (2). |
Beta Was this translation helpful? Give feedback.
-
I think this issue is closely related to the issue of handling system/environmental dependencies of model packages, in that python doesn't offer a complete solution, and it's very hard for an individual library (such as scivision) to solve it from within a particular installation. This is what package managers are for. It could be tempting to, effectively, create our own ad-hoc python package manager, which I think we should avoid! My feeling is we should try to use existing solutions and tools where we can, and stick to the norms of the python ecosystem - but we could certainly make suggestions or recommendations as to what to do (say, recommend pyenv or conda for managing a particular python version, and document a workflow that uses each of these). |
Beta Was this translation helpful? Give feedback.
-
I agree it seems to be very tricky to have multiple python environments working into a single plain script. For jupyter lab or notebooks, there's a workaround using To alert the users about the right configuration, what about adding a sort of checking flag of the python version in
|
Beta Was this translation helpful? Give feedback.
-
From discussion today online: Perhaps one of the requirements in the contribution to scivision catalog guidelines should be that there must be quality documentation on installation/usage for submitted models. So much so, that when people PR an addition to the catalog, it will only be accepted if the model is installable by the reviewer (community member) and various other checks have passed. This would be in a scenario where the answer to #149 is no, most models are not auto-magically installable by scivision, and instead the user who finds the model via a catalog is directed/instructed to install via link to the installation instructions (e.g. the model repo README). The purpose of this would be to essentially bypass the problem being discussed in this discussion - the scivision user would use scivision for querying the catalog, but once they find a model they want to use, they would likely set up a bespoke python environment to use it, as per the model's instructions (e.g. repo README). This does mean that there's no nice way to run models in the same environment, however that may not be realistic anyway. @acocac suggests part of the minimum requirements for a model submission would also include a license (See #169) |
Beta Was this translation helpful? Give feedback.
-
Using BeakerX or wrattler for multiple python environments in a scivision noteebook
|
Beta Was this translation helpful? Give feedback.
-
Imagine you are a scivision user who wants to load more than one model from the scivision catalog to try on your dataset. How should the differing environments required to run each model be handled? Should we use a particular package/environment manager e.g. Conda?
If someone finds a model from the catalog they want to use, they are already in a python environment, but the python environment would need to refresh/change to the be one that the model runs in. Is there some way in Python we can get the
load_pretrained_model
function to find the specified model environment (e.g. build it from theenvironment.yml
orrequirements.txt
in the model's repo) and then refresh the python kernel so that it runs?Right now, I think our examples are all rigged so that the python environment that the example notebook is being run in has the requirements of the model installed - this is fine for our example scivision use-cases gallery, however it means that nobody can currently load a model from the catalog unless their python environment happens to support it.
Beta Was this translation helpful? Give feedback.
All reactions