Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] How to set a timeout value for a batch job? #4423

Closed
lolieatcat opened this issue Jun 16, 2018 · 6 comments
Closed

[question] How to set a timeout value for a batch job? #4423

lolieatcat opened this issue Jun 16, 2018 · 6 comments

Comments

@lolieatcat
Copy link

How to set a timeout value for a batch job?

I want to limit the job max run time , how can I set the batch job's timeout value?

@shantanugadgil
Copy link
Contributor

For now, there is no way to do that directly in Nomad.

What the folks usually recommend is using timeout and minor scripting to achieve the same.

HTH,
Shantanu

@lolieatcat
Copy link
Author

@shantanugadgil How to use a timeout minor scripting? For example? Thank you!

@preetapan
Copy link
Contributor

@molin0000 We currently don't have support for killing batch jobs based on a timeout, like @shantanugadgil mentions.

To do this yourself you have two options:

  • Have the batch job stop and exit itself based on a timer
  • Monitor the batch job using nomad's allocation api and if it has been running longer than your timeout period, stop it using the API again

@dadgar
Copy link
Contributor

dadgar commented Jun 19, 2018

Closed in favor of #1782

@onlyjob
Copy link
Contributor

onlyjob commented Nov 7, 2019

Coreutils' timeout(1) command could be handy.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants