-
Notifications
You must be signed in to change notification settings - Fork 15
fix: check if miniconda is present before installation, closes #47 #48
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
Draft
m-jahn
wants to merge
4
commits into
snakemake:master
Choose a base branch
from
m-jahn:fix_miniconda
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the setup step is skipped, conda won't be set up with
.snakemake.environment.yamlas the default environment. Will snakemake then not be available as a consequence? If so, I imagine we need an additional step that installssnakemakeinto the base environment, or creates a snakemake conda environment, if conda is already available.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the idea is that this check is specific for the miniconda setup step. when you run this step twice, as we do in the standard snakemake testing workflow, the env is already present and checked out from the first step, including snakemake. the test in this repo succeeded, meaning it works as expected. that's why I would also not test for any conda installation, as this could be the wrong one, only for the specific miniconda3 one.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha yes, I see the
containerizestep would trigger a second setup miniconda step so there isn't a need for a secondrunstep.Regarding testing for
miniconda3: if the workflow includessetup-minicondaupstream, then I believe the current implementation would not install snakemake. Or am I missing something? For example, ifsetup-minicondais used to enablepytest:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. This is an edge case. A custom workflow with another setup-miniconda@v3 step would skip installing snakemake and fail. Is this a risk we can take (honest question)? In the end, the github action needs to work mainly for the test workflows, and it does so by wrapping several steps into a single one. In the example you posted, one would need to work around this by replacing the snakemake action with some selected steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually an important use-case, in my opinion. An extension is of this is to follow the
snakemake-github-actionwith integration tests, which would not be possible if the action needs to be run in a separate job. Why limit the action to only operate in jobs that only use the snakemake github action?What could go wrong by checking for a conda installation more generally, and updating/installing the snakemake environment if i conda exists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do this if you first run the snakemake action that installs miniconda, then the tests. The other way around as the example above won't work.
Possible, but then the action steps will change quite a lot. One would need different checks, like A) is any conda available? If not install miniconda + snakemake env as before. If yes, is snakemake available? If not create only env and activate, not using the setup-miniconda action. And checking for conda does not make sure that mamba is available (don't know what consequences that would have). At least current conda should also use the libmamba solver so should be equally fast.
If you have a good solution in mind don't hesitate to make a commit!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps I'm biased as I believe the current implementation would require us to change a few of our github actions workflows, in which we run the snakemake github action as part of a collection of tests in the same job.
I'm heading into a busy week ahead of a few weeks off - I'll do my best to give this some thought and get back to you regarding the checks! Are you aware of anyone else who's opinion we could ask for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Ezra, no rush I think this is probably going to be fixed upstream in miniconda, see David's other PR here. I've converted this PR to draft and we might close it without merging.