Commit Graph

13154 Commits

Author SHA1 Message Date
Mahmood Ali
f9295631c4 Set clean config for mock driver
The default job here contains some exec task config (for setting
command and args) that aren't used for mock driver.  Now, the alloc
runner seems stricter about validating fields and errors on unexpected
fields.

Updating configs in tests so we can have an explicit task config
whenever driver is set explicitly.
2018-11-13 10:21:40 -05:00
Mahmood Ali
2357e886ce mark and skip failing consul failing tests 2018-11-13 10:21:40 -05:00
Mahmood Ali
73077e36fe Update Docker name parsing lookup
`ParseNamed` function changed in e9f3f2cfee
where became `ParsedNormalizedName` with extra checks.
2018-11-13 10:21:40 -05:00
Mahmood Ali
8ccb80bcea pull alpine image needed for test
The test requires the image to be present locally, so importing it as
part of setup.
2018-11-13 10:21:40 -05:00
Mahmood Ali
7049b43471 Adjust streaming duration
This test expects 11 repeats of the same message emitted at intervals of
200ms; so we need more than 2 seconds to adjust for time sleep
variations and the like.  So raising it to 3s here that should be
enough.
2018-11-13 10:21:40 -05:00
Mahmood Ali
416b5240f4 Handle time.Duration in mock
Mock driver config uses `time.Duration` fields but we initialize them
inconsistently, as time.Duration sometimes and as duration strings other
times.  Previously, `mapstructure` handles it and does the right thing.

This is no longer the case with MsgPack.  I could not find a good way to
bring back old behavior without too much complexity.  `MsgPack` extended
types weren't ideal here as we lose type information (e.g. int64 vs
string), and the input is a generic map and not a MsgPack serialization
of duration.

As such, I went with the simple solution of declaring the config field
as duration string, and panicing if the test doesn't pass a valid
string.

I found this to cause the smallest change in tests, but we can
alternatively force all to be int64 instead.
2018-11-13 10:21:40 -05:00
Mahmood Ali
cc52606a07 distinguish java driver tests from others 2018-11-13 10:21:40 -05:00
Mahmood Ali
a24fd59d4b Fix java driver tests 2018-11-13 10:21:40 -05:00
Mahmood Ali
6702df2106 Merge pull request #4871 from hashicorp/r-job-rerun-bug-changelog
changelog job re-run fix
2018-11-13 10:18:54 -05:00
Mahmood Ali
13f9c80e72 Changelog job re-run fix 2018-11-13 07:52:51 -05:00
Mahmood Ali
91ea405e3f Merge pull request #4861 from hashicorp/b-batch-deregister-transaction
Run job deregistering in a single transaction
2018-11-12 20:59:44 -05:00
Mahmood Ali
66fc70fe50 Merge pull request #4845 from hashicorp/r-exec-refactor
Update exec driver to match rawexec
2018-11-12 20:59:32 -05:00
Preetha
0200000d53 Merge pull request #4855 from hashicorp/b-device-scheduling-fixtest
Fixes device scheduling unit tests
2018-11-12 16:55:23 -06:00
Preetha
3c5762ba02 Merge pull request #4865 from hashicorp/b-preemption-config
improvements to scheduler config API
2018-11-12 16:54:58 -06:00
Preetha Appan
3eeb229116 change path to v1/scheduler/configuration 2018-11-12 15:57:45 -06:00
Preetha Appan
3a2d5f0178 blank line 2018-11-12 15:50:14 -06:00
Danielle Tomlinson
7eb67b0d9c Merge pull request #4859 from hashicorp/b-rawexec-cgroups-root
rawexec: Only use cgroups when running as root.
2018-11-12 13:47:07 -08:00
Mahmood Ali
9405473329 Comment public functions and batch write txn 2018-11-12 16:09:39 -05:00
Preetha Appan
9f7dfb17a5 Fix logic bug in tracking sum of matched affinity weights
We need to track the sum of matching weights per device, but only
change the final return value if its the highest scoring choice
2018-11-12 15:06:45 -06:00
Preetha Appan
2ec4c235be Fix failing test 2018-11-10 19:53:47 -06:00
Preetha Appan
fe41b5addc Smaller methods, and added tests for RPC layer 2018-11-10 17:37:33 -06:00
Preetha Appan
1fe9203aa6 Use response object/querymeta/writemeta in scheduler config API 2018-11-10 10:31:10 -06:00
Danielle Tomlinson
1a17741e86 rawexec: Only use cgroups when running as root.
If Nomad is not running as root, we should not try to use cgroups for pid
freezing.

This originally was implemented pre-driver-support in
https://github.com/hashicorp/nomad/blob/v0.8.6/client/driver/raw_exec.go#L120-L130
2018-11-10 06:45:11 -08:00
Mahmood Ali
75488007bc Run job deregistering in a single transaction
Fixes https://github.com/hashicorp/nomad/issues/4299

Upon investigating this case further, we determined the issue to be a race between applying `JobBatchDeregisterRequest` fsm operation and processing job-deregister evals.

Processing job-deregister evals should wait until the FSM log message finishes applying, by using the snapshot index.  However, with `JobBatchDeregister`, any single individual job deregistering was applied accidentally incremented the snapshot index and resulted into processing job-deregister evals.  When a Nomad server receives an eval for a job in the batch that is yet to be deleted, we accidentally re-run it depending on the state of allocation.

This change ensures that we delete deregister all of the jobs and inserts all evals in a single transactions, thus blocking processing related evals until deregistering complete.
2018-11-09 22:35:26 -05:00
Michael Lange
31045da9be Merge pull request #4852 from hashicorp/b-ui-dispatched-job-page
UI: Show the correct template for dispatched jobs
2018-11-09 14:36:35 -08:00
Michael Lange
c45efccee6 Merge pull request #4833 from hashicorp/b-ui-gracefully-handle-stat-errors
UI: Gracefully handle stat errors
2018-11-09 14:35:48 -08:00
Michael Lange
b5348aacf0 Add missing module dependencies to the node adapter tests 2018-11-09 14:25:32 -08:00
Mahmood Ali
82b1764531 handle nil resources limits
Config may not express resource constraints on the job!
2018-11-09 15:52:44 -05:00
Preetha
ad905a38b3 Update CHANGELOG.md 2018-11-09 12:29:12 -06:00
Preetha
397235b72f Update CHANGELOG.md 2018-11-09 12:28:11 -06:00
Preetha
92c1ed8c10 Merge pull request #4839 from hashicorp/b-gc-alloc-jobversion
Remove terminal allocations associated with older job modify index
2018-11-09 12:21:42 -06:00
Preetha Appan
2409f72d0d Use create index as trigger condition to gc old terminal allocs 2018-11-09 11:44:21 -06:00
Preetha Appan
eda98fb070 Normalize scores correctly 2018-11-08 17:01:58 -06:00
Alex Dadgar
1c23bc83e2 changelog 2018-11-08 14:27:44 -08:00
Alex Dadgar
08b75d4120 Merge pull request #4842 from hashicorp/b-deployment-progress-deadline
Fix multiple bugs with progress deadline handling
2018-11-08 13:31:54 -08:00
Danielle Tomlinson
b06f6745a9 Merge pull request #4838 from dantoml/dani/fix-docs-typo
docs: Fix broken link to cloud auto join
2018-11-08 10:59:31 -08:00
Mahmood Ali
26fc1b140f shorter health descriptions 2018-11-08 10:00:49 -08:00
Mahmood Ali
60166374d9 Add a helper functions for checking unix root 2018-11-08 10:00:49 -08:00
Mahmood Ali
c794e70c4d Update exec driver to match rawexec
Update exec driver with latest patterns used by rawexec, and eliminate
accidental diffs.
2018-11-08 10:00:49 -08:00
Alex Dadgar
ad1564976c review fixes 2018-11-08 09:48:36 -08:00
Preetha Appan
66670c0f02 Fixes device scheduling unit tests
Also changes the logic for score when there is more than one task
requesting a device. Since inter task affinities are already normalized,
we take the average of the scores across tasks.
2018-11-08 10:31:19 -06:00
Charlie Voiselle
fba6cbfad6 Merge pull request #4851 from pgiles/patch-1
typo fix
2018-11-08 10:56:26 -05:00
Preetha
8573c9feed Merge pull request #4823 from hashicorp/f-preemption-plan-cli
show preemptions in nomad plan CLI
2018-11-08 09:55:07 -06:00
Preetha Appan
1d7ebb98ee Fix vet error 2018-11-08 09:48:43 -06:00
Preetha Appan
c5757f44ee review feedback 2018-11-08 09:48:43 -06:00
Preetha Appan
4c97c5ea0c Comments 2018-11-08 09:48:43 -06:00
Preetha Appan
6bb8e5aa58 Show preemption output in plan CLI 2018-11-08 09:48:43 -06:00
Michael Lange
5801b79b81 Show the correct template for parameterized job children 2018-11-07 21:04:27 -08:00
Paul Giles
5c4abbec47 typo fix 2018-11-07 17:47:23 -08:00
Michael Lange
9ef79cd92c Correctly mark parameterized children as parameterized: true 2018-11-07 17:07:40 -08:00