-
Notifications
You must be signed in to change notification settings - Fork 39
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
Snakemake upgrade #471
Snakemake upgrade #471
Conversation
a4ab1b0
to
20a01a4
Compare
20a01a4
to
46bd3b6
Compare
46bd3b6
to
c243ae1
Compare
c243ae1
to
88cc0dd
Compare
reana_commons/snakemake.py
Outdated
) as snakemake_api: | ||
try: | ||
workflow_api = snakemake_api.workflow( | ||
resource_settings=ResourceSettings(nodes=300), |
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.
For the nodes settings, we already have SNAKEMAKE_MAX_PARALLEL_JOBS
environmental variable that could be used instead of the hard-coded value of 300, even though this might "fully' work only when the validation would be moved to the server-side.
Still, you could preventively introduce in reana_commons/config.py
something like:
SNAKEMAKE_MAX_PARALLEL_JOBS = int(os.getenv("SNAKEMAKE_MAX_PARALLEL_JOBS", "300"))
"""Snakemake maximum number of jobs that can run in parallel."""
which might be better that hard-coding the value of 300.
(Similarly as we do in reana_workflow_engine_snakemake/config.py
.)
setup.py
Outdated
# see https://github.com/snakemake/snakemake/issues/2657 | ||
"snakemake @ git+https://github.com/mdonadoni/snakemake.git@cea31624976989ad0645eb2e1751260d32259506", # branch `7.32.4-python3.12` | ||
"pulp>=2.7.0,<2.8.0", | ||
"snakemake==8.23.0", |
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.
There is already Snakemake 8.24.0 out.
reana_commons/snakemake.py
Outdated
workdir=workdir, | ||
) | ||
# Try to create dag and it throws an error in case of a failure. | ||
# Seems to be enough but might not be an extensive validation. |
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 amend the docstring to:
Seems to be enough for the first validation. We may move to snakemake --dry-run
when the validation process will be fully moved to the server-side.
88cc0dd
to
dfa4283
Compare
dfa4283
to
804e084
Compare
804e084
to
e23bba8
Compare
6ab9917
to
5d54f47
Compare
5d54f47
to
939f501
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #471 +/- ##
==========================================
- Coverage 44.23% 41.79% -2.45%
==========================================
Files 28 28
Lines 1978 2010 +32
==========================================
- Hits 875 840 -35
- Misses 1103 1170 +67
|
939f501
to
150afd2
Compare
tests/test_snakemake.py
Outdated
|
||
from reana_commons.snakemake import snakemake_load | ||
|
||
|
||
@pytest.mark.xfail( | ||
sys.version_info >= (3, 11), | ||
reason="Test expted to fail for python versions 3.11 and above as we currently return only empty dictionary in snakemake_load function for python >= 3.11. Development is blocked until we move validation to the server side.", |
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.
Typo: "expected" to fail
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 also remove the last part "Development is blocked until we move validation to the server side" to make the reason shorter. We'll revamp this anyway as part of the server-side validation sprint.
@@ -124,7 +124,7 @@ jobs: | |||
- name: Install system dependencies | |||
run: | | |||
sudo apt-get update -y | |||
sudo apt-get install python3-dev graphviz libgraphviz-dev pkg-config | |||
sudo apt-get install python3-dev graphviz libgraphviz-dev pkg-config uuid-dev |
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.
This is necessary to make the CI pass for the Snakemake v8 upgrade, so I would just squash the two functional commits together under the heading refactor(snakemake): upgrade snakemake 7 to snakemake 8 (#471)
and add only the separate release commit on top.
reana_commons/snakemake.py
Outdated
|
||
|
||
def snakemake_validate( | ||
workflow_file: str, configfiles: List[str], workdir: Optional[str] = None | ||
): | ||
"""Validate Snakemake workflow specification. | ||
"""Validate snakemake workflow.""" |
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.
Cosmetics: Validate Snakemake workflow. (note upppercase)
reana_commons/snakemake.py
Outdated
def snakemake_validate_v7( | ||
workflow_file: str, configfiles: List[str], workdir: Optional[str] = None | ||
): | ||
"""Old snakemake validate version for python versions < 3.11, it is needed since snakemake8 dropped support for python < 3.11. |
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.
Snakemake 7 workflow validation function, necessary for Python versions < 3.11.
(to make the docstring shorter)
reana_commons/snakemake.py
Outdated
def snakemake_validate_v8( | ||
workflow_file: str, configfiles: List[str], workdir: Optional[str] = None | ||
): | ||
"""Seems to be enough for the first validation. We may move to snakemake --dry-run when the validation process will be fully moved to the server-side. |
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.
Snakemake 8 workflow validation function for Python versions >= 3.11.
Note that we may move to using snakemake --dry-run
when the validation process will be fully moved to the server side.
(to make the headline shorter, whilst the comment goes to the docstring body.)
reana_commons/snakemake.py
Outdated
|
||
|
||
def snakemake_load(workflow_file: str, **kwargs: Any): | ||
"""Load snakemake specification.""" |
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.
Cosmetics: Load Snakemake specification. (note uppercase)
150afd2
to
794c79b
Compare
794c79b
to
7b19310
Compare
7b19310
to
3b80320
Compare
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.
Works nicely for the full Snakemake test matrix 👍
No description provided.