https://prefect.io logo
Title
k

Kishan

11/11/2022, 9:26 PM
I'm trying to run a deployment as a KubernetesJob on my prefect agent hosted on GKE. It says the flow run is pending and I am getting the following error in the pod
No module named prefect.engine.__main__; 'prefect.engine' is a package and cannot be directly executed
. Anyone know what this means? Also, for additional context, here are the storage and infrastructure blocks I set up.
gcs_block = GCS.load("gcs-block")
infra_block = KubernetesJob(
image="us-east1-docker.pkg.dev/{MY PROJECT}/prefect-agents/{MY IMAGE}",
env=dict(PREFECT_LOGGING_LEVEL="DEBUG"),
)
1
z

Zanie

11/11/2022, 10:01 PM
What do you get if you run
docker run <your-image>  python -m "prefect.engine"
?
I’ve never see that error, what kind of Python setup do you have?
k

Kishan

11/11/2022, 10:03 PM
I get
/usr/local/bin/python: No module named prefect.engine.__main__; 'prefect.engine' is a package and cannot be directly executed
Im pulling the latest Prefect build in my docker file and so I'm using whatever python setup is in there
# Dockerfile
FROM prefecthq/prefect:latest
RUN pip install gcsfs
Also to note, my GKE cluster is running on "autopilot" which is GKE's automated cluster management service on top of Kubernetes. I'm not sure if this may be causing any issues but just wanted to give that additional context.
z

Zanie

11/11/2022, 10:15 PM
Ahh
prefect:2-latest
is the tag you want, we did not update
latest
from v1 to prevent breaking things for existing users
k

Kishan

11/11/2022, 11:04 PM
Ah ic, thanks for the find! It works now!