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

Add ability to override python used to start workers #167

Merged
merged 2 commits into from Oct 5, 2018

Conversation

ocaisa
Copy link
Member

@ocaisa ocaisa commented Oct 5, 2018

fixes #166

@@ -195,6 +198,8 @@ def __init__(self,
extra = dask.config.get('jobqueue.%s.extra' % self.scheduler_name)
if env_extra is None:
env_extra = dask.config.get('jobqueue.%s.env-extra' % self.scheduler_name)
if python is None:
python = sys.executable
Copy link
Member

Choose a reason for hiding this comment

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

I think that we can safely include this directly in the signature. It's not going to change.

Copy link
Member

Choose a reason for hiding this comment

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

So this means no config entry?

Copy link
Member

Choose a reason for hiding this comment

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

Right. If we were to include this as part of the config (which I don't think is necessary) then we would want to check the default every time we called the constructor here, so we would need this check to be within the constuctor as you have it here. However if the default value is just going to be sys.executable (which I think is best today) then we can include it as a default directly in the signature of the constructor. This is a bit better both because it reduces code, and because it makes the default visible if people look at the docstring.

cancel_command: str
Abstract attribute for job scheduler cancel command,
should be overriden
should be overridden
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for correcting these typos

@mrocklin
Copy link
Member

mrocklin commented Oct 5, 2018

One small comment. Otherwise this looks good to me. Thanks @ocaisa

@mrocklin mrocklin merged commit 3204da4 into dask:master Oct 5, 2018
@ocaisa ocaisa deleted the python_kw_arg branch October 5, 2018 14:37
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.

Make python command configurable
3 participants