Commit Graph

135 Commits

Author SHA1 Message Date
Michael Schurter
95b3b6eb02 drain: initial drainv2 structs and impl 2018-03-21 16:49:48 -07:00
Preetha Appan
a896b2edf2 Addressed code review feedback 2018-03-21 09:15:29 -05:00
Preetha Appan
5e038e4106 Show reschedule policy in addition to when the eval will get rescheduled 2018-03-20 13:34:29 -05:00
Preetha Appan
f82c100dfc Fix linting 2018-03-19 12:46:55 -05:00
Preetha Appan
e5b86d405e Fix incorrect initialization of reschedule policy for system jobs. 2018-03-19 12:16:13 -05:00
Preetha Appan
d4056c4489 Rename DelayCeiling to MaxDelay 2018-03-14 16:10:32 -05:00
Preetha Appan
e65d870fe9 Add new reschedule options to API layer and unit tests 2018-03-14 16:10:32 -05:00
Josh Soref
4c96d1bb90 spelling: canonicalize 2018-03-11 17:46:20 +00:00
Preetha Appan
15186170b4 Reuse default policy structs in api, and other code review feedback 2018-01-31 16:33:00 -06:00
Preetha Appan
89a467aaaf Remove unused method 2018-01-31 09:58:05 -06:00
Preetha Appan
162f75e834 Address code review comments 2018-01-31 09:58:05 -06:00
Preetha Appan
eab9d2da92 Add reschedule policy to API, and HCL parsing support. 2018-01-31 09:56:53 -06:00
Michael Schurter
9b9a4af182 Invert and test CheckRestart merge logic 2018-01-09 15:17:07 -08:00
Michael Schurter
304a037e39 Fix service.check_restart stanza propagation
There was a bug in jobspec parsing, a bug in CheckRestart merging, and a
bug in CheckRestart canonicalization. All are now tested.
2018-01-09 15:15:36 -08:00
Michael Schurter
25569282b9 Allow custom ports for services and checks
Fixes #3380

Adds address_mode to checks (but no auto) and allows services and checks
to set literal port numbers when using address_mode=driver.

This allows SDNs, overlays, etc to advertise internal and host addresses
as well as do checks against either.
2017-12-08 12:03:00 -08:00
Chelsea Holland Komlo
20d1a3b54d fix up test fixture to properly parse 2017-12-06 16:23:55 -05:00
Chelsea Holland Komlo
9e49836d4f move kill_signal to task level, extend to docker 2017-12-06 14:36:39 -05:00
Preetha Appan
4e307587f0 Fixes bug with display message logic due to deprecating GenericSource. Also added more test cases to cover a bunch more edge cases 2017-11-13 11:14:57 -06:00
Charlie Voiselle
892f34896b Simplified based on review comments 2017-11-09 20:09:37 -05:00
Charlie Voiselle
20ea6b25dc Adopted pattern from LogConfig to handle panic when no resource stanza at all
In testing realized that Resources night not be present at all.  Testing this case caused panic. Added in a means to collect clean defaults in that case.
2017-11-09 10:57:57 -05:00
Charlie Voiselle
1cb52865bc Canonicalize task and remove merge with MinResources
The current code would merge the job with the output of MinResources causing the nil to be replaced with MemoryMB=helper.IntToPtr(10).  When later `Canonicalize`d, the 10 would cause the default of 300 not to be applied. Running `Canonicalize` on the task itself guarantees that CPU, MemoryMB, and IOPS is set, so we can remove the Merge withMinResources.
2017-11-09 10:10:11 -05:00
Preetha Appan
48f90089d5 Fix formatting 2017-11-03 12:48:55 -05:00
Preetha Appan
aa253b07ab Adds deprecation notice to API struct definition. 2017-11-03 10:12:37 -05:00
Preetha Appan
d63e693679 Move logic for determinic event display message to task_runner, added two new fields DisplayMessage and Details. 2017-11-03 09:13:01 -05:00
Alex Dadgar
61bcfff20a Change vault_grace default to match vaults 2017-10-11 17:20:12 -07:00
Michael Schurter
b381b5fff7 grace_period -> grace 2017-09-26 10:21:35 -07:00
Michael Schurter
80147622c5 Add comments 2017-09-15 14:34:36 -07:00
Michael Schurter
092057a32b Canonicalize and Merge CheckRestart in api 2017-09-14 16:48:39 -07:00
Michael Schurter
78c72f8725 Default grace period to 1s 2017-09-14 16:46:54 -07:00
Michael Schurter
555d1e24dc on_warning=false -> ignore_warnings=false
Treat warnings as unhealthy by default
2017-09-14 16:46:54 -07:00
Michael Schurter
bd1a342a92 Nest restart fields in CheckRestart 2017-09-14 16:46:54 -07:00
Michael Schurter
a720bb5a91 Add restart fields 2017-09-14 16:46:54 -07:00
Alex Dadgar
6723bade37 Don't merge empty update from job into task groups
This PR fixes an issue in which we would merge an update stanza from the
job into the task groups even if it was empty. This broke round
tripping a job (reading from the api and resubmitting as JSON)

Fixes https://github.com/hashicorp/nomad/issues/3132
2017-08-30 11:35:19 -07:00
Michael Schurter
947516405a Add Header and Method support for HTTP checks 2017-08-17 16:44:21 -07:00
Michael Schurter
beae45bad5 Add optional shutdown delay to tasks
Fixes #2441

Defaults to 0 (no delay) for backward compat and because this feature
should be opt-in.
2017-08-16 17:59:46 -07:00
Alex Dadgar
43d2c425d1 Emit generic task events 2017-08-07 21:26:04 -07:00
Alex Dadgar
053cff812a Allow template to set Vault grace
This PR allows a template to specify the Vault grace duration.

Fixes https://github.com/hashicorp/nomad/issues/2922
2017-08-01 14:14:08 -07:00
Alex Dadgar
27048bb7fa events 2017-07-07 12:12:48 -07:00
Alex Dadgar
e1c631064a @jippi Changed my mind! Good suggestion 2017-07-07 12:12:48 -07:00
Alex Dadgar
da82a6e814 initial watcher 2017-07-07 12:07:08 -07:00
Michael Schurter
450e347708 Add support for go-getter modes
Fixes #2678
2017-07-06 10:45:44 -07:00
Michael Schurter
3f37be369d Move caonicalization from nomad/structs/ to api/ 2017-06-21 17:19:08 -07:00
Michael Schurter
3fddb05fc8 Implement DriverNetwork and Service.AddressMode
Ideally DriverNetwork would be fully populated in Driver.Prestart, but
Docker doesn't assign the container's IP until you start the container.

However, it's important to setup the port env vars before calling
Driver.Start, so Prestart should populate that.
2017-06-21 17:19:08 -07:00
Michael Schurter
7dac668adf Functional consul template env file support 2017-05-23 13:45:14 -07:00
Alex Dadgar
d606e98a6e New update block; still need to handle the upgrade path 2017-05-08 17:44:26 -07:00
Michael Schurter
7c67166510 Add TLSSkipVerify support to api and parser 2017-04-19 12:45:34 -07:00
Alex Dadgar
d212f6fe94 Track task start/finish time & improve logs errors
This PR adds tracking to when a task starts and finishes and the logs
API takes advantage of this and returns better errors when asking for
logs that do not exist.
2017-03-31 16:14:11 -07:00
Alex Dadgar
8b1359c2d0 Fix canonicalization of services 2017-03-01 15:30:01 -08:00
Michael Schurter
fe4537e1f3 Add Canonicalize test mimicing example job + template 2017-02-24 12:08:31 -08:00
Michael Schurter
d1794c1714 Missed initializing another field in Template! 2017-02-24 10:47:50 -08:00