You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the issue:
Due the listed version of kubernetes dependency (v12.0.1, see here), in certain condition, pip install dask_kubernetes would install older versions of kubernetes (e.g. 17.17.0) which do not yet have V1PodDisruptionBudget class / attribute. This will result in the following error when trying to start a cluster:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/distributed/deploy/spec.py", line 309, in _start
self.scheduler = await self.scheduler
File "/usr/local/lib/python3.9/site-packages/distributed/deploy/spec.py", line 64, in _
await self.start()
File "/usr/local/lib/python3.9/site-packages/dask_kubernetes/classic/kubecluster.py", line 218, in start
self.pdb = await self._create_pdb()
File "/usr/local/lib/python3.9/site-packages/dask_kubernetes/classic/kubecluster.py", line 269, in _create_pdb
self.pdb_template = clean_pdb_template(make_pdb_from_dict(pdb_template_dict))
File "/usr/local/lib/python3.9/site-packages/dask_kubernetes/common/objects.py", line 241, in make_pdb_from_dict
return SERIALIZATION_API_CLIENT.deserialize(dict_, client.V1PodDisruptionBudget)
AttributeError: module 'kubernetes.client' has no attribute 'V1PodDisruptionBudget'
Minimal Complete Verifiable Example:
Use the following docker file to build an image (docker build -t dask-deps .)
RuntimeError: Cluster failed to start: module 'kubernetes.client' has no attribute 'V1PodDisruptionBudget'
The fix is trivial - need to update requirements for the repo/package to the first version where 'V1PodDisruptionBudget' was introduced - seems that was introduced in v21.7.0. (I can try to make a PR later)
Anything else we need to know?:
With plain pip install dask_kubernetes, a later version (24) of kubernetes is install and the bug won't happen. It seems that the project I work on somehow introduce and cause version 17 to be installed...
Environment:
Dask version: ~=2022.10.0
Dask kubernetes version: ~=2022.10.0
Python version: 3.9.5
Operating System: debian buster
Install method (conda, pip, source): pip
The text was updated successfully, but these errors were encountered:
Thanks for raising such a detailed issue. If you have an interest in making the PR to bump the minimum up that would be awesome! Feel free to ping me directly for review.
What version should I change to - first that introduced V1PodDisruptionBudget? Latest available?
More importantly, how do I test this change doesn't break anything?
I think the first that introduced the V1PodDisruptionBudget will be fine.
We currently don't test minimum versions (which is how this happened in the first place) and I don't expect we will start now. If problems like this start coming up more often then of course we can reassess that.
If the CI passes with your PR then I'm happy to merge it. If you want to test it more robustly locally I recommend you create a fresh environment and then downgrade the kubernetes package to the minimum allowed and ensure tests run locally.
Describe the issue:
Due the listed version of
kubernetes
dependency (v12.0.1, see here), in certain condition,pip install dask_kubernetes
would install older versions ofkubernetes
(e.g. 17.17.0) which do not yet haveV1PodDisruptionBudget
class / attribute. This will result in the following error when trying to start a cluster:Minimal Complete Verifiable Example:
Use the following docker file to build an image (
docker build -t dask-deps .
)Run the container (
docker run --rm -it dask-deps bash
),and manually install kubectl and configure it (create relevant
./kube/config
)Then, install the dependencies:
The following code would generate the error (vanilla creation of
KubeCluster
)This should throw an error:
The fix is trivial - need to update requirements for the repo/package to the first version where 'V1PodDisruptionBudget' was introduced - seems that was introduced in v21.7.0. (I can try to make a PR later)
Anything else we need to know?:
With plain
pip install dask_kubernetes
, a later version (24) ofkubernetes
is install and the bug won't happen. It seems that the project I work on somehow introduce and cause version 17 to be installed...Environment:
The text was updated successfully, but these errors were encountered: