Nomad: Provide 'restart' section per task in addition to the group

Created on 12 Jan 2017  路  7Comments  路  Source: hashicorp/nomad

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

themjobspec typenhancement

Most helpful comment

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

All 7 comments

Seems relevant to #2181

Duplicate of #2181

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.

@shantanugadgil Is this more in line with what you are asking: https://github.com/hashicorp/nomad/issues/419

Using restarts to accomplish it seems like a hack

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.

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

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.

Was this page helpful?
0 / 5 - 0 ratings