1

I have a Dockerfile that runs a python script to process a dataset and store in GCS. I've uploaded the image to GCR and I can run it with Cloud run. It runs fine except for the fact when the script execution is done, the container exits, see image. enter image description here

This causes the service to fail. How do I ensure that while the container is scaled down to 0 it doesn't report that the service failed.

akilesh raj
  • 656
  • 1
  • 8
  • 19
  • Can you share your code? Your docker file and your python script (only the relevant piece of code) – guillaume blaquiere Oct 28 '21 at 12:21
  • 2
    Google Cloud Run is an HTTP Request/Response system. If you are running a script in the background that is ending execution, then the container is behaving the way you wrote it. Instead, wrap your script inside an HTTP request. Use a framework like Flask (Python) or one for your language. Your container entry point must start an HTTP service. – John Hanley Oct 28 '21 at 18:03

0 Answers0