Reputation: 986
Problem Background: I have a Dockerized app. App performs data processing in the background , uploads files to GCS, and exits.
This is not invoked by any HTTP or an event. I want to schedule this per week basis. I can use Google Cloud scheduler for this.
My question is which GCP service I should use to host the docker image?
CloudRun is not a preferred service as it is used mainly for web app/events / pub-sub etc.
GKE IMO should not be used as my application is not a microservice and will not be invoked externally
Google cloud function is not a suitable candidate as my application is heavy and time-consuming and might need powerful CPU/GPU
The only option I could think of is using a Virtual Machine.
Am I missing any GCP service which is more suitable for the background/stand-alone tasks?
Upvotes: 1
Views: 732
Reputation: 75940
I have a side solution. Because you already use Cloud Build, use also Cloud build to run your container!
You can also add a trigger with a scheduler.
Finally, set correctly the timeout and the disk size (if required) and enjoy
Upvotes: 1
Reputation: 1079
GKE and VM are your only options. I would prefer GKE Autopilot as it manages the infrastructure automatically and you only need to focus on your code. Also, you only have to pay for the time period while your pod is active - which is a big advantage for a background/CRON job when compared to a traditional VM.
Upvotes: 3