hashicorp / nomad

Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations.
https://www.nomadproject.io/
Other
14.88k stars 1.95k forks source link

[Feature Request] Parameterized Task Lifecycle Dependencies: `registration` #7521

Open bdrodes opened 4 years ago

bdrodes commented 4 years ago

I'm experimenting with the 0.11 beta: Nomad v0.11.0-beta1 (a7a7d1284f758e8c431ad4f251131f514da0066d)

Tasks with the prestart hook always execute before any tasks in the same job, but for parameterized batch jobs, I would prefer to have an init that executes once on registration of the parameterized job only, and not on every single dispatch. I was thinking a hook like this:

lifecycle {
        hook = "registration"
        sidecar = false
      }

Is this a hook capability that is in active development or could it be added as feature request for the lifecycle stanza?

notnoop commented 4 years ago

Thanks @bdrodes for providing your feedback. We aim to satisfy this need.

Though, we are considering another option there, namely by expressing dependencies between TaskGroups or Jobs. So registration job in your example would be a separate TaskGroup instead. We may need to do more research for the various use cases.