Skip to content

Add ability to override python used to start workers#167

Merged
mrocklin merged 2 commits into
dask:masterfrom
ocaisa:python_kw_arg
Oct 5, 2018
Merged

Add ability to override python used to start workers#167
mrocklin merged 2 commits into
dask:masterfrom
ocaisa:python_kw_arg

Conversation

@ocaisa
Copy link
Copy Markdown
Member

@ocaisa ocaisa commented Oct 5, 2018

fixes #166

Comment thread dask_jobqueue/core.py Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread dask_jobqueue/core.py
cancel_command: str
Abstract attribute for job scheduler cancel command,
should be overriden
should be overridden
Copy link
Copy Markdown
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
Copy Markdown
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