Amazon Web Services (AWS)
.. currentmodule:: dask_cloudprovider.aws
.. autosummary::
EC2Cluster
ECSCluster
# A script that gives a local Dask cluster something to do without stressing hardware. | |
# Useful for testing the dashboard. | |
import time | |
from dask_ctl import get_cluster | |
from dask.distributed import Client, wait | |
from dask import delayed |
.. currentmodule:: dask_cloudprovider.aws
.. autosummary::
EC2Cluster
ECSCluster
version: "3.9" | |
services: | |
rapids: | |
image: rapidsai/rapidsai:0.18-cuda11.0-runtime-ubuntu16.04-py3.8 | |
ports: | |
- "8888:8888" # Jupyter | |
- "8786:8786" # Dask communication | |
- "8787:8787" # Dask dashboard |
import asyncio | |
async def eternity(): | |
await asyncio.sleep(2) # Sleep asynchronously | |
print("I should've timed out") | |
async def main(): | |
# Wait for at most 1 second | |
try: | |
await asyncio.wait_for(eternity(), timeout=1.0) |