-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,8 +73,18 @@ runs: | |
| - snakemake ==${{ inputs.snakemake-version }} | ||
| EOF | ||
|
|
||
| - name: Check if miniconda is already installed | ||
| id: check-miniconda | ||
| shell: bash -el {0} | ||
| run: | | ||
| if [ -d "/home/runner/miniconda3" ]; then | ||
| echo "installed=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "installed=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Setup conda | ||
| if: ${{ !hashFiles('/home/runner/miniconda3/condabin/conda') }} | ||
| if: steps.check-miniconda.outputs.installed == 'false' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gotcha yes, I see the Regarding testing for
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 What could go wrong by checking for a conda installation more generally, and updating/installing the snakemake environment if i conda exists?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as of 30 minutes ago our workflows are still failing at the test report step -- so no fix in sight...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I was out sick, so I only find time to follow up on this now. It also still fails for the CI runs where I first noticed this. However, with one difference to the errors that I previously saw. Namely, these kinds of warnings (on the initial installation of miniconda3, which works) are gone: So I think the constructor update is actually doing, what the original issue here was about: But the re-installation error persists. So I think this might simply be a separate issue. Although I think we should not need to fix this here, but this is probably rather something where the I'm looking into this now, hope to have some better idea where to fix this later. And if we get stuck here, I would opt for pinning to the previous working version for now (#49), so everyone can get on with their actual work, not waiting for CI.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sounds like a plan 👍 |
||
| uses: conda-incubator/setup-miniconda@v3 | ||
| with: | ||
| channels: conda-forge,bioconda | ||
|
|
||
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.
A self‑hosted runner may use a different home path. What about
$HOME/miniconda3?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.
Or to check more generally for a conda installation, e.g.
which condaThere 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.
good points. I like the checking for
$HOME, if this env var is available on the github runner, it's fine with me.Just checking with
which condais dangerous though, as the test would succeed for any conda available, not necessarily our one with snakemake.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.
OK so the problem is that
$HOMEis not available in statements likeinstallation-dir: /home/runner/miniconda3, only in therun:directive of a step. So it would be more complicated to do this, then what we have now.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.
Why do we need to specify
installation-dir? I believe it already defaults to$HOME/miniconda3