-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathleader-task-group.hcl
94 lines (73 loc) · 1.53 KB
/
leader-task-group.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
variable "datacenters" {
type = list(string)
default = ["dc1"]
}
variable "image" {
type = string
default = "ghcr.io/hyperbadger/nomad-pipeline:main"
}
variable "nomad_addr" {
type = string
default = "http://host.docker.internal:4646"
}
variable "docker_extra_hosts" {
type = list(string)
default = ["host.docker.internal:host-gateway"]
}
job "leader-task-group" {
name = "leader-task-group"
datacenters = var.datacenters
type = "batch"
meta = {
"nomad-pipeline.enabled" = "true"
}
group "▶️" {
task "init" {
driver = "docker"
config {
image = var.image
args = ["agent", "init"]
extra_hosts = var.docker_extra_hosts
auth_soft_fail = true
}
env {
NOMAD_ADDR = var.nomad_addr
NOMAD_PIPELINE_DEBUG = "true"
}
}
}
group "leader" {
count = 0
meta = {
"nomad-pipeline.root" = "true"
"nomad-pipeline.leader" = "true"
}
task "some-process" {
driver = "raw_exec"
config {
command = "/bin/bash"
args = ["local/main.sh"]
}
template {
data = <<-EOT
#!/bin/bash
sleep 5
EOT
destination = "local/main.sh"
}
}
}
group "some-long-running-process" {
count = 0
meta = {
"nomad-pipeline.root" = "true"
}
task "forever-run" {
driver = "raw_exec"
config {
command = "/bin/tail"
args = ["-f", "/dev/null"]
}
}
}
}