Looking for advice on 'AttributeError: No option 'worker_cores' available' when setting cluster-options

Hi,

usually I specify cluster-options with,

from dask_gateway import Gateway
g = Gateway()
options = g.cluster_options()

followed by

options.worker_cores = 1

Today I get an attribute-error.
I am not sure what could be different on my end from last run (last week), and checked my commits without finding anything obvious. Does someone have a suggestion to what could be tried to get around this?

AttributeError Traceback
AttributeError                            Traceback (most recent call last)
Cell In[2], line 1
----> 1 options.worker_cores = 1

File /srv/conda/envs/notebook/lib/python3.10/site-packages/dask_gateway/options.py:114, in Options.__setattr__(self, key, value)
    113 def __setattr__(self, key, value):
--> 114     return self._set(key, value, AttributeError)

File /srv/conda/envs/notebook/lib/python3.10/site-packages/dask_gateway/options.py:108, in Options._set(self, key, value, exc_cls)
    106     self._fields[key].set(value)
    107 except KeyError:
--> 108     raise exc_cls("No option %r available" % key) from None

AttributeError: No option 'worker_cores' available

Best,

Hi @ofk123,

What happens if you print g.cluster_options()?

On Dask Gateway, available user options are configured on server side. Do you know if you Dask Gateway backend has been modified?

Hi @guillaumeeb ,

print(g.cluster_options())

outputs:

<dask_gateway.options.Options object at 0x7f6d400e67d0>

Maybe its been modified. I am using this deployment. Is there a place I could look, or some code I could run, to check the available user options?
If this is a deployment-specific issue, then I should move this post to the deployments own discourse.

What if you just try to display options object on a Python console or Notebook?

I think it is!

Running both in a python-console, and a notebook,

from dask_gateway import Gateway
g = Gateway()
options = g.cluster_options()
options

returns nothing. (Is it supposed to return something?)

type(options)

returns

dask_gateway.options.Options

Okay, I guess I should close this then

According to the documentation, something like: Options<worker_cores=1, worker_memory=1.0, environment='basic'>.

Okay, I see. Printing dict(options) does output the keys:
'instance_type', 'worker_resource_allocation', 'image', 'environment', 'idle_timeout_minutes'
But not the worker-options that I normally set.

I moved the discussion to here.