File: deploying-ssh.rst

package info (click to toggle)
dask 2024.12.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,024 kB
  • sloc: python: 105,182; javascript: 1,917; makefile: 159; sh: 88
file content (54 lines) | stat: -rw-r--r-- 1,619 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
SSH
===

It is easy to set up Dask on informally managed networks of machines using SSH.
This can be done manually using SSH and the
Dask :doc:`command line interface <deploying-cli>`,
or automatically using either the :class:`dask.distributed.SSHCluster` Python *cluster manager* or the
``dask-ssh`` command line tool. This document describes both of these options.

.. note::
   Before instaniating a ``SSHCluster`` it is recommended to configure keyless SSH
   for your local machine and other machines. For example, on a Mac to SSH into
   localhost (local machine) you need to ensure the Remote Login option is set in
   System Preferences -> Sharing. In addition, ``id_rsa.pub`` should be in
   ``authorized_keys`` for keyless login.

Python Interface
----------------

.. currentmodule:: dask.distributed

.. autofunction:: SSHCluster

Command Line
------------

The convenience script ``dask-ssh`` opens several SSH connections to your
target computers and initializes the network accordingly. You can
give it a list of hostnames or IP addresses::

   $ dask-ssh 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4

Or you can use normal UNIX grouping::

   $ dask-ssh 192.168.0.{1,2,3,4}

Or you can specify a hostfile that includes a list of hosts::

   $ cat hostfile.txt
   192.168.0.1
   192.168.0.2
   192.168.0.3
   192.168.0.4

   $ dask-ssh --hostfile hostfile.txt

.. note::

   The command line documentation here may differ depending on your installed
   version. We recommend referring to the output of ``dask-ssh --help``.

.. click:: distributed.cli.dask_ssh:main
   :prog: dask-ssh
   :show-nested: