Nomad: Scheduling job with a dependency on another job

Created on 8 Dec 2015  路  7Comments  路  Source: hashicorp/nomad

Is it possible to schedule a job only after another job is successful scheduled? A use case for example, would be to use one docker container to provide a REST API (https://github.com/begriffs/postgrest) for another docker container (postgres), but the REST API docker container should only come up once the database container is up and passed it's health check.

themcore themscheduling typenhancement

Most helpful comment

I believe this should be re-opened.

Here's a use-case: I want to run hashicorp vault and docker-registry from within nomad. The other containers will need these to be available before they can start, but #419 argues for pushing all my apps into a single job.

Granted, this is less obvious for vault, but our private registry is foundational for everything.

All 7 comments

Hey! Nomad currently does not have a way to express job dependencies but it is something on our roadmap. From your description it sounds like you need dependencies between tasks/task groups not jobs. A job would only be finished once all the task groups are dead. If you look at issue #419 I think it captures this issue, so I am going to mark as closed.

I believe this should be re-opened.

Here's a use-case: I want to run hashicorp vault and docker-registry from within nomad. The other containers will need these to be available before they can start, but #419 argues for pushing all my apps into a single job.

Granted, this is less obvious for vault, but our private registry is foundational for everything.

Any news?

Similar use case here. We would like to be sure that things like our OAuth service, auditing service, etc.. are started and listed as dependencies before other backend applications start.

Different use case here!

I'd like to have some control around precendence order in which my networking, services, and templates fire off. The suggestion of job-dependencies is limiting, unless there's some funky n-pass evaluation stuff, and execution in the same container.

My use case provisions container environment variables and config files based on the services running and registered with consul. Without a strict happens-before ordering, i get a non-deterministic template.

See #419 for the same kind of issue.

It's quite obvious feature for the orchestrator, and at the moment, it's one of the most desired functionality for us.
I still hope it would be implemented in Nomad.

Was this page helpful?
0 / 5 - 0 ratings