I am having a hard time figuring out how to execute a docker container that runs as a script. Google Cloud Run seems to expect a container that is an application, Google Compute Engine seems to be a VM that runs forever, and Google Kubernetes Engine seems to manage VMs as well.
I would like to be able to create a container that I can run in the cloud, passing in a command that will trigger a script. That script will crunch some numbers and I want to be able to fetch the result when it is done. Not an app, just a script. All this so that I can run a bunch of Monte Carlo simulations in parallel, by running the same container with different exec commands.
Is there a good way to achieve this with a Google cloud product?
Clarification:
For example, I would like to run something like:
gcloud run deploy <myservice> --image <myimage> --command 'python myscript.py arg1 arg2 arg3'
where myscript.py is in the docker image. That script say, runs a simulation based on the input args and produces some output file. Ideally this theoretical gcloud service would make that output file available, but I am fine having my script run the necessary commands to move it to google cloud storage.
I would then run the above command a bunch of times with different args, spawning multiple parallel cloud processes.
I found this solution that suggests gcloud ai-training. Apparently AI training uses general dockers, and I could pragmatically spawn any tasks I need and have the output stored in google cloud storage. Looks fairly python-specialized but it might work.