Skip to content

Assumption made about location of dask-worker #75

Closed

Description

@ocaisa

In

dirname = os.path.dirname(sys.executable)

the assumption is made that the dask-worker script is in the same place as the python executable. This is not true in our case since dask is available through an environment module (so the availability of the script is handled via the $PATH envvar).

Would it be possible to add a check before

self._command_template = os.path.join(
to verify that this default actually exists and, if not, use the location found in $PATH (otherwise die gracefully)? Something like

if not os.path.isfile(os.path.join(dirname, 'dask-worker'):
    if os.path.isfile(os.path.abspath('dask-worker'):
        dirname = os.path.join(os.path.abspath('dask-worker'), '..')
    else:
        # Trigger a graceful death

Activity

  1. mrocklin commented on Jun 25, 2018

    @mrocklin
    Member
  2. lesteve commented on Jun 26, 2018

    @lesteve
    Member

    Or use python -m distributed.cli.dask_worker as was done in dask-drmaa here? I think the context in dask-drmaa was that dask-worker was not found in a user install of dask.

  3. ocaisa commented on Jun 26, 2018

    @ocaisa
    MemberAuthor

    @lesteve That seems like a clean solution and would work for us

  4. ocaisa commented on Jun 26, 2018

    @ocaisa
    MemberAuthor

    PR #77 tested for our system (feel free to replace it with something else)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions