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

Adding support for Snakemake v7 --slurm-sidecar #85

Closed
wants to merge 3 commits into from

Conversation

holtgrewe
Copy link

Note that this requires at least Snakemake 7.x with the patch applied in snakemake/snakemake#1440 (hopefully as 7.0.2 or 7.1).

Copy link
Collaborator

@percyfal percyfal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR @holtgrewe! I'll try to find some time this week to have a look at it.

{{cookiecutter.profile_name}}/slurm-submit.py Show resolved Hide resolved
README.md Show resolved Hide resolved
@fgypas
Copy link

fgypas commented Mar 29, 2022

@holtgrewe @percyfal Just pinging to check if you had time to work on the PR. A lot of slurm users will be grateful for this PR.

@holtgrewe
Copy link
Author

It's on my list...

@holtgrewe
Copy link
Author

Note to self: need to get rid of the HTTP log messages on the console.

@holtgrewe
Copy link
Author

Note to self: need to get rid of the HTTP log messages on the console.

Also done.

@percyfal
Copy link
Collaborator

percyfal commented Apr 6, 2022

@holtgrewe so I finally got some time to have a look at the PR. I have had some issues getting the tests to work with the local CI setup, for some of which I could identify the causes, for some it's more the case of the CI environment itself. For one thing, I believe the REST API is not activated in the slurm container, so for now I may just turn them off for the sidecar case. Hopefully that gets resolved though.

On a more general note, the profile should be backwards compatible (snakemake <v7), which I think currently is not the case (correct me if I'm wrong)? For clarification on this, see the comments on the code.

Copy link
Collaborator

@percyfal percyfal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The snakemake CI docker image needs updating at three locations (unfortunately; I'm thinking of some way to limit this to one) to quay.io/biocontainers/snakemake:7.3.2--hdfd78af_0 in

  • .github/workflows/slurm.yaml
  • tests/docker-compose.yaml
  • tests/deploystack.sh



def register_with_sidecar(jobid):
sidecar_vars = json.loads(SIDECAR_VARS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add

if SIDECAR_VARS is None:
    return

to handle cases where we're not using sidecar (or some other way to handle this case; not calling register_with_sidecar at all?)

Copy link
Author

@holtgrewe holtgrewe Apr 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case we would also need to adjust the config.yaml to not set cluster-sidecar, else snakemake will complain about the unknown option.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either that, or throw an error notifying the user that snakemake >=7 is needed. It's always possible to modify the config.yaml afterwards, commenting out relevant options. Still, it would be more user-friendly to make the sidecar config an option.

else:
time.sleep(1)

return res[jobid] or ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dedent the return statement one level, otherwise get_status_direct returns None

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do.

@percyfal
Copy link
Collaborator

percyfal commented Apr 6, 2022

@holtgrewe so I finally got some time to have a look at the PR. I have had some issues getting the tests to work with the local CI setup, for some of which I could identify the causes, for some it's more the case of the CI environment itself. For one thing, I believe the REST API is not activated in the slurm container, so for now I may just turn them off for the sidecar case. Hopefully that gets resolved though.

But there I was wrong. Updating the snakemake docker image does indeed make use of the sidecar function resulting in functional interaction with the slurm controller in the slurm CI image. Great!

@holtgrewe
Copy link
Author

@holtgrewe so I finally got some time to have a look at the PR. I have had some issues getting the tests to work with the local CI setup, for some of which I could identify the causes, for some it's more the case of the CI environment itself. For one thing, I believe the giovtorres/docker-centos7-slurm#42, so for now I may just turn them off for the sidecar case. Hopefully that gets resolved though.

Currently the sidecar does not use the slurmrestd. I think this would be a worthwhile additional feature and could be enabled by an environment variable (e.g., configuring the base URL of the REST API).

@holtgrewe
Copy link
Author

Currently the sidecar does not use the slurmrestd. I think this would be a worthwhile additional feature and could be enabled by an environment variable (e.g., configuring the base URL of the REST API).

OK was not at the end yet.

@percyfal
Copy link
Collaborator

@holtgrewe in case you missed it I made a PR to your PR indicating the necessary changes to make the CI run. If you want I can add them myself after merging. What remains to be addressed is how to handle backwards compatibility, but we could do it post merging.

@percyfal percyfal mentioned this pull request May 10, 2022
@percyfal
Copy link
Collaborator

@holtgrewe I added the CI changes and merged your PR in #92. I also added a cookiecutter option to use sidecar (default) or not, thereby providing backwards compatibility. Give me a holler if you notice anything out of order. And thank you for your efforts!

@percyfal percyfal closed this May 12, 2022
@holtgrewe
Copy link
Author

@percyfal thanks - sorry for being neither responsive nor active...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants