Curtis White
07/31/2024, 5:25 PM2.16.4
?Alexander Azzam
07/31/2024, 5:31 PMCurtis White
07/31/2024, 5:34 PMAlexander Azzam
07/31/2024, 5:43 PMNate
07/31/2024, 5:52 PMprefect.utilities.timeout
but the newest kubernetes worker uses that moduleCurtis White
07/31/2024, 5:54 PMprefecthq/prefect:2.16.4-python3.10
so maybe the version is not pinned in that image?
Either way, I just upgraded to the newest version and it seems to work alright nowNate
07/31/2024, 5:56 PMWe are actually using the provided imageprefect 2.16.4 just doesnt have that module, so when installingso maybe the version is not pinned in that image?prefecthq/prefect:2.16.4-python3.10
prefect-kubernetes>=0.4.0
on top (which uses that module) then we get that import error
but yeah, upgrading prefect or downgrading prefect-kubernetes would resolve - glad you got it figured out!Curtis White
07/31/2024, 5:56 PMNate
07/31/2024, 5:56 PMCurtis White
07/31/2024, 6:05 PMTraceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/prefect/workers/base.py", line 908, in _submit_run_and_capture_errors
result = await self.run(
File "/usr/local/lib/python3.10/site-packages/prefect_kubernetes/worker.py", line 612, in run
async with self._get_configured_kubernetes_client(configuration) as client:
File "/usr/local/lib/python3.10/contextlib.py", line 199, in __aenter__
return await anext(self.gen)
File "/usr/local/lib/python3.10/site-packages/prefect_kubernetes/worker.py", line 743, in _get_configured_kubernetes_client
await config.load_incluster_config()
TypeError: object NoneType can't be used in 'await' expression
Nate
07/31/2024, 6:35 PMCurtis White
07/31/2024, 6:36 PMCurtis White
07/31/2024, 6:36 PMspec:
serviceAccountName: scheduler
containers:
- name: worker
image: prefecthq/prefect:2.19.9-python3.11
command:
[
"prefect",
"worker",
"start",
"--pool",
"${ENVIRONMENT_NAME_H}",
"--type",
"kubernetes",
"--install-policy",
"always",
]
imagePullPolicy: "Always"
securityContext:
allowPrivilegeEscalation: false
Nate
07/31/2024, 6:37 PMNate
07/31/2024, 6:39 PM» docker run -it --rm prefecthq/prefect:2.19.9-python3.11-kubernetes bash
root@53647e34beb2:/opt/prefect# pip list | grep prefect
prefect 2.19.9
prefect-kubernetes 0.3.11
Curtis White
07/31/2024, 6:48 PMCurtis White
07/31/2024, 6:49 PMNate
07/31/2024, 6:50 PMEXTRA_PIP_PACKAGES
on the deployment / work pool or are pip installing something in the pull
section, then yeah it would install prefect-kubernetes on top at runtimeNate
07/31/2024, 6:52 PMNate
07/31/2024, 6:54 PMif-not-present
instead of always
Curtis White
07/31/2024, 6:55 PMEXTRA_PIP_PACKAGES
but I will try with this different policyCurtis White
07/31/2024, 6:58 PMNate
07/31/2024, 6:58 PMCurtis White
07/31/2024, 6:59 PMNate
07/31/2024, 7:00 PMCurtis White
07/31/2024, 7:06 PMimagePullPolicy: "Always"
not the install policy in the worker start. I have a flow run executing at leastNate
07/31/2024, 7:07 PM