Skip to content

Commit

Permalink
Add AzureVMCluster (#175)
Browse files Browse the repository at this point in the history
* Add support for Azure VMs

* Start on auth

* Add AzureVMCluster

* Move azureml to new submodule, make azurevm creds skip a decorator and linting

* Restructure imports and errors

* Fix test import

* Fix AzureML import message

* Expose all config options

* Enable worker_class worker launch mode

* Close worker

* Add examples to docstring

* Update doc/source/azureml.rst

Co-authored-by: Benjamin Zaitlen <quasiben@users.noreply.github.com>

Co-authored-by: Benjamin Zaitlen <quasiben@users.noreply.github.com>
  • Loading branch information
jacobtomlinson and quasiben committed Nov 19, 2020
1 parent d1cda2e commit 67d48e6
Show file tree
Hide file tree
Showing 22 changed files with 849 additions and 65 deletions.
1 change: 1 addition & 0 deletions ci/environment-3.7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies:
- flake8
- ipywidgets
- pytest
- pytest-asyncio
- black >=20.8b1
- pyyaml
# dask dependencies
Expand Down
1 change: 1 addition & 0 deletions ci/environment-3.8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies:
- flake8
- ipywidgets
- pytest
- pytest-asyncio
- black >=20.8b1
- pyyaml
# dask dependencies
Expand Down
29 changes: 26 additions & 3 deletions dask_cloudprovider/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,43 @@


def __getattr__(name):
"""As of dask_cloudprovider v0.5.0 all cluster managers are in cloud provider specific submodules.
This allows us to more easily separate out optional dependencies. However we maintain some helpful
errors at the top level.
This is both to help migrate users of any cluster managers that existed before this was changed
and also to help anyone who incorrectly tries to import a cluster manager from the top level.
Perhaps because they saw it used in some documentation but didn't see the import.
"""

if name in ["EC2Cluster", "ECSCluster", "FargateCluster"]:
raise ImportError(
"AWS cluster managers have been moved into the aws subpackage. "
"AWS cluster managers must be imported from the aws subpackage. "
f"Please import dask_cloudprovider.aws.{name}"
)

if name in ["AzureMLCluster"]:
raise ImportError(
"Azure cluster managers have been moved into the azure subpackage. "
"Azure Machine Learning cluster managers must be imported from the azureml subpackage. "
f"Please import dask_cloudprovider.azureml.{name}"
)

if name in ["AzureVMCluster"]:
raise ImportError(
"Azure cluster managers must be imported from the the azure subpackage. "
f"Please import dask_cloudprovider.azure.{name}"
)

if name in ["GCPCluster"]:
raise ImportError(
"Google Cloud cluster managers must be imported from the the gcp subpackage. "
f"Please import dask_cloudprovider.gcp.{name}"
)

if name in ["DropletCluster"]:
raise ImportError(
"DigitalOcean cluster managers have been moved into the digitalocean subpackage. "
"DigitalOcean cluster managers must be imported from the digitalocean subpackage. "
f"Please import dask_cloudprovider.digitalocean.{name}"
)
2 changes: 1 addition & 1 deletion dask_cloudprovider/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .azureml import AzureMLCluster
from .azurevm import AzureVMCluster

0 comments on commit 67d48e6

Please sign in to comment.