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

Add support for -wait / quiescence in template{} stanza #1899

Closed
jippi opened this issue Oct 31, 2016 · 6 comments
Closed

Add support for -wait / quiescence in template{} stanza #1899

jippi opened this issue Oct 31, 2016 · 6 comments
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/template type/enhancement

Comments

@jippi
Copy link
Contributor

jippi commented Oct 31, 2016

Quiescence made a huge difference for us (bownty) when running CT, since our clusters are periodically very busy (5-10s) and then idle for hours and hours, saving us a lot of reloads of nginx

@jippi jippi changed the title Add support for wait / quiescence in template{} stanza Add support for -wait / quiescence in template{} stanza Oct 31, 2016
@dadgar dadgar added this to the v0.5.1 milestone Nov 8, 2016
@lawliet89
Copy link

This issue is a little dated but I would like to chime in on this with my use case. I am currently using Vault to issue my jobs AWS credentials to write to S3. Since IAM is eventually consistent, there is a short period of time (probably < 10s) between Vault's creation of the IAM user and when the Nomad job is able to access AWS APIs with the credentials. Currently, our job is able to restart itself internally (without Nomad noticing) until the access succeeds. But it would be useful if we can configure the quiescence time.

I realise this is like #3866 wrt exposing more of Consul Template options. Probably requires some form of plugins interface that @preetapan mentioned.

@urjitbhatia
Copy link

This seems to be an old open issue but I am also running against this. We are trying to get membership information from Consul and when we do a big deployment, our listener service gets inundated with lots of reload signals in a very short time.

Any pointers on this?

@DhashS
Copy link

DhashS commented Apr 15, 2019

Quiescence solves a massive issue with determinism for me.
Currently, to expose the ZOOKEEPER_SERVERS environment variable to all (other) zookeeper containers, I have the following script.

{{ range $tag, $services := service "daemons-kafka-zookeeper|any" | byTag }}
{{ range $i, $services := service "daemons-kafka-zookeeper|any" }}
{{ end }}
{{ if $tag | contains "client" }}
{{ range $services }}
{{ scratch.MapSet .Address "client" .Port }}
{{ scratch.MapSet .Address "done" "false" }}
{{ end }}
{{ else }}
{{ if $tag | contains "follower" }}
{{ range $services }}
{{ scratch.MapSet .Address "follower" .Port }}
{{ scratch.MapSet .Address "done" "false" }}
{{ end }}
{{ else }}
{{ if $tag | contains "othersrvs" }}
{{ range $services }}
{{ scratch.MapSet .Address "othersrvs" .Port }}
{{ scratch.MapSet .Address "done" "false" }}
{{ end }}
{{ else }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ scratch.Set "index" 1 }}
{{ scratch.Set "ZOO_SERVERS" "" }}
{{ range $i, $services := service "daemons-kafka-zookeeper|any" }}
{{ if ($services.Tags | contains "zookeeper-quorum") }}
{{ $addr := (scratch.Get .Address)}}
{{ if not (index $addr "done" | parseBool) }}
{{ $mynode := "temp" }}
{{ with node }}
{{ if eq $services.Node .Node.Node }}
{{ scratch.Set "ZOO_SERVERS" (print (scratch.Get "ZOO_SERVERS") "server." (scratch.Get "index") "=" $services.Address ":2888:3888;2181 " )}} <- this $services.Address may be 0.0.0.0
{{ scratch.Set "ZOO_MY_ID" (scratch.Get "index") }}
{{ else }}
{{ scratch.Set "ZOO_SERVERS" (print (scratch.Get "ZOO_SERVERS") "server." (scratch.Get "index") "=" $services.Address ":" (index $addr "follower") ":" ( index $addr "othersrvs") ";" (index $addr "client") " " )}}
{{ end }}
{{ scratch.MapSet $services.Address "done" "true"}}
{{ scratch.Set "index" (scratch.Get "index" | add 1 ) }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
ZOO_SERVERS="{{ or (scratch.Get "ZOO_SERVERS") (print "server." (env "NOMAD_ALLOC_INDEX") "=0.0.0.0:2888:3888;2181") }}"
ZOO_MY_ID={{or (scratch.Get "ZOO_MY_ID") (env "NOMAD_ALLOC_INDEX") }}
ZOO_PORT=2181

where the services can declare their ports via the tags on the service stanza in nomad.

However, the template thrashes when I launch it! It appears that there's no strict precedence order of templating and service registration. This can be solved by waiting for consensus among the template, or by giving a way for a template stanza to depend on another stanza starting first.

I saw some new task precedence stuff in the changelog for 0.9.0, so i'm going to be trying that out tonight

@cgbaker
Copy link
Contributor

cgbaker commented Apr 15, 2019

Just an update, this is on our roadmap for an upcoming release. We understand how useful this is.

@tgross tgross modified the milestones: near-term, unscheduled Jan 9, 2020
@tgross tgross added the stage/accepted Confirmed, and intend to work on. No timeline committment though. label Aug 24, 2020
@tgross tgross added this to Needs Roadmapping in Nomad - Community Issues Triage Feb 12, 2021
@tgross tgross removed this from the unscheduled milestone Feb 12, 2021
@tgross tgross removed this from Needs Roadmapping in Nomad - Community Issues Triage Mar 4, 2021
@mikenomitch
Copy link
Contributor

mikenomitch commented Feb 22, 2022

I believe this was closed out in 1.2.4 by this PR. Appreciate everybody's patience on this!

@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 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/template type/enhancement
Projects
None yet
Development

No branches or pull requests

8 participants