Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions dask_cloudprovider/cloudprovider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ cloudprovider:
scheduler_machine_type: "n1-standard-1" # size of the machine type to use for the scheduler
worker_machine_type: "n1-standard-1" # size of the machine type to use for all workers
filesystem_size: 50 # amount in GBs of hard drive space to allocate
ngpus: "" # number of GPUs to use. If provided, will be used for both scheduler and worker
gpu_type: "" # type of gpus to use. (e.g. 'nvidia-tesla-t4'). You can view the possible values through ``gcloud compute accelerator-types list``. If provided, will be used for both scheduler and worker
scheduler_ngpus: "" # number of GPUs to use on scheduler
scheduler_gpu_type: "" # type of gpus to use. (e.g. 'nvidia-tesla-t4'). You can view the possible values through ``gcloud compute accelerator-types list``.
worker_ngpus: "" # number of GPUs to use on worker
worker_gpu_type: "" # type of gpus to use. (e.g. 'nvidia-tesla-t4'). You can view the possible values through ``gcloud compute accelerator-types list``.
ngpus: null # number of GPUs to use. If provided, will be used for both scheduler and worker
gpu_type: null # type of gpus to use. (e.g. 'nvidia-tesla-t4'). You can view the possible values through ``gcloud compute accelerator-types list``. If provided, will be used for both scheduler and worker
scheduler_ngpus: null # number of GPUs to use on scheduler
scheduler_gpu_type: null # type of gpus to use. (e.g. 'nvidia-tesla-t4'). You can view the possible values through ``gcloud compute accelerator-types list``.
worker_ngpus: null # number of GPUs to use on worker
worker_gpu_type: null # type of gpus to use. (e.g. 'nvidia-tesla-t4'). You can view the possible values through ``gcloud compute accelerator-types list``.
disk_type: "pd-standard" # type of disk to use: pd-standard, pd-ssd
docker_image: "daskdev/dask:latest" # docker image to use
auto_shutdown: true # Shutdown instances automatically if the scheduler or worker services time out.
Expand Down
4 changes: 2 additions & 2 deletions dask_cloudprovider/gcp/instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,12 +667,12 @@ def __init__(
self.scheduler_ngpus = (
scheduler_ngpus
if scheduler_ngpus is not None
else self.config.get("scheduler_ngpus", 0)
else self.config.get("scheduler_ngpus") or 0
)
self.worker_ngpus = (
worker_ngpus
if worker_ngpus is not None
else self.config.get("worker_ngpus", 0)
else self.config.get("worker_ngpus") or 0
)
else:
if scheduler_ngpus is not None or worker_ngpus is not None:
Expand Down
11 changes: 11 additions & 0 deletions dask_cloudprovider/gcp/tests/test_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ async def test_init():
assert cluster.status == Status.created


@pytest.mark.asyncio
async def test_init_gpu_config_defaults():
"""Regression test for https://github.com/dask/dask-cloudprovider/pull/479."""
skip_without_credentials()

cluster = GCPCluster(asynchronous=True)
assert cluster.ngpus is None
assert cluster.scheduler_ngpus == 0
assert cluster.worker_ngpus == 0


@pytest.mark.asyncio
async def test_get_cloud_init():
skip_without_credentials()
Expand Down
Loading