Commit Graph

13946 Commits

Author SHA1 Message Date
Alex Dadgar
c19cd2e5cf loader and singleton 2019-01-22 15:11:57 -08:00
Alex Dadgar
b9f36134dc move catalog + grpcutils 2019-01-22 15:11:57 -08:00
Alex Dadgar
7e81a9e3c4 increase log level 2019-01-22 14:20:54 -08:00
Michael Schurter
7c45733ba4 Merge pull request #5211 from hashicorp/test-porting-08
Port some 0.8 TaskRunner tests
2019-01-22 14:05:53 -08:00
Michael Lange
316a4f2541 CHANGELOG: added 0.9 ui changes 2019-01-22 09:59:46 -08:00
Michael Schurter
06119e2505 test: port TestTaskRunner_CheckWatcher_Restart
Added ability to adjust the number of events the TaskRunner keeps as
there's no way to observe all events otherwise.

Task events differ slightly from 0.8 because 0.9 emits Terminated every
time a task exits instead of only when it exits on its own (not due to
restart or kill).

0.9 does not emit Killing/Killed for restarts like 0.8 which seems fine
as `Restart Signaled/Terminated/Restarting` is more descriptive.

Original v0.8 events emitted:
```
	expected := []string{
		"Received",
		"Task Setup",
		"Started",
		"Restart Signaled",
		"Killing",
		"Killed",
		"Restarting",
		"Started",
		"Restart Signaled",
		"Killing",
		"Killed",
		"Restarting",
		"Started",
		"Restart Signaled",
		"Killing",
		"Killed",
		"Not Restarting",
	}
```
2019-01-22 09:46:46 -08:00
Preetha
23c25f4b6d Merge pull request #5207 from hashicorp/b-rename-hooks
Rename TaskKillHook to TaskPreKillHook to more closely match usage
2019-01-22 10:29:53 -06:00
Michael Schurter
81334cd3a1 test: port RestartTask from 0.8 2019-01-22 08:08:08 -08:00
Michael Schurter
418d360d19 test: port SignalFailure test from 0.8
Also fix signal error handling in mock_driver.
2019-01-22 08:08:08 -08:00
Preetha Appan
a1cc48f78d Rename TaskKillRequest/Response to TaskPreKillRequest/Response 2019-01-22 09:54:02 -06:00
Preetha Appan
6f3e4e72b9 Fix log comments 2019-01-22 09:45:58 -06:00
Preetha Appan
c3f044291d Rename TaskKillHook to TaskPreKillHook to more closely match usage
Also added/fixed comments
2019-01-22 09:41:56 -06:00
Michael Schurter
77c01c6283 Fix comment
Co-Authored-By: preetapan <preetha@hashicorp.com>
2019-01-22 09:41:21 -06:00
Preetha Appan
bf9a2168e7 Rename TaskKillHook to TaskPreKillHook to more closely match usage
Also added/fixed comments
2019-01-22 09:41:21 -06:00
Mahmood Ali
06ca7860e2 Merge pull request #5216 from hashicorp/b-fix-tests-20180118
tests: deflake client TestFS_Logs_TaskPending test
2019-01-21 09:54:15 -05:00
Preetha
49aedf904f Update CHANGELOG.md 2019-01-19 11:15:04 -06:00
Mahmood Ali
54c86450f0 tests: deflake TestClientAllocations_GarbageCollect_Remote
Use the same strategy as one in f2f383b075
2019-01-19 09:07:27 -05:00
Nick Ethier
23f3c6f023 Merge pull request #5198 from hashicorp/f-driver-upgradepath
0.9 Upgrade path for drivers and executors
2019-01-19 00:06:21 -05:00
Mahmood Ali
92033f1a81 tests: deflake client TestFS_Logs_TaskPending test 2019-01-18 21:26:48 -05:00
Mahmood Ali
f2f383b075 Merge pull request #5215 from hashicorp/test-fix-garbagecollect
test: fix flaky garbage collect test
2019-01-18 21:10:01 -05:00
Mahmood Ali
f7e7b99819 Merge pull request #5213 from hashicorp/b-api-separate
Slimmer /api package
2019-01-18 20:52:53 -05:00
Preetha
06e953ce94 Update CHANGELOG.md 2019-01-18 18:15:11 -06:00
Preetha
dbb2e2655b Merge pull request #5205 from hashicorp/b-queuedallocs-bugfix
Reconcile child summaries correctly
2019-01-18 18:13:19 -06:00
Michael Schurter
f22dba9f64 test: fix flaky garbage collect test
This seems to fix TestClientAllocations_GarbageCollectAll_Remote being
flaky.

This test confuses me. It joins 2 servers, but then goes out of its way
to make sure the test client only interacts with one. There are not
enough comments for me to figure out the precise assertions this test is
trying to make.

A good old fashioned wait-for-the-client-to-register seems to fix the
flakiness though. The error was that the node could not be found, so
this makes some sense. However, lots of other tests seem to use the same
"wait for node" logic and don't appear to be flaky, so who knows why
waiting fixes this one.

Passes with -race.
2019-01-18 16:01:30 -08:00
Nick Ethier
f3ab65947e drivers: regen proto 2019-01-18 18:53:45 -05:00
Mahmood Ali
5e185386e0 api: avoid codegen for syncing
Given that the values will rarely change, specially considering that any
changes would be backward incompatible change.  As such, it's simpler to
keep syncing manually in the rare occasion and avoid the syncing code
overhead.
2019-01-18 18:52:31 -05:00
Preetha Appan
b403c9bf14 code review comments 2019-01-18 17:41:39 -06:00
Preetha Appan
e58fcf7ac7 revert unintended change 2019-01-18 17:36:35 -06:00
Nick Ethier
ce7bb88010 ar: return error from hooks if occured 2019-01-18 18:31:02 -05:00
Nick Ethier
82d16f8f6c drivers: fix func naming 2019-01-18 18:31:02 -05:00
Nick Ethier
994c66f7d7 drivers: use consts for task handle version 2019-01-18 18:31:01 -05:00
Nick Ethier
1d50ced70a drivers: add upgrade path for rawexec, java, rkt and qemu 2019-01-18 18:31:01 -05:00
Nick Ethier
7c440aa437 drivers: fix test 2019-01-18 18:31:01 -05:00
Nick Ethier
2f91ac88f7 cleanup code comments and small fixes from refactor 2019-01-18 18:31:01 -05:00
Nick Ethier
07cdedec2f driver: add pre09 migration logic 2019-01-18 18:31:01 -05:00
Nick Ethier
2118d94b2d executor: add pre 0.9 client and wrapper 2019-01-18 18:30:58 -05:00
Mahmood Ali
9f7619344e Merge pull request #5190 from hashicorp/f-memory-usage
Track Basic Memory Usage as reported by cgroups
2019-01-18 16:46:02 -05:00
Chris Baker
256ac52c50 Merge pull request #5212 from hashicorp/b-taskrunner-does-not-set-taskgroupname
task_runner does not set TaskGroupName in TaskConfig
2019-01-18 16:21:23 -05:00
Mahmood Ali
b1293a8993 api: move formatFloat function
`helpers.FormatFloat` function is only used in `api`.  Moving it and
marking it as private.  We can re-export it if we find value later.
2019-01-18 15:31:31 -05:00
Mahmood Ali
41c3250ee5 api: embed pointer conversion functions
Embed pointer conversion functions in the API package to avoid
unnecessary package dependency.  `helper` package imports more
dependencies relevant for internal use (e.g. `hcl`).
2019-01-18 15:31:04 -05:00
Chris Baker
b43f803d36 set TaskGroupName in task_runner 2019-01-18 20:25:11 +00:00
Chris Baker
d2f3dd7530 documenting test for task runner failure to set TaskGroupName 2019-01-18 20:00:49 +00:00
Chris Baker
0502f255c7 renamed mispelled function, fixed incorrect comment 2019-01-18 20:00:49 +00:00
Mahmood Ali
a5d60fd31c api: remove MockJob from exported functions
`api.MockJob` is a test utility, that's only used by `command/agent`
package.  This moves it to the package and removes it from the public
API.
2019-01-18 14:51:31 -05:00
Mahmood Ali
361d1e177c api: avoid import nomad/structs pkg
nomad/structs is an internal package and imports many libraries (e.g.
raft, codec) that are not relevant to api clients, and may cause
unnecessary dependency pain (e.g. `github.com/ugorji/go/codec`
version is very old now).

Here, we add a code generator that imports the relevant constants from
`nomad/structs`.

I considered using this approach for other structs, but didn't find a
quick viable way to reduce duplication.  `nomad/structs` use values as
struct fields (e.g. `string`), while `api` uses value pointer (e.g.
`*string`) instead.  Also, sometimes, `api` structs contain deprecated
fields or additional documentation, so simple copy-paste doesn't work.
For these reasons, I opt to keep the status quo.
2019-01-18 14:51:19 -05:00
Michael Schurter
4e4ecc949f Merge pull request #5203 from hashicorp/b-terminated
client: restore Terminated event on every exit
2019-01-18 08:54:15 -08:00
Mahmood Ali
cb6b5dd075 fix vendor entry field name 2019-01-18 10:05:21 -05:00
Danielle Tomlinson
9b3456011a Merge pull request #5204 from hashicorp/dani/loader-typo-2
Fix typo in PluginLoader
2019-01-18 11:22:22 +01:00
Danielle Tomlinson
2c8c1c4529 Merge pull request #5174 from hashicorp/dani/windows
Some Windows fixes and CI
2019-01-18 11:21:53 +01:00
Preetha
ce44b93f97 Merge pull request #5208 from hashicorp/b-tr-taskresources
Fix one more place that should be using taskResources
2019-01-17 19:40:37 -06:00