Skip to main content

Dask Cluster objects in Saturn Cloud

Project description

dask-saturn

Python library for interacting with Dask clusters in Saturn Cloud.

Dask-Saturn mimics the API of Dask-Kubernetes, but allows the user to interact with clusters created within Saturn Cloud.

Start cluster

From within a Jupyter notebook, you can start a cluster:

from dask_saturn import SaturnCluster

cluster = SaturnCluster()
cluster

By default this will start a dask cluster with the same settings that you have already set in the Saturn UI or in a prior notebook.

To start the cluster with a certain number of workers using the n_workers option. Similarly, you can set the scheduler_size, worker_size, and worker_is_spot.

Note: If the cluster is already running then you can't change the settings. Attempting to do so will raise a warning.

Adjust number of workers

Once you have a cluster you can interact with it via the jupyter widget, or using the scale and adapt methods.

For example, to manually scale up to 20 workers:

cluster.scale(20)

To create an adaptive cluster that controls its own scaling:

cluster.adapt(minimum=1, maximum=20)

Interact with client

To submit tasks to the cluster, you sometimes need access to the Client object. Instantiate this with the cluster as the only argument:

from distributed import Client

client = Client(cluster)
client

Close cluster

To terminate all resources associated with a cluster, use the close method:

cluster.close()

Change settings

To update the settings (such as n_workers, worker_size, worker_is_spot, nthreads) on an existing cluster, use the reset method:

cluster.reset(n_workers=3)

You can also call this without instantiating the cluster first:

cluster = SaturnCluster.reset(n_workers=3)

Development

Create/update a dask-saturn conda environment:

make conda-update

Set environment variables to run dask-saturn with a local atlas server:

export BASE_URL=http://dev.localtest.me:8888/
export SATURN_TOKEN=<JUPYTER_SERVER_SATURN_TOKEN>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dask-saturn-0.1.1.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

dask_saturn-0.1.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file dask-saturn-0.1.1.tar.gz.

File metadata

  • Download URL: dask-saturn-0.1.1.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for dask-saturn-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0032e93ce9284e9eba717dfe89eb193df29fff2efc1d9cafadd8bb8f4002cc02
MD5 e7a88c00cfbeb3a4ddb58f9e21d347b4
BLAKE2b-256 55863b0c9e9f8a22b191a374dce629401a334d8d9cb08c1f3358aa4f0a29bfc9

See more details on using hashes here.

Provenance

File details

Details for the file dask_saturn-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dask_saturn-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6

File hashes

Hashes for dask_saturn-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 df0c5ff4f236c26fe5495630339bc3fbfc0cb32b7bc771e8da4eefbf425875ac
MD5 8cdf3d6db598d6c632b49bb5142b59db
BLAKE2b-256 83278776f9e32379ed4142a9e6c1a14f20dd9cccc4c3bf12544491d3c0ab7d8d

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page