'Run long container job on AWS once

I have a simple need: I need to run an arbitrary container job on AWS once.

I need docker run <container_image> program.py arg1 arg2 arg3, but on AWS cloud. Not a service. Not an app. Not a VM. A container job. A script that starts, runs for couple of minutes or hours, then finishes.

What is the best Amazon service to use for such task?

Most services are not aligned with the "run container job once" task. Lambda runs forever and does not run arbitrary container command lines. EC2 runs forever and AFAIK is a VM, not just container. Amazon Kubernetes requires cluster setup which takes a lot of time and is expensive.

With Google Cloud I can use Vertex AI CustomJob for such task: https://cloud.google.com/vertex-ai/docs/reference/rest/v1/CustomJobSpec#containerspec



Solution 1:[1]

I need docker run <container_image> program.py arg1 arg2 arg3, but on AWS cloud. Not a service. Not an app. Not a VM. A container job. A script that starts, runs for couple of minutes or hours, then finishes.

Given your description, to do this on AWS cloud the easiest way is Lightsail Containers. Simply run your container and give you the log.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 gohm'c