Skip to content
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

kubernetes-asyncio 22.6 breaks DaskExecutor with dask_kubernetes. #5573

Closed
mkarbo opened this issue Mar 18, 2022 · 3 comments
Closed

kubernetes-asyncio 22.6 breaks DaskExecutor with dask_kubernetes. #5573

mkarbo opened this issue Mar 18, 2022 · 3 comments
Labels
expertise:dask Needs a Dask expert opinion expertise:k8s Requires knowledge of Kubernetes needs:external Blocked by a needed change outside of Prefect

Comments

@mkarbo
Copy link
Contributor

mkarbo commented Mar 18, 2022

If anyone else is experiencing issues in prefect using dask + kubernetes with serviceaccounts, if you are experiencing issues today, it might be because of a new version of kubernetes-asyncio. See this issue for details.


After rebuilding images, I got the following error:

...
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/dask_kubernetes/core.py", line 474, in __init__
    super().__init__(**self.kwargs)
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/distributed/deploy/spec.py", line 260, in __init__
    self.sync(self._start)
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/distributed/utils.py", line 311, in sync
    return sync(
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/distributed/utils.py", line 378, in sync
    raise exc.with_traceback(tb)
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/distributed/utils.py", line 351, in f
    result = yield future
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/tornado/gen.py", line 762, in run
    value = future.result()
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/dask_kubernetes/core.py", line 603, in _start
    await super()._start()
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/distributed/deploy/spec.py", line 293, in _start
    self.scheduler = await self.scheduler
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/distributed/deploy/spec.py", line 59, in _
    await self.start()
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/dask_kubernetes/core.py", line 182, in start
    await super().start(**kwargs)
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/dask_kubernetes/core.py", line 87, in start
    raise e
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/dask_kubernetes/core.py", line 77, in start
    self._pod = await self.core_api.create_namespaced_pod(
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/kubernetes_asyncio/client/api_client.py", line 192, in __call_api
    raise e
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/kubernetes_asyncio/client/api_client.py", line 185, in __call_api
    response_data = await self.request(
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/kubernetes_asyncio/client/rest.py", line 223, in POST
    return (await self.request("POST", url,
  File "/pipelines/flow_test/.venv/lib/python3.9/site-packages/kubernetes_asyncio/client/rest.py", line 180, in request
    raise ApiException(http_resp=r)
kubernetes_asyncio.client.exceptions.ApiException: (403)
Reason: Forbidden
HTTP response headers: <...>
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"pods is forbidden: User \"system:anonymous\" cannot create resource \"pods\" in API group \"\" in the namespace \"prefect\"","reason":"Forbidden","details":{"kind":"pods"},"code":403}

To fix it, I added 'kubernetes-asyncio<22.6' as a constraint in my packages. I don't know where the error lies, whether in prefect, dask_kubernetes or in kubernetes-asyncio - just posting this for awareness.

@ddelange
Copy link
Contributor

ddelange commented Mar 22, 2022

Looks like purely upstream ref dask/dask-kubernetes#419 / dask/dask-kubernetes#420 / tomplus/kubernetes_asyncio#187

@zanieb zanieb added needs:external Blocked by a needed change outside of Prefect expertise:dask Needs a Dask expert opinion expertise:k8s Requires knowledge of Kubernetes labels Mar 22, 2022
@ddelange
Copy link
Contributor

I think this issue can be closed as 22.6.1 has been released and fixes the issue

@zanieb
Copy link
Contributor

zanieb commented Mar 23, 2022

Thanks!

@zanieb zanieb closed this as completed Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expertise:dask Needs a Dask expert opinion expertise:k8s Requires knowledge of Kubernetes needs:external Blocked by a needed change outside of Prefect
Projects
None yet
Development

No branches or pull requests

3 participants