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

Provide 'restart' section per task in addition to the group #2187

Closed
shantanugadgil opened this issue Jan 12, 2017 · 9 comments
Closed

Provide 'restart' section per task in addition to the group #2187

shantanugadgil opened this issue Jan 12, 2017 · 9 comments

Comments

@shantanugadgil
Copy link
Contributor

If you have a question, prepend your issue with [question] or preferably use the nomad mailing list.

If filing a bug please include the following:

Nomad version

Output from nomad version
$ nomad -v
Nomad v0.5.2

Operating system and Environment details

Ubuntu 16.04 Server
Debian/Ubuntu Clients

Issue

Would it be possible to give restart capabilities for a single task versus for the entire group?

Use Case

  1. task1 gets some info (which need not be run again)
  2. try task2 based on output of task1.
    If task2 fails only retry task2

Wondering if the above is possible?
From: https://www.nomadproject.io/docs/job-specification/restart.html
it seems "restart" is per group and not task.

Regards,
Shantanu Gadgil

@jippi
Copy link
Contributor

jippi commented Jan 12, 2017

Seems relevant to #2181

@shantanugadgil
Copy link
Contributor Author

Duplicate of #2181

@shantanugadgil
Copy link
Contributor Author

Sorry, I think I was a bit hasty in closing this. #2181 seems to be specific to the Docker driver.
I think, I'll re-open this.

@dadgar
Copy link
Contributor

dadgar commented Jan 13, 2017

@shantanugadgil Is this more in line with what you are asking: #419

Using restarts to accomplish it seems like a hack

@shantanugadgil
Copy link
Contributor Author

I'll explain my need for a restart of a single task.
I have solved it another way for now.

My scenario is that I am using Proxmox VE.
Proxmox VE has a command to get the "next" free VMID to be used for VM allocations.
(VMs have to be created using VMID)

In my above scenario, what I was thinking was:
task1: get the "next free" VMID from the system (with restarts, say 5 times)
fail the group if task 1 fails
task2: using the VMID try to create the VM from a VM template file. (no retry for this task)

The way I have solved this for now is just put the entire work of trying to get the "next" id and creating the VM in one script and execute that as a single task.

@dadgar
Copy link
Contributor

dadgar commented Jan 13, 2017

Not disagreeing with the need for per task but it seems like that use case could be solved by prestart scripts or task dependencies in a more elegant way

@shantanugadgil
Copy link
Contributor Author

OK. I am new to Nomad and have been heavily experimenting with it for the past couple of weeks only.
Please feel free to close this if necessary.

@tgross tgross added the stage/needs-verification Issue needs verifying it still exists label Mar 4, 2021
@tgross
Copy link
Member

tgross commented Mar 8, 2021

Doing a bit of issue cleanup and I think I'm going to close this one out: it's covered by combination of the task lifecycle hooks and the nomad alloc stop :task command.

@tgross tgross closed this as completed Mar 8, 2021
@tgross tgross removed the stage/needs-verification Issue needs verifying it still exists label Mar 8, 2021
@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 Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants