I'm looking for architecture advice for an application I'm building. The app renders videos in a container on Cloud Run. Renders can take 1-5 minutes. I need advice on the best way to trigger these containers and I have a couple questions:
1. If I trigger the container from a Cloud Function and send a response back to the function from my container before the video has completed rendering, will the container be shut down before rendering finishes because it is no longer processing an HTTP request? I don't want to leave the function running for the entire render because it would just be idling waiting for the container to finish. I'm not exactly sure how Cloud Run decides that a container is "done" but I assume it is when it sends the HTTP response, not when the GET handler finishes processing.
2. I understand I could alternatively use Cloud Tasks or a PubSub trigger to start the rendering process asynchronously. I'm wondering if there is a major difference between these options regarding pricing or functionality that would make one a better choice.
Overall it seems kind of convoluted to trigger a Cloud Function which triggers a Cloud Task which triggers a Cloud Run container, and also I have to be running App Engine to use Cloud Taks at all, so I'm wondering if I'm missing something.
Advice appreciated!
Lance