-
-
Notifications
You must be signed in to change notification settings - Fork 112
GCP provider #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GCP provider #131
Conversation
…der into gcp-provider
9bb4445
to
6ec1c31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took this for a spin but am stuck with credentials errors. It's likely something I'm doing, but I'm going to need some docs/guidance.
I've tried:
- Reauthenticating with
gcloud auth login
- Upgrading my SDK version
pip install google-api-python-client --upgrade
See my comments for details on what I'm seeing.
setup.py
Outdated
@@ -8,6 +8,8 @@ | |||
extras_require = { | |||
"aws": ["aiobotocore>=0.10.2"], | |||
"azure": ["azureml-sdk>=1.0.83"], | |||
"digitalocean": ["python-digitalocean"], | |||
"googlecloud": ["google-api-python-client"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't match the ImportError
which says pip install "dask-cloudprovider[gcp]"
.
**kwargs, | ||
): | ||
super().__init__(**kwargs) | ||
self.compute = googleapiclient.discovery.build("compute", "v1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm initially having credentials issues and am seeing the following exception. We should probably catch this and raise something friendlier.
@pytest.mark.asyncio
async def test_init():
> cluster = GCPCluster(asynchronous=True)
dask_cloudprovider/providers/gcp/tests/test_gcp.py:44:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
dask_cloudprovider/providers/gcp/instances.py:284: in __init__
self.compute = googleapiclient.discovery.build("compute", "v1")
../../../miniconda3/envs/daskdev/lib/python3.8/site-packages/googleapiclient/_helpers.py:134: in positional_wrapper
return wrapped(*args, **kwargs)
../../../miniconda3/envs/daskdev/lib/python3.8/site-packages/googleapiclient/discovery.py:276: in build
return build_from_document(
../../../miniconda3/envs/daskdev/lib/python3.8/site-packages/googleapiclient/_helpers.py:134: in positional_wrapper
return wrapped(*args, **kwargs)
../../../miniconda3/envs/daskdev/lib/python3.8/site-packages/googleapiclient/discovery.py:516: in build_from_document
credentials = _auth.default_credentials(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
scopes = None, quota_project_id = None
def default_credentials(scopes=None, quota_project_id=None):
"""Returns Application Default Credentials."""
if HAS_GOOGLE_AUTH:
> credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id)
E TypeError: default() got an unexpected keyword argument 'quota_project_id'
../../../miniconda3/envs/daskdev/lib/python3.8/site-packages/googleapiclient/_auth.py:54: TypeError
You must configure your GCP credentials to run this test. | ||
|
||
$ export GOOGLE_APPLICATION_CREDENTIALS=<path-to-gcp-json-credentials> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have configured credentials as described here but the test is still skipping. See the traceback I raised before.
I'm guessing something else is required to configure the credentials here, or the try/except is being greedy and catching some other exception.
@eric-czech I finished some touches. If you have time/interest in the coming weeks I think this is safe to test |
Hey @quasiben, I wasn't quite sure what basic configuration + usage would look like but I started with this: from dask_cloudprovider.providers.gcp.instances import GCPCluster
cluster = GCPCluster(
name='dask-gcp-test-1',
zone='us-east1-c',
machine_type='n1-standard-8',
docker_image="daskdev/dask:latest",
worker_command='dask-worker',
ngpus=0,
projectid=PROJECT_ID,
)
~/miniconda3/envs/dask-cp/lib/python3.8/site-packages/distributed/deploy/spec.py in _start(self)
299 if isinstance(cls, str):
300 cls = import_term(cls)
--> 301 self.scheduler = cls(**self.scheduler_spec.get("options", {}))
302
303 self.status = Status.starting
TypeError: 'NoneType' object is not callable Full Trace--------------------------------------------------------------------------- TypeError Traceback (most recent call last) in ----> 1 cluster = GCPCluster( 2 name='dask-gcp-test-1', zone='us-east1-c', machine_type='n1-standard-8', 3 projectid='uk-biobank-279813', 4 docker_image="daskdev/dask:latest", 5 worker_command='dask-worker',~/repos/dask-cloudprovider/dask_cloudprovider/providers/gcp/instances.py in init(self, name, zone, machine_type, projectid, source_image, docker_image, ngpus, gpu_type, worker_command, worker_extra_args, auto_shutdown, **kwargs) ~/repos/dask-cloudprovider/dask_cloudprovider/providers/generic/vmcluster.py in init(self, n_workers, **kwargs) ~/miniconda3/envs/dask-cp/lib/python3.8/site-packages/distributed/deploy/spec.py in init(self, workers, scheduler, worker, asynchronous, loop, security, silence_logs, name) ~/miniconda3/envs/dask-cp/lib/python3.8/site-packages/distributed/deploy/cluster.py in sync(self, func, asynchronous, callback_timeout, *args, **kwargs) ~/miniconda3/envs/dask-cp/lib/python3.8/site-packages/distributed/utils.py in sync(loop, func, callback_timeout, *args, **kwargs) ~/miniconda3/envs/dask-cp/lib/python3.8/site-packages/distributed/utils.py in f() ~/miniconda3/envs/dask-cp/lib/python3.8/site-packages/tornado/gen.py in run(self) ~/repos/dask-cloudprovider/dask_cloudprovider/providers/generic/vmcluster.py in _start(self) ~/miniconda3/envs/dask-cp/lib/python3.8/site-packages/distributed/deploy/spec.py in _start(self) TypeError: 'NoneType' object is not callable Am I missing something obvious? |
56950f5
to
6e759a8
Compare
@eric-czech things should be a far better state now with sync and async support thanks to @jacobtomlinson. |
I've just pulled master and pushed a commit to shuffle the imports to the new layout. |
Thanks @jacobtomlinson . I'll fix the imports in tests and push. After that would you be willing to give this another review ? |
* Migrate to GitHub Actions * Fix environment file name * Quiet conda * Success message * Exclude versioneer from flake8
58ad401
to
aa50c31
Compare
Thank you @jacobtomlinson ! |
Ooh, I'm happy to see this in.
…On Fri, Nov 6, 2020 at 5:50 AM Benjamin Zaitlen ***@***.***> wrote:
Thank you @jacobtomlinson <https://github.com/jacobtomlinson> !
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#131 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACKZTBT5UBUZFNQBBJQ5XLSOP5JRANCNFSM4RAPZLCQ>
.
|
Attempt at resolving #130
cc @jacobtomlinson @mrocklin
Currently, this code is non-functional but scaffolding is in place to get things up and runningPR should be in a runnable state now