Commit Graph

393 Commits

Author SHA1 Message Date
Preetha Appan
a952d4a72d Clarify comment 2018-02-05 16:37:07 -06:00
Preetha Appan
87d0523d55 Reconciler should consider failed allocs when marking deployment as failed. 2018-02-02 19:40:25 -06:00
Preetha Appan
d09bad7909 code review feedback 2018-01-31 09:58:05 -06:00
Preetha Appan
7917c908b4 Add a field to track the next allocation during a replacement 2018-01-31 09:58:05 -06:00
Preetha Appan
765679f7c9 Track previous node id correctly, plus unit test 2018-01-31 09:58:05 -06:00
Preetha Appan
a2cdb5d6c0 Add more clarification in comment 2018-01-31 09:58:05 -06:00
Preetha Appan
0e5d18bb8c Preallocate slice for skipped nodes 2018-01-31 09:58:05 -06:00
Preetha Appan
8d1395ea16 Better score threshold 2018-01-31 09:58:05 -06:00
Preetha Appan
ed77599afc Add one more unit test 2018-01-31 09:58:05 -06:00
Preetha Appan
3429dfa716 Limit iterator uses a score threshold and a maxSkip value to be able to skip lower scoring nodes 2018-01-31 09:58:05 -06:00
Preetha Appan
aa1af00fbd Beef up unit test for rescheduling batch jobs 2018-01-31 09:56:53 -06:00
Preetha Appan
a49ad471f9 Address more code review feedback 2018-01-31 09:56:53 -06:00
Preetha Appan
c5f81b426f Make sure that reschedule trackers are not added for node drain replacements 2018-01-31 09:56:53 -06:00
Preetha Appan
0b6846873b Improve reconciler unit tests 2018-01-31 09:56:53 -06:00
Preetha Appan
4cbef07d37 Prevent side effect modification of select options when preferred nodes are set 2018-01-31 09:56:53 -06:00
Preetha Appan
c6c0741bd8 Add helper methods, use require and other code review feedback 2018-01-31 09:56:53 -06:00
Preetha Appan
d96873c827 Reconile with changes to structs for reschedule tracking 2018-01-31 09:56:53 -06:00
Preetha Appan
cc54e11802 Fix some comments and lint warnings, remove unused method 2018-01-31 09:56:53 -06:00
Preetha Appan
5ecb7895bb Reschedule previous allocs and track their reschedule attempts 2018-01-31 09:56:53 -06:00
Preetha Appan
64e9cf9733 Add a field to track the next allocation during a replacement 2018-01-24 17:55:05 -06:00
Alex Dadgar
73303b4b44 gofmt 2018-01-04 14:45:15 -08:00
Alex Dadgar
28aa6e1acd Fix detection of successful batch allocations
This PR restores older behavior of detecting successful batch
allocations (04d86ffd10). This has the
side effect that we correctly filter desired status stop but not
successful batch allocations and create their replacements.
2018-01-04 14:20:32 -08:00
Preetha
781408bbf4 Merge branch 'master' into 0.8 2018-01-03 16:06:38 -06:00
Preetha Appan
aa35b5b9f2 Return an error if evaluation doesn't exist in state store at plan apply time. 2017-12-18 14:55:36 -06:00
Preetha Appan
f12255e886 Update eval modify index as part of plan apply. 2017-12-18 10:03:55 -06:00
Preetha Appan
ef1a2e94f7 Fix some typos 2017-12-14 13:29:27 -06:00
Michael Schurter
e857225129 Fix port labels on mock Alloc/Job/Node 2017-12-08 14:50:06 -08:00
Alex Dadgar
b97735d7b9 Merge pull request #3375 from hashicorp/b-batch
Allow batch jobs to be rerun if purged
2017-10-13 17:11:45 -07:00
Alex Dadgar
f6fbb36054 sync 2017-10-13 14:36:02 -07:00
Alex Dadgar
56ea031267 Allow batch jobs to be rerun if purged
This PR allows batch jobs to be rerun if they have been purged.
2017-10-13 12:40:37 -07:00
Michael Schurter
04b8f8e7fc Remove structs import from api
Goes a step further and removes structs import from api's tests as well
by moving GenerateUUID to its own package.
2017-09-29 10:36:08 -07:00
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