Skip to content
Snippets Groups Projects
Commit a06a4c78 authored by Jan David Mol's avatar Jan David Mol
Browse files

Tune startup latency

parent 923504d3
No related branches found
No related tags found
1 merge request!1084Tune startup latency
......@@ -92,6 +92,36 @@ job "device-servers" {
}
}
task "wait-for-db" {
lifecycle {
hook = "prestart"
sidecar = false
}
driver = "docker"
config {
image = "[[.registry.astron.url]]/busybox:latest"
command = "sh"
args = ["-c", "while ! nc -z ${MYSQL_HOST} ${MYSQL_PORT}; do sleep 1; done"]
}
template {
wait {
min = "30s"
max = "300s"
}
error_on_missing_key = true
data = <<EOH
{{- range service "tangodb" }}
MYSQL_HOST = "{{ .Address }}"
MYSQL_PORT = "{{ .Port }}"
{{- end }}
EOH
destination = "local/env.txt"
env = true
}
}
task "device-[[ $name ]]" {
driver = "docker"
......
......@@ -3,6 +3,12 @@ job "jupyter" {
datacenters = ["stat"]
type = "service"
reschedule {
unlimited = true
delay = "60s"
delay_function = "constant"
}
group "jupyter-lab" {
count = 1
......
......@@ -3,6 +3,12 @@ job "landing-page" {
datacenters = ["stat"]
type = "service"
reschedule {
unlimited = true
delay = "60s"
delay_function = "constant"
}
group "web-server" {
count = 1
......
......@@ -7,6 +7,12 @@ job "log-scraping" {
type = "service"
[[ end ]]
reschedule {
unlimited = true
delay = "30s"
delay_function = "constant"
}
update {
min_healthy_time = "10s"
healthy_deadline = "5m"
......
......@@ -3,6 +3,12 @@ job "monitoring" {
datacenters = ["stat"]
type = "service"
reschedule {
unlimited = true
delay = "60s"
delay_function = "constant"
}
group "postgres" {
count = 1
......
......@@ -6,6 +6,7 @@ job "object-replication" {
cron = "*/5 * * * * *"
prohibit_overlap = true
}
group "batch" {
count = 1
......
......@@ -3,6 +3,12 @@ job "object-storage" {
datacenters = ["stat"]
type = "service"
reschedule {
unlimited = true
delay = "30s"
delay_function = "constant"
}
group "minio" {
count = 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment