# No longer able to set \`dask\_gateway.Gateway.cluster\_options()\` manually from user-end

**URL:** https://discourse.pangeo.io/t/no-longer-able-to-set-dask-gateway-gateway-cluster-options-manually-from-user-end/3851
**Category:** Pangeo Cloud Support
**Created:** [November 22, 2023, 5:27pm UTC](https://discourse.pangeo.io/t/no-longer-able-to-set-dask-gateway-gateway-cluster-options-manually-from-user-end/3851 "2023-11-22T17:27:33Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ofk123](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/ofk123/32/1853_2.png) [@ofk123](https://discourse.pangeo.io/u/ofk123)
#### Post date: [November 22, 2023, 5:27pm UTC](https://discourse.pangeo.io/t/no-longer-able-to-set-dask-gateway-gateway-cluster-options-manually-from-user-end/3851/1 "2023-11-22T17:27:33Z")

</div>

Looking for a way around this.

Usually

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

```

followed by

```auto
options.worker_cores = 1

```

works from the local hub. (Really appreciate this).  
This seems to be failing yesterday and today with `No option 'worker_cores' available`.

> **Traceback**
>
> ```auto
> ---------------------------------------------------------------------------
> AttributeError Traceback (most recent call last)
> Cell In[4], 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
> 
> ```

Does someone know what could be the cause, or, where one should look/what code to run, to check currently available options?

Best,

---

<div class="post-metadata">

### Author: ![betolink](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/betolink/32/247_2.png) [@betolink](https://discourse.pangeo.io/u/betolink)
#### Post date: [November 27, 2023, 9:38pm UTC](https://discourse.pangeo.io/t/no-longer-able-to-set-dask-gateway-gateway-cluster-options-manually-from-user-end/3851/2 "2023-11-27T21:38:13Z")

</div>

If I’m not mistaken, those options come from a server-side [configuration file](https://gateway.dask.org/cluster-options.html#server-configuration). Are you using a LocalCluster or a distributed cluster? if it’s local I don’t think you need the GateWay. Or maybe the API changed? I wonder if @jrbourbeau can chime in and give us better clues of what may be happening here.

---

<div class="post-metadata">

### Author: ![ofk123](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/ofk123/32/1853_2.png) [@ofk123](https://discourse.pangeo.io/u/ofk123)
#### Post date: [November 28, 2023, 10:01am UTC](https://discourse.pangeo.io/t/no-longer-able-to-set-dask-gateway-gateway-cluster-options-manually-from-user-end/3851/3 "2023-11-28T10:01:41Z")

</div>

> [@betolink](#):
>
> Are you using a LocalCluster or a distributed cluster?

Hi @betolink, a distributed cluster.

The last week I have used `cluster = GatewayCluster()`, which as default sets `worker_cores` to 1,  
instead of `cluster = g.new_cluster(options)`. If it is a change of API then I should change this in our code as well.

For reference I moved this post from the dask discourse ([link](https://dask.discourse.group/t/looking-for-advice-on-attributeerror-no-option-worker-cores-available-when-setting-cluster-options/2332/7))

---

<div class="post-metadata">

### Author: ![TomAugspurger](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/tomaugspurger/32/21_2.png) [@TomAugspurger](https://discourse.pangeo.io/u/TomAugspurger)
#### Post date: [November 28, 2023, 12:32pm UTC](https://discourse.pangeo.io/t/no-longer-able-to-set-dask-gateway-gateway-cluster-options-manually-from-user-end/3851/4 "2023-11-28T12:32:36Z")

</div>

@betolink is correct. You, or whoever deployed your Dask Gateway service, needs to configure an option handler that accepts and uses `worker_cores` for this to work. See [Exposing Cluster Options — Dask Gateway 2023.9.0 documentation](https://gateway.dask.org/cluster-options.html#worker-cores-and-memory) for an example.

---

<div class="post-metadata">

### Author: ![ofk123](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/ofk123/32/1853_2.png) [@ofk123](https://discourse.pangeo.io/u/ofk123)
#### Post date: [November 28, 2023, 2:02pm UTC](https://discourse.pangeo.io/t/no-longer-able-to-set-dask-gateway-gateway-cluster-options-manually-from-user-end/3851/5 "2023-11-28T14:02:32Z")

</div>

Hi @TomAugspurger, I am using [the us-central1](https://us-central1-b.gcp.pangeo.io/) deployment, so I dont have the access mentioned in the example. (administrator, `dask_gateway_server`).

`cluster = GatewayCluster()` solves this “issue” for me though but other users might want to be able to configure it(?). Let me know how as a user I could help out/test things if anything.

---

<div class="post-metadata">

### Author: ![ofk123](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pangeo.io/ofk123/32/1853_2.png) [@ofk123](https://discourse.pangeo.io/u/ofk123)
#### Post date: [February 6, 2024, 1:53pm UTC](https://discourse.pangeo.io/t/no-longer-able-to-set-dask-gateway-gateway-cluster-options-manually-from-user-end/3851/6 "2024-02-06T13:53:47Z")

</div>

Just to sum up:

**Which cluster are you using**  
[us-central1-b.gcp.pangeo.io](https://us-central1-b.gcp.pangeo.io/)

**If your problem involves code, please do your best to include an MRE**

> **An example from https://pangeo.io/cloud.html that fails**
>
> [https://pangeo.io/cloud.html#:~…](https://pangeo.io/cloud.html#:~:text=from%20dask_gateway%20import%20Gateway%0Agateway%20%3D%20Gateway()%0Aoptions%20%3D%20gateway.cluster_options()%0A%0A%23%20set%20the%20options%20programatically%2C%20or%20through%20their%20HTML%20repr%0Aoptions.worker_memory%20%3D%2010%20%20%23%2010%20GB%20of%20memory%20per%20worker)
> 
> ```auto
> from dask_gateway import Gateway
> g = Gateway()
> options = g.cluster_options()
> options.worker_memory = 10 
> 
> ```
> 
> ```auto
> ---------------------------------------------------------------------------
> AttributeError Traceback (most recent call last)
> Cell In[1], line 4
> 2 g = Gateway()
> 3 options = g.cluster_options()
> ----> 4 options.worker_memory = 10 # 10 GB of memory per worker.
> 
> 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_memory' available
> 
> ```

**A concise summary of your problem**  
No longer able to set `dask_gateway.Gateway.cluster_options()` manually.

From @betolink and @guillaumeeb I understand the options come from a server-configuration-file.

- Maybe Dask Gateway backend has been modified/API changed?
- If options like `worker_cores` and `worker_memory` are still meant to be configurable, what is the recommended way?
