I've been trying to run prefect based on a custom image. I have a rather complicated image build on ...
p

Paweł Biernat

about 2 years ago
I've been trying to run prefect based on a custom image. I have a rather complicated image build on a separate dockerfile. I wanted to just add prefect on top of that and cobbled up the following Dockerfile
FROM [original-image]

RUN pip install prefect smbprotocol

# I keep the flow definition in the "prefect" directory
COPY prefect prefect

# The image wouldn't work without that
ENV TZ=Etc/UTC
ENV MKL_THREADING_LAYER=GNU
ENV MKL_SERVICE_FORCE_INTEL=1

# Run our flow script when the container starts
CMD ["python", "prefect/flow.py"]
So far I've been testing it in a local docker pool and all was well. I now moved to ACI and am getting entrypoint-related errors:
Error: Failed to start container zuge6yxkhm5gm, Error response: to create containerd task: failed to create shim task: failed to create container 4d9adc93761405465a82af86e363832c0e7a043a584588e48a8ef0bb55faf532: guest RPC failure: failed to create container: failed to run runc create/exec call for container 4d9adc93761405465a82af86e363832c0e7a043a584588e48a8ef0bb55faf532 with exit status 1: container_linux.go:380: starting container process caused: exec: "/opt/prefect/entrypoint.sh": permission denied: unknown
I found that the ACI pool has a default entrypoint
/opt/prefect/entrypoint.sh
, so I cleared the entrypoint field, but no dice, I'm still getting the same error. I also tried to copy the entrypoint from prefect repo into the image (this one: https://github.com/PrefectHQ/prefect/blob/main/scripts/entrypoint.sh) but that still didn't work. Any suggestions? What's the intended way to run prefect based on a custom docker image? I want to avoid altering the original image as it's pretty difficult to build already.