Is there a way to set up hours on AWS Batch stands?

Is there a way to set the maximum runtime for AWS batch jobs (or queues)? This is the standard setting for most batch managers, which helps to avoid loss of resources when work freezes for any reason.

+5
source share
4 answers

AFAIK there is no way for this. However, a workaround was suggested in the forum for a similar issue.

One idea is to call Batch as Activity from Step Functions, pingback back on schedule (for example, every minute) from this job. If he stops responding, then you can detect this situation as a timeout in the activity and act accordingly (stop the work, etc.). Not ideal (especially if the work continues to bounce back like a “zombie”), but this is the beginning. You probably also have to store activity tokens in the databases to track them to the batch job ID.

In addition, you divide this setting into 2 steps and plan the batch job from Lambda in the first state, then pass the batch job identifier to the second stage, which then polls the batch (from another lambda) for its state at repeated and interval intervals (for example, once every minute or even with an exponential deviation) and MaxAttempts calculated based on your timeout. Thus, you do not need an external state storage mechanism, a lengthy poll, or even a "bounce back" from work (it MAY be a zombie), but the disadvantage is more steps.

+2
source

There is no option to set the timeout in a batch job, but you can set up a lambda function that runs every 1 hour or so, and deletes jobs created before say 24 hours .

+1
source

has been working with aws for some time and cannot find a way to set the maximum runtime for batch jobs. However, there is an alternative way that you could use. AWS Forum

+1
source

Unfortunately, there is no way to set a limit execution time on AWS Batch. One solution might be to edit the docker entry point to schedule a run-time limit.

+1
source

Source: https://habr.com/ru/post/1273521/


All Articles