Unstructured-IO / unstructured-api

Apache License 2.0
508 stars 108 forks source link

Not able to deploy on Google Cloud RUn #354

Closed rebecca1001 closed 4 months ago

rebecca1001 commented 8 months ago

I want to host my own version of unstructured on goole cloud run but not able to do so. I pulled the container and uploaded to google cloud build. Then I tried using it on google cloud run to start the service but it always said that server failed to listen to the port. I made sure that the port is 8000 but still does not work.

awalker4 commented 8 months ago

Hi there! Do you have access to the container logs? The first thing I would check for is the message below, implying the server is fully up and accepting traffic. 2024-01-26 17:23:09,945 unstructured_api INFO Started Unstructured API

reachusama commented 8 months ago

Hi, I tried the same. This is the error that I am getting in the logs:

(terminated: Application failed to start: failed to load /home/notebook-user/scripts/app-start.sh: exec format error)

awalker4 commented 8 months ago

Ah, this error is consistent with the docker image being built for the wrong platform. Does this fix the issue?

docker pull --platform=linux/arm64 quay.io/unstructured-io/unstructured-api:latest
reachusama commented 8 months ago

It still doesn't work. I get this error: terminated: Application failed to start: failed to load /home/notebook-user/scripts/app-start.sh: exec format error

kenzik commented 8 months ago

The image doesn't listen on the PORT environment variable, which Cloud Run uses.

You have two choices:

Example of the latter:

SCR-20240202-jqyn

awalker4 commented 8 months ago

@reachusama Apologies - what about docker pull --platform=linux/amd64 quay.io/unstructured-io/unstructured-api:latest

MthwRobinson commented 4 months ago

Try @awalker4 's suggestion if you hit this error. I this problem recurs using the command above, we can reopen.