I have a simple FastAPI API deployed using GCP Cloud Run, which serves as the back-end of a React webapp hosted in Firebase. The system was working fine and I would regularly create new revisions using the following command:
gcloud builds submit --tag $(DOCKER_IMAGE)
gcloud run deploy $(API_NAME) --image $(DOCKER_IMAGE) --port 8000 --memory $(API_MEMORY) --cpu $(API_CPU) --max-instances $(API_MAX_SCALE) --timeout 5m
Even without changing the image tag, the Cloud Run service would get updated with the latest changes of the back-end. However, this failed one day without doing any changes on the system, and since then I haven’t managed to make it work even updating the tag at every deploy.
The error I get is the following, which is an error I had seen in a former revision and fixed already, which makes me suspect Cloud Run is not using the proper revision. The Poetry warning is also something I had already addressed.
ModuleNotFoundError: No module named 'serving'
I can find the images in th registry and the latest tag (0.2.0, which I’m trying to deploy) runs as expected locally.
> gcloud container images list-tags gcr.io/image2paint/image2paint-api
DIGEST TAGS TIMESTAMP
cead5c33f468 0.2.0 2024-08-03T17:32:32
fa0f020fc6a9 0.1.1 2024-08-03T17:16:11
b99f9ae7f147 2024-08-02T11:35:09
ba561bcbe110 0.1.0 2024-08-02T10:42:50
If I check the Yaml of the failing service in Cloud Run UI, I can see that the image is using the expected tag (0.2.0), and the last Revision has the proper sha (starting by cead5c33f468)
I’m new to Cloud Run and I’m not sure how to proceed debugging this issue, especially since I’m unable to understand what caused it. Could this be related to Docker layer caching? Help is much appreciated 🙂