github.com/ferranbt/nomad@v0.9.3-0.20190607002617-85c449b7667c/jobspec/test-fixtures/basic.hcl (about) 1 job "binstore-storagelocker" { 2 region = "fooregion" 3 namespace = "foonamespace" 4 type = "batch" 5 priority = 52 6 all_at_once = true 7 datacenters = ["us2", "eu1"] 8 vault_token = "foo" 9 10 meta { 11 foo = "bar" 12 } 13 14 constraint { 15 attribute = "kernel.os" 16 value = "windows" 17 } 18 19 affinity { 20 attribute = "${meta.team}" 21 value = "mobile" 22 operator = "=" 23 weight = 50 24 } 25 26 spread { 27 attribute = "${meta.rack}" 28 weight = 100 29 target "r1" { 30 percent = 40 31 } 32 target "r2" { 33 percent = 60 34 } 35 } 36 37 update { 38 stagger = "60s" 39 max_parallel = 2 40 health_check = "manual" 41 min_healthy_time = "10s" 42 healthy_deadline = "10m" 43 progress_deadline = "10m" 44 auto_revert = true 45 auto_promote = true 46 canary = 1 47 } 48 49 task "outside" { 50 driver = "java" 51 52 config { 53 jar_path = "s3://my-cool-store/foo.jar" 54 } 55 56 meta { 57 my-cool-key = "foobar" 58 } 59 } 60 61 group "binsl" { 62 count = 5 63 64 restart { 65 attempts = 5 66 interval = "10m" 67 delay = "15s" 68 mode = "delay" 69 } 70 71 reschedule { 72 attempts = 5 73 interval = "12h" 74 } 75 76 ephemeral_disk { 77 sticky = true 78 size = 150 79 } 80 81 update { 82 max_parallel = 3 83 health_check = "checks" 84 min_healthy_time = "1s" 85 healthy_deadline = "1m" 86 progress_deadline = "1m" 87 auto_revert = false 88 auto_promote = false 89 canary = 2 90 } 91 92 migrate { 93 max_parallel = 2 94 health_check = "task_states" 95 min_healthy_time = "11s" 96 healthy_deadline = "11m" 97 } 98 99 affinity { 100 attribute = "${node.datacenter}" 101 value = "dc2" 102 operator = "=" 103 weight = 100 104 } 105 106 spread { 107 attribute = "${node.datacenter}" 108 weight = 50 109 target "dc1" { 110 percent = 50 111 } 112 target "dc2" { 113 percent = 25 114 } 115 target "dc3" { 116 percent = 25 117 } 118 } 119 120 121 task "binstore" { 122 driver = "docker" 123 user = "bob" 124 leader = true 125 126 affinity { 127 attribute = "${meta.foo}" 128 value = "a,b,c" 129 operator = "set_contains" 130 weight = 25 131 } 132 133 config { 134 image = "hashicorp/binstore" 135 136 labels { 137 FOO = "bar" 138 } 139 } 140 141 logs { 142 max_files = 14 143 max_file_size = 101 144 } 145 146 env { 147 HELLO = "world" 148 LOREM = "ipsum" 149 } 150 151 service { 152 tags = ["foo", "bar"] 153 canary_tags = ["canary", "bam"] 154 port = "http" 155 156 check { 157 name = "check-name" 158 type = "tcp" 159 interval = "10s" 160 timeout = "2s" 161 port = "admin" 162 grpc_service = "foo.Bar" 163 grpc_use_tls = true 164 165 check_restart { 166 limit = 3 167 grace = "10s" 168 ignore_warnings = true 169 } 170 } 171 } 172 173 resources { 174 cpu = 500 175 memory = 128 176 177 network { 178 mbits = "100" 179 180 port "one" { 181 static = 1 182 } 183 184 port "two" { 185 static = 2 186 } 187 188 port "three" { 189 static = 3 190 } 191 192 port "http" { 193 } 194 195 port "https" { 196 } 197 198 port "admin" { 199 } 200 } 201 202 device "nvidia/gpu" { 203 count = 10 204 constraint { 205 attribute = "${device.attr.memory}" 206 value = "2GB" 207 operator = ">" 208 } 209 210 affinity { 211 attribute = "${device.model}" 212 value = "1080ti" 213 weight = 50 214 } 215 } 216 217 device "intel/gpu" {} 218 } 219 220 kill_timeout = "22s" 221 222 shutdown_delay = "11s" 223 224 artifact { 225 source = "http://foo.com/artifact" 226 227 options { 228 checksum = "md5:b8a4f3f72ecab0510a6a31e997461c5f" 229 } 230 } 231 232 artifact { 233 source = "http://bar.com/artifact" 234 destination = "test/foo/" 235 mode = "file" 236 237 options { 238 checksum = "md5:ff1cc0d3432dad54d607c1505fb7245c" 239 } 240 } 241 242 vault { 243 policies = ["foo", "bar"] 244 } 245 246 template { 247 source = "foo" 248 destination = "foo" 249 change_mode = "foo" 250 change_signal = "foo" 251 splay = "10s" 252 env = true 253 vault_grace = "33s" 254 } 255 256 template { 257 source = "bar" 258 destination = "bar" 259 perms = "777" 260 left_delimiter = "--" 261 right_delimiter = "__" 262 } 263 } 264 265 task "storagelocker" { 266 driver = "docker" 267 268 config { 269 image = "hashicorp/storagelocker" 270 } 271 272 resources { 273 cpu = 500 274 memory = 128 275 } 276 277 constraint { 278 attribute = "kernel.arch" 279 value = "amd64" 280 } 281 282 vault { 283 policies = ["foo", "bar"] 284 env = false 285 change_mode = "signal" 286 change_signal = "SIGUSR1" 287 } 288 } 289 290 constraint { 291 attribute = "kernel.os" 292 value = "linux" 293 } 294 295 meta { 296 elb_mode = "tcp" 297 elb_interval = 10 298 elb_checks = 3 299 } 300 } 301 }