Commit Graph

362 Commits

Author SHA1 Message Date
Alex Dadgar
a9e3a41407 Enable more linters 2017-09-26 15:26:33 -07:00
Alex Dadgar
04d86ffd10 Fix batch handling of complete allocs/node drains
This PR fixes:
* An issue in which a node-drain that contains a complete batch alloc
would cause a replacement
* An issue in which allocations with the same name during a scale
down/stop event wouldn't be properly stopped.
* An issue in which batch allocations from previous job versions may not
have been stopped properly.

Fixes https://github.com/hashicorp/nomad/issues/3210
2017-09-14 15:08:57 -07:00
Alex Dadgar
ac1539d5d9 Sync namespace changes 2017-09-07 17:04:21 -07:00
Alex Dadgar
b6ed801ce0 fix test 2017-08-21 14:07:54 -07:00
Alex Dadgar
1f54b68223 Placing allocs counts towards placement limit
This PR makes placing new allocations count towards the limit. We do not
restrict how many new placements are made by the limit but we still
count towards the limit. This has the nice affect that if you have a
group with count = 5 and max_parallel = 1 but only 3 allocs exist for it
and a change is made, you will create 2 more at the new version but not
destroy one, taking you down to two running as you would have
previously.

Fixes https://github.com/hashicorp/nomad/issues/3053
2017-08-21 12:41:19 -07:00
Alex Dadgar
aabf2c0334 fixes 2017-08-15 12:27:05 -07:00
Alex Dadgar
7e6b14cf5d Fix panic occuring from improper bitmap size
This PR fixes an allignment calculation when determining the bitmap
size.

Fixes https://github.com/hashicorp/nomad/issues/3008
2017-08-12 15:37:02 -07:00
Luke Farnell
7a56971508 fixed all spelling mistakes for goreport 2017-08-07 17:13:05 -04:00
Alex Dadgar
66c59b064d Lost allocs replaced even if deployment failed
This PR allows the scheduler to replace lost allocations even if the job
has a failed or paused deployment. The prior behavior was confusing to
users.

Fixes https://github.com/hashicorp/nomad/issues/2958
2017-08-03 17:42:14 -07:00
Alex Dadgar
5a5e043b75 Review fixes 2017-08-01 14:18:52 -07:00
Alex Dadgar
4e71ba2e71 Distinct Property supports arbitrary limit
This PR enhances the distinct_property constraint such that a limit can
be specified in the RTarget/value parameter. This allows constraints
such as:

```
constraint {
  distinct_property = "${meta.rack}"
  value = "2"
}
```

This restricts any given rack from running more than 2 allocations from
the task group.

Fixes https://github.com/hashicorp/nomad/issues/1146
2017-07-31 16:52:13 -07:00
Alex Dadgar
dd4befbec2 Fix incorrect destructive update with distinct_property constraint
This PR fixes an issue in which an update to a task group with a
distinct property constraint would result in an incorrect destructive
update.
2017-07-31 11:17:35 -07:00
Michael Schurter
55bd0c8df7 Use go-testing-interface instead of testing
This drops the testings stdlib pkg from our dependencies. Saves a
whopping 46kb on our binary (was really hoping for more of a win there),
but also avoids potential ugliness with how testing sets flags.
2017-07-25 15:35:19 -07:00
Alex Dadgar
78e246eab5 Improve multiple group handling in a deployment
This PR resolves a bug in which a job with multiple task groups would
create new deployment objects each, thus clearing out all other task
groups deployment state.
2017-07-25 11:27:47 -07:00
Alex Dadgar
c8d763406f Better comment 2017-07-20 12:31:08 -07:00
Alex Dadgar
95fa06a356 Handle destructive changes before placements
This PR updates the generic scheduler to handle destructive changes
before handling placements. This is important because the destructive
change may be due to a lowering of resources. If this is the case, the
handling of the destructive changes first may make it possible for the
placement to happen.

To reason about this imagine there is one node with CPU = 500.

If the group originally had:
* `count = 1`
* `cpu = 400`

And then the job was updated such that the group had:
* `count = 4`
* `cpu = 120`

If the original alloc isn't discounted first, nothing would be able to
place.
2017-07-20 12:24:27 -07:00
Alex Dadgar
6a59fbd44a Update full node test to test more advanced case 2017-07-20 12:23:40 -07:00
Alex Dadgar
d507d5bf20 Fix update limit calculation to avoid panic
This PR fixes the rolling update limit calculation to avoid a panic when
there are more allocations for a deployment that haven't determined
their health than the max_parallel count of the task group.

Fixes https://github.com/hashicorp/nomad/issues/2820
2017-07-19 11:11:47 -07:00
Alex Dadgar
698c964c88 Fix deep copy of driver config 2017-07-17 17:53:21 -07:00
Alex Dadgar
83fb59969d Stop before trying to place 2017-07-17 17:18:12 -07:00
Alex Dadgar
d457735b2f Treat destructive updates atomically 2017-07-16 10:35:38 -07:00
Alex Dadgar
5001fafd09 Basic logs 2017-07-07 16:49:08 -07:00
Alex Dadgar
0129455876 Rolling node drains using max_parallel and stagger
This PR adds rolling node drains done at max_parallel and stagger of the
update spec. It brings it inline with old behavior.
2017-07-07 12:12:48 -07:00
Alex Dadgar
9eb2c8f848 Status description shows requiring promotion 2017-07-07 12:12:48 -07:00
Alex Dadgar
fe990ca3e0 Fix some tests, eval monitor shows deployment id and deployment cancels based on version 2017-07-07 12:12:48 -07:00
Alex Dadgar
b3ec146685 Respond to comments 2017-07-07 12:10:04 -07:00
Alex Dadgar
989aa56304 Remove canary 2017-07-07 12:10:04 -07:00
Alex Dadgar
127d43db88 Test scheduler's handling of canaries/inplace updates 2017-07-07 12:10:04 -07:00
Alex Dadgar
463d20e4f3 Test marking as complete 2017-07-07 12:10:04 -07:00
Alex Dadgar
690fc78091 Plan apply handles canaries and success is set via update 2017-07-07 12:10:04 -07:00
Alex Dadgar
598748d6d5 Fix handling of failed job 2017-07-07 12:10:04 -07:00
Alex Dadgar
29e31af007 Attach eval id 2017-07-07 12:10:04 -07:00
Alex Dadgar
0c6a1c0ee8 Mark complete 2017-07-07 12:10:04 -07:00
Alex Dadgar
71c7c45cf6 Change canary handling 2017-07-07 12:10:04 -07:00
Alex Dadgar
e5b1e3171c Remove promoted bit from allocation 2017-07-07 12:10:04 -07:00
Alex Dadgar
591ef9c9f3 Rename CreateDeployments and remove cancelling behavior in state_store 2017-07-07 12:10:04 -07:00
Alex Dadgar
f72bbaa370 Client watches for allocation health using task state and Consul checks
This PR adds watching of allocation health at the client. The client can
watch for health based on the tasks running on time and also based on
the consul checks passing.
2017-07-07 12:10:04 -07:00
Alex Dadgar
bab25f6834 deployment status 2017-07-07 12:07:07 -07:00
Alex Dadgar
53f4952c56 initial impl 2017-07-07 12:03:11 -07:00
Alex Dadgar
0ec6d74338 update description of the alloc update factory function 2017-07-07 12:03:11 -07:00
Alex Dadgar
0d29972c8c cleanup limit detection 2017-07-07 12:03:11 -07:00
Alex Dadgar
af7f93b56b Fix canary handling 2017-07-07 12:03:11 -07:00
Alex Dadgar
369a04b135 Deployment tests 2017-07-07 12:03:11 -07:00
Alex Dadgar
f32a9a5539 Non-Canary/Deployment Tests 2017-07-07 12:03:11 -07:00
Alex Dadgar
d72b270a51 Pull out in-place updating into a passed in function; reduce inputs to reconciler 2017-07-07 12:03:11 -07:00
Alex Dadgar
85e0d6fccd assign names 2017-07-07 12:03:11 -07:00
Alex Dadgar
1dabd206bb handle batch filtering 2017-07-07 12:03:11 -07:00
Alex Dadgar
4c9e5c34fa Remove old 2017-07-07 12:03:11 -07:00
Alex Dadgar
201ad8bf40 Populate desired state per tg 2017-07-07 12:03:11 -07:00
Alex Dadgar
66789e81f2 Show canaries on plan 2017-07-07 12:03:11 -07:00