scheduler_tools
Tools for composing interdependent tasks on a scheduler (i.e. SLURM)
Setup requirements for launching prefect / dask-distributed on the cluster from your local desktop
On your local system
For whatever project you are working on add scheduler_tools to your dependency list.
conda activate {your_env_name}
pip install -e {your_project_name}
mkdir ~/.aics_dask
create file ~/.aics_dask/ssh.json with contents
{"gateway":{
"url": "slurm-machine.bettertech.com",
"user": "flanders",
"identityfile": "/Users/flanders/ssh/flandersPrivateKey"
},
"dashboard_port": 8787,
"dask_port": 34009
}
On the cluster
conda activate {your_env_name}
pip install -e {your_project_name}
mkdir ~/.aics_dask
programmatically launch remote server and create tunnel
from scheduler_tools import Connector
from pathlib import Path
prefs = {'gateway': {}}
prefs['gateway']['url'] = 'slurm-machine.bettertech.com'
prefs['gateway']['user'] = 'flanders'
prefs['gateway']['identityfile'] = '~/.ssh/id_rsa'
prefs['dask_port'] = 34009
prefs['dashboard_port'] = 8787
dask_prefs = {'cluster_obj_name': {'module': 'dask_jobqueue', 'object': 'SLURMCluster'},
'cluster_conf': {},
'worker_conf': {},
'remote_conf': {}
}
dask_prefs['cluster_obj_name'] = {'module': 'dask_jobqueue', 'object': 'SLURMCluster'}
dask_prefs['cluster_conf']['queue'] = 'aics_cpu_general'
dask_prefs['cluster_conf']['cores'] = 2
dask_prefs['cluster_conf']['memory'] = '4GB'
dask_prefs['cluster_conf']['walltime'] = "02:00:00"
dask_prefs['worker_conf']['minimum_jobs'] = 2
dask_prefs['worker_conf']['maximum_jobs'] = 40
dask_prefs['remote_conf']['env'] = 'dask-scheduler' # whatever you named your remote conda env
dask_prefs['remote_conf']['command'] = 'setup_and_spawn.bash'
dask_prefs['remote_conf']['path'] = '/home/<username>/.aics_dask' # where your preferences live for this
conn = Connector(dask_prefs=dask_prefs, pref_path=Path('~/.aics_dask/ssh.json'))
conn.run_command()
conn.stop_forward_if_running()
conn.forward_ports()
programmatically shutdown remote server and tunnel
from scheduler_tools import Connector
from pathlib import Path
conn = Connector(pref_path=Path('~/.aics_dask/ssh.json'))
conn.stop_dask()
cluster creation context example
from scheduler_tools import Connector, default_dask_prefs
from pathlib import Path
dask_prefs = default_dask_prefs()
with Connector(dask_prefs=dask_prefs, prefs=Path('~/.aics_dask/ssh.json')) as conn:
print(f"local dashboard on: {conn.local_dashboard_port}")
print(f"local dask port: {conn.local_dask_port}")
# !!! your code here !!!
Command line interface
CLI start Dask Cluster command
spawn_dask_cluster -s ~/.aics_dask_gpu/ssh.json -q aics_gpu_general -r <remote_env_name>
CLI stop Dask Cluster command
shutdown_dask_cluster -s ~/.aics_dask/ssh.json
Free software: Allen Institute Software License
Metadata
Release files for scheduler-tools 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scheduler_tools-0.1.5.tar.gz | 24.1 kB | Without provenance | Details for scheduler_tools-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scheduler_tools-0.1.5-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for scheduler_tools-0.1.5-py2.py3-none-any.whl |
Total release size: 52.1 kB
Release files / scheduler_tools-0.1.5.tar.gz
| Download URL | scheduler_tools-0.1.5.tar.gz |
|---|---|
| Size | 24.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aef59d081231f50d7f03f0aea2b48d6c37f4d4bf3607c371ec12a88163d052a4
|
|
BLAKE2b-256 checksum How to use checksums |
f5b0278310e96d462b5c840e65139e48dc5343dca18ce1abbf0804a46b3239b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
|
Release files / scheduler_tools-0.1.5-py2.py3-none-any.whl
| Download URL | scheduler_tools-0.1.5-py2.py3-none-any.whl |
|---|---|
| Size | 27.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
58d3c9019d00391b4daadbbea418d1ef703ac6df893dad790ca7ecbfe3dbf47e
|
|
BLAKE2b-256 checksum How to use checksums |
7b7ceaaf8e68ddefb861b0b90c09563237c1db372d163201bb3f57531e7d5e1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6
|
Security for scheduler-tools 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.