Skip to content
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

python 3.11: cannot submit snakemake workflows #655

Closed
tiborsimko opened this issue Mar 13, 2023 · 1 comment · Fixed by reanahub/reana-commons#435, #700, reanahub/reana-workflow-engine-snakemake#81 or #697
Assignees

Comments

@tiborsimko
Copy link
Member

Seen whilst testing the researcher-oriented installation method for REANA 0.9.1-alpha.1 using Python 3.11 on the client side:

$ reana-client run -w snakemake -f ./reana-snakemake.yaml
==> Creating a workflow...
Traceback (most recent call last):
  File "/home/tibor/.virtualenvs/reana-0.9.0/lib/python3.11/site-packages/snakemake/__init__.py", line 699, in snakemake
    success = workflow.execute(
              ^^^^^^^^^^^^^^^^^
  File "/home/tibor/.virtualenvs/reana-0.9.0/lib/python3.11/site-packages/snakemake/workflow.py", line 960, in execute
    self.scheduler = JobScheduler(
                     ^^^^^^^^^^^^^
  File "/home/tibor/.virtualenvs/reana-0.9.0/lib/python3.11/site-packages/snakemake/scheduler.py", line 98, in __init__
    from ratelimiter import RateLimiter
  File "/home/tibor/.virtualenvs/reana-0.9.0/lib/python3.11/site-packages/ratelimiter.py", line 36, in <module>
    class RateLimiter(object):
  File "/home/tibor/.virtualenvs/reana-0.9.0/lib/python3.11/site-packages/ratelimiter.py", line 127, in RateLimiter
    __aexit__ = asyncio.coroutine(__exit__)
                ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'
==> ERROR: Cannot create workflow snakemake:
Snakemake specification is invalid.
@giuseppe-steduto
Copy link
Member

giuseppe-steduto commented May 25, 2023

This happens because snakemake uses the ratelimiter dependency, which in turn uses the coroutine decorator of the asyncio module that was removed since python 3.11.

ratelimiter still has an open issue about that and snakemake switched the dependency to throttler in its 7.18.2 release.
In REANA, we currently use snakemake==6.8.0.
Upgrading snakemake would work, but it may not be effortless. On the other hand, the fix for ratelimiter is rather easy and there are multiple forks of the project that address this issue in different ways (take a look at this or this, for example) and that apparently would solve our problem. For example, here's what I tried:

  1. Create a new virtualenv with Python 3.11
  2. pip install reana-client
  3. Set the REANA_SERVER_URL and REANA_ACCESS_TOKEN env variables
  4. Run reana-client run -w snakemake -f ./reana-snakemake.yaml and verify that there is indeed the issue with coroutine
  5. "Patch" ratelimiter by replacing it with one of the forked projects, such as pip install -e git+git://github.com/classroomtechtools/ratelimiter@master#egg=ratelimiter
  6. Run again reana-client run -w snakemake -f ./reana-snakemake.yaml and verify that the issue is gone.

One problem though is that the ratelimiter repository may not be actively maintained, therefore it might be hard to have the fixed python package published. Also, we would of course need more testing to make sure that fixing ratelimiter works as expected.

What do you think?

giuseppe-steduto added a commit to giuseppe-steduto/reana-commons that referenced this issue Jan 10, 2024
…th Python 3.11

Update Snakemake version to v7.32.4 (latest one before v8 refactoring),
to support newer features and resolve problems for clients using Python 3.11.

- `reana_commons/config.py`: Update default Snakemake environment image.
- `reana_commons/snakemake.py`: Modify `first_rule` directive to
  `default_target` directive to adhere to the changes made in
  snakemake/snakemake!638ec1a.
- `setup.py`: Adjust Snakemake version in the dependencies.

Closes: reanahub/reana-client#655,
reanahub/reana-workflow-engine-snakemake#31.
giuseppe-steduto added a commit to giuseppe-steduto/reana-commons that referenced this issue Jan 10, 2024
Update Snakemake version to v7.32.4 (latest one before v8 refactoring),
to support newer features and resolve problems for clients using Python 3.11.

- `reana_commons/config.py`: update default Snakemake environment image.
- `reana_commons/snakemake.py`: modify `first_rule` directive to
  `default_target` directive to adhere to the changes made in
  snakemake/snakemake!638ec1a.
- `setup.py`: adjust Snakemake version in the dependencies.

Closes: reanahub/reana-client#655,
reanahub/reana-workflow-engine-snakemake#31.
giuseppe-steduto added a commit to giuseppe-steduto/reana-commons that referenced this issue Jan 10, 2024
Update Snakemake version to v7.32.4 (latest one before v8 refactoring),
to support newer features and resolve problems for clients using Python 3.11.

- `reana_commons/config.py`: update default Snakemake environment image.
- `reana_commons/snakemake.py`: modify `first_rule` directive to
  `default_target` directive to adhere to the changes made in
  snakemake/snakemake!638ec1a.
- `setup.py`: adjust Snakemake version in the dependencies.

Closes: reanahub/reana-client#655,
reanahub/reana-workflow-engine-snakemake#31.
giuseppe-steduto added a commit to giuseppe-steduto/reana-commons that referenced this issue Jan 10, 2024
Update Snakemake version to v7.32.4 (latest one before v8 refactoring),
to support newer features and resolve problems for clients using Python 3.11.

- `reana_commons/config.py`: update default Snakemake environment image.
- `reana_commons/snakemake.py`: modify `first_rule` directive to
  `default_target` directive to adhere to the changes made in
  snakemake/snakemake!638ec1a.
- `setup.py`: adjust Snakemake version in the dependencies.

Closes: reanahub/reana-client#655,
reanahub/reana-workflow-engine-snakemake#31.
@giuseppe-steduto giuseppe-steduto self-assigned this Jan 10, 2024
giuseppe-steduto added a commit to giuseppe-steduto/reana-commons that referenced this issue Jan 10, 2024
Update Snakemake version to v7.32.4 (latest one before v8 refactoring),
to support newer features and resolve problems for clients using
Python 3.11.

- `reana_commons/config.py`: update default Snakemake environment image.
- `reana_commons/snakemake.py`: modify `first_rule` directive to
  `default_target` directive to adhere to the changes made in
  snakemake/snakemake!638ec1a.
- `setup.py`: adjust Snakemake version in the dependencies.

Closes: reanahub/reana-client#655.
Closes: reanahub/reana-workflow-engine-snakemake#31.
giuseppe-steduto added a commit to giuseppe-steduto/reana-commons that referenced this issue Jan 10, 2024
…anahub#435)

Update Snakemake version to v7.32.4 (latest one before v8 refactoring),
to support newer features and resolve problems for clients using
Python 3.11.

Other than updating the dependency and Snakemake base image, change
`reana_commons/snakemake.py` to switch from the `first_rule` Snakemake
workflow directive to the `default_target` one, to adhere to the
changes made in snakemake/snakemake!638ec1a.

Closes: reanahub/reana-client#655.
Closes: reanahub/reana-workflow-engine-snakemake#31.
giuseppe-steduto added a commit to giuseppe-steduto/reana-commons that referenced this issue Jan 11, 2024
…anahub#435)

Update Snakemake version to v7.32.4 (latest one before v8 refactoring),
to support newer features and resolve problems for clients using
Python 3.11.

Other than updating the dependency and Snakemake base image, change
`reana_commons/snakemake.py` to switch from the `first_rule` Snakemake
workflow directive to the `default_target` one, to adhere to the
changes made in snakemake/snakemake!638ec1a.

Closes: reanahub/reana-client#655.
Closes: reanahub/reana-workflow-engine-snakemake#31.
giuseppe-steduto added a commit to giuseppe-steduto/reana-commons that referenced this issue Jan 11, 2024
…anahub#435)

Update Snakemake version to v7.32.4 (latest one before v8 refactoring),
to support newer features and resolve problems for clients using
Python 3.11.

Other than updating the dependency and Snakemake base image, change
`reana_commons/snakemake.py` to switch from the `first_rule` Snakemake
workflow directive to the `default_target` one, to adhere to the
changes made in snakemake/snakemake!638ec1a.

Closes: reanahub/reana-client#655.
Closes: reanahub/reana-workflow-engine-snakemake#31.
giuseppe-steduto added a commit to giuseppe-steduto/reana-commons that referenced this issue Jan 11, 2024
…anahub#435)

Update Snakemake version to v7.32.4 (latest one before v8 refactoring),
to support newer features and resolve problems for clients using
Python 3.11.

Other than updating the dependency and Snakemake base image, change
`reana_commons/snakemake.py` to switch from the `first_rule` Snakemake
workflow directive to the `default_target` one, to adhere to the
changes made in snakemake/snakemake!638ec1a.

Closes: reanahub/reana-client#655.
Closes: reanahub/reana-workflow-engine-snakemake#31.
@mdonadoni mdonadoni self-assigned this Jan 24, 2024
giuseppe-steduto added a commit to giuseppe-steduto/reana-commons that referenced this issue Jan 26, 2024
Update Snakemake version to v7.32.4 (latest one before v8 refactoring),
to support newer features and resolve problems for clients using
Python 3.11.

Other than updating the dependency and Snakemake base image, change
`reana_commons/snakemake.py` to switch from the `first_rule` Snakemake
workflow directive to the `default_target` one, to adhere to the
changes made in snakemake/snakemake!638ec1a.

Closes: reanahub/reana-client#655
Closes: reanahub/reana-workflow-engine-snakemake#31
giuseppe-steduto added a commit to giuseppe-steduto/reana-client that referenced this issue Jan 26, 2024
…#699)

After upgrading Snakemake to version 7.32.4 (reanahub/reana-commons#435)
there is no need to avoid running Snakemake tests on Python 3.11 and
3.12, as it should be supported.

Closes reanahub#655
giuseppe-steduto added a commit to giuseppe-steduto/reana-client that referenced this issue Jan 26, 2024
…#700)

After upgrading Snakemake to version 7.32.4 (reanahub/reana-commons#435)
there is no need to avoid running Snakemake tests on Python 3.11 and
3.12, as it should be supported.

Closes reanahub#655
giuseppe-steduto added a commit to giuseppe-steduto/reana-commons that referenced this issue Jan 26, 2024
Update Snakemake version to v7.32.4 (latest one before v8 refactoring),
to support newer features and resolve problems for clients using
Python 3.11.

Other than updating the dependency and Snakemake base image, change
`reana_commons/snakemake.py` to switch from the `first_rule` Snakemake
workflow directive to the `default_target` one, to adhere to the
changes made in snakemake/snakemake!638ec1a.

Closes: reanahub/reana-client#655
Closes: reanahub/reana-workflow-engine-snakemake#31
giuseppe-steduto added a commit to giuseppe-steduto/reana-client that referenced this issue Jan 26, 2024
…#700)

After upgrading Snakemake to version 7.32.4 (reanahub/reana-commons#435)
there is no need to avoid running Snakemake tests on Python 3.11 and
3.12, as it should be supported.

Closes reanahub#655
giuseppe-steduto added a commit to giuseppe-steduto/reana-workflow-engine-snakemake that referenced this issue Jan 29, 2024
Amend the overridden executor to reflect the changes in the new version
of Snakemake, in particular with regard to the change of the
`_wait_for_jobs` method into a coroutine.

Closes reanahub#31
Closes reanahub/reana-client#655
giuseppe-steduto added a commit to giuseppe-steduto/reana-workflow-engine-snakemake that referenced this issue Jan 29, 2024
Amend the overridden executor to reflect the changes in the new version
of Snakemake, in particular with regard to the change of the
`_wait_for_jobs` method into a coroutine.

Closes reanahub#31
Closes reanahub/reana-client#655
giuseppe-steduto added a commit to giuseppe-steduto/reana-workflow-engine-snakemake that referenced this issue Jan 30, 2024
Amend the overridden executor to reflect the changes in the new version
of Snakemake, in particular with regard to the change of the
`_wait_for_jobs` method into a coroutine.

Closes reanahub#31
Closes reanahub/reana-client#655
giuseppe-steduto added a commit to giuseppe-steduto/reana-workflow-engine-snakemake that referenced this issue Jan 30, 2024
Amend the overridden executor to reflect the changes in the new version
of Snakemake, in particular with regard to the change of the
`_wait_for_jobs` method into a coroutine.

Closes reanahub#31
Closes reanahub/reana-client#655
giuseppe-steduto added a commit to giuseppe-steduto/reana-client that referenced this issue Feb 13, 2024
…#700)

After upgrading Snakemake to version 7.32.4 (reanahub/reana-commons#435)
there is no need to avoid running Snakemake tests on Python 3.11 and
3.12, as it should be supported.

Closes reanahub#655
giuseppe-steduto added a commit to giuseppe-steduto/reana-workflow-engine-snakemake that referenced this issue Feb 13, 2024
Amend the overridden executor to reflect the changes in the new version
of Snakemake, in particular with regard to the change of the
`_wait_for_jobs` method into a coroutine.

Closes reanahub#31
Closes reanahub/reana-client#655
giuseppe-steduto added a commit to giuseppe-steduto/reana-workflow-engine-snakemake that referenced this issue Feb 19, 2024
Amend the overridden executor to reflect the changes in the new version
of Snakemake, in particular with regard to the change of the
`_wait_for_jobs` method into a coroutine.

Closes reanahub#31
Closes reanahub/reana-client#655
giuseppe-steduto added a commit to giuseppe-steduto/reana-workflow-engine-snakemake that referenced this issue Feb 21, 2024
Amend the overridden executor to reflect the changes in the new version
of Snakemake, in particular with regard to the change of the
`_wait_for_jobs` method into a coroutine.

Closes reanahub#31
Closes reanahub/reana-client#655
giuseppe-steduto added a commit to giuseppe-steduto/reana-workflow-engine-snakemake that referenced this issue Feb 21, 2024
Amend the overridden executor to reflect the changes in the new version
of Snakemake, in particular with regard to the change of the
`_wait_for_jobs` method into a coroutine.

Closes reanahub#31
Closes reanahub/reana-client#655
giuseppe-steduto added a commit to giuseppe-steduto/reana-client that referenced this issue Feb 21, 2024
…#700)

After upgrading Snakemake to version 7.32.4 (reanahub/reana-commons#435)
there is no need to avoid running Snakemake tests on Python 3.11 and
3.12, as it should be supported.

Closes reanahub#655
giuseppe-steduto added a commit to giuseppe-steduto/reana-client that referenced this issue Feb 21, 2024
…nahub#700)

After upgrading Snakemake to version 7.32.4 (reanahub/reana-commons#435)
there is no need to avoid running Snakemake tests on Python 3.11 and
3.12, as it should be supported.

Closes reanahub#655
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment