Cache depencencies on the fly when first used#3348
Cache depencencies on the fly when first used#3348bgruening merged 4 commits intogalaxyproject:devfrom
Conversation
lib/galaxy/tools/deps/__init__.py
Outdated
| cacheable_dependencies = [dep for dep in resolved_dependencies.values() if dep.cacheable] | ||
| hashed_dependencies_dir = self.get_hashed_dependencies_path(cacheable_dependencies) | ||
| if os.path.exists(hashed_dependencies_dir): | ||
| if not os.path.exists(hashed_dependencies_dir): |
There was a problem hiding this comment.
Could you add a check for conda_auto_install here? I am very much afraid of triggering this at random (whenever these dependencies are being resolved for the first time...) timepoints on production instances.
lib/galaxy/tools/deps/__init__.py
Outdated
| if not os.path.exists(hashed_dependencies_dir): | ||
| # Cache not present, try to create it | ||
| self.build_cache(requirements, **kwds) | ||
| if os.path.exists(hashed_dependencies_dir): # Check caching was successfull |
There was a problem hiding this comment.
You'll need one more space before the comment here.
|
If you could add the check for |
|
Ok, I added the For planemo, I guess we could set |
|
That looks very useful, thanks for looking into this 👍 |
You're right, this might be a bit surprising. I think that for planemo we could make |
lib/galaxy/tools/deps/__init__.py
Outdated
| resolved_dependencies = self.requirements_to_dependencies(requirements, **kwds) | ||
| cacheable_dependencies = [dep for dep in resolved_dependencies.values() if dep.cacheable] | ||
| hashed_dependencies_dir = self.get_hashed_dependencies_path(cacheable_dependencies) | ||
| if not os.path.exists(hashed_dependencies_dir) and self.extra_config['build_cache_on_first_run'] == True: |
There was a problem hiding this comment.
Travis is complaining here: comparison to True should be 'if cond is True:' or 'if cond:'
|
I think I like the direction we are heading here - and I certainly think y'all are correct that planemo should be used to setup these defaults correctly if I do have two changes I'd like to at least throw out there.
|
|
I think we already have many options for Conda and this one is not needed.
@mvdbeek Building the cached env probably takes the same time of creating the Conda env for the job (which is later destroyed), no? |
|
@nsoranzo I disagree a bit - if it defaults to |
Fair enough, +1 if it defaults to True. |
That's true ... I guess it's not that big a deal from this angle. |
|
@abretaud great addition! |
Hi,
A tiny patch to allow caching (conda) dependencies on the fly when a tool is executed the first time (well, anytime the cache is not found in fact).
There is some discussion about this in galaxyproject/planemo#612
Just tested it with planemo, it seems to work fine
ping @mvdbeek @jmchilton
🎅 🎅 🎅