hello, i'm trying to run on GCP GKE with a custom ...
# prefect-community
d
hello, i'm trying to run on GCP GKE with a custom image. the pod is dying immediately with these errors in the logs:
Copy code
/home/flex/.local/bin/prefect: line 3: import: command not found
/home/flex/.local/bin/prefect: line 4: import: command not found
/home/flex/.local/bin/prefect: line 5: from: command not found
/home/flex/.local/bin/prefect: prefect: line 7: syntax error near unexpected token `('
/home/flex/.local/bin/prefect: prefect: line 7: `    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])'
it looks like it's finding and parsing the
prefect
executable file but not running it with
python
. when I run a local container using the image, i'm able to successfully call the command
prefect
and run a flow.
prefect
is in the path of active user (
flex
). i'm also able to run basic flows successfully on GKE using prefect's base image, so the issue is specific to our custom image. do you have any suggestions on what we can check in our custom image?
k
Hi @Dominick Olivito, it will be easier to just build on top of the base image, but if you can’t, I feel like the thing to check would be if there are multiple python or pip installations. It seems like you can’t even
import
?
d
we aren't currently building on top of the prefect base image. we need to build an image that also contains a custom executable compiled from Java. so our plan was to first build that image then install python and prefect on top of it. i'll check for multiple python/pip installations, thanks for the suggestion
a
If you start with Ubuntu 20.04 LTS, Python 3.8 is already preinstalled and it works well with Prefect 1.0.0
d
reporting back on this: this issue was somehow with the
ENTRYPOINT
on our image. we finally got our custom image to work with Prefect on Kubernetes by using the same entrypoint.sh script and config as in the official Prefect image:
Copy code
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
# script will be run as a non-root user
RUN chmod 555 /usr/local/bin/entrypoint.sh
ENTRYPOINT ["tini", "-g", "--", "entrypoint.sh"]
k
Ah I see thanks for letting us know!