Commit Graph

14307 Commits

Author SHA1 Message Date
Mahmood Ali
2b3d324a7f Handle when cannot fetch docker logs (#5420)
Fix #5418

When using a docker logger that doesn't support log streaming through
API, currently docker logger runs a tight loop of Docker API calls
unexpectedly. This change ensures we stop fetching logs early.

Also, this adds some basic backoff strategy when Docker API logging
fails unexpectedly, to avoid accidentally DoSing the docker daemon.
2019-03-14 16:23:11 -04:00
Mahmood Ali
eb5ab38ae5 Regenerate Proto files (#5421)
Noticed that the protobuf files are out of sync with ones generated by 1.2.0 protoc go plugin.

The cause for these files seem to be related to release processes, e.g. [0.9.0-beta1 preperation](ecec3d38de (diff-da4da188ee496377d456025c2eab4e87)), and [0.9.0-beta3 preperation](b849d84f2f).

This restores the changes to that of the pinned protoc version and fails build if protobuf files are out of sync.  Sample failing Travis job is that of the first commit change: https://travis-ci.org/hashicorp/nomad/jobs/506285085
2019-03-14 10:56:27 -04:00
Preetha
2ca6229625 Merge pull request #5413 from hashicorp/b-alloc-metrics
Fix bug with score metadata overridden during inplace upgrades
2019-03-13 13:29:04 -05:00
Preetha
5ccec41e31 Merge pull request #5416 from hashicorp/b-docker-email
Fix regression with requiring docker auth email
2019-03-13 13:28:34 -05:00
Preetha Appan
e8284caae8 minor review feedback 2019-03-13 13:27:28 -05:00
Preetha Appan
d1ca05c80b Validate all auth fields being empty rather than just email
This fixes a regression in 0.9 beta3 compared to 0.8.7 in validating
docker auth config
2019-03-13 11:47:37 -05:00
Preetha Appan
1893f10bb6 Dont require email address for docker auth 2019-03-13 11:08:56 -05:00
Preetha Appan
1323b4d5cc Fix bug where scoring metadata would be overridden during an inplace upgrade. 2019-03-12 23:36:46 -05:00
Michael Schurter
4bacdcd403 Merge pull request #5386 from hashicorp/b-logmon-stop
Fix task/logmon leak after crash
2019-03-12 15:23:02 -07:00
Michael Schurter
e9e1d788b5 client: cleanup and document context uses
Some of the context uses in TR hooks are useless (Killed during Stop
never seems meaningful).

None of the hooks are interruptable for graceful shutdown which is
unfortunate and probably needs fixing.
2019-03-12 15:03:54 -07:00
Michael Schurter
bfff8d8e25 Merge pull request #5371 from hashicorp/docs-backincompat
Backward compat note about task config validation
2019-03-12 14:33:05 -07:00
Chris Baker
783c49b34b Merge pull request #5373 from hashicorp/docs-artifact-stanza
artifact stanza documentation
2019-03-11 14:09:28 -04:00
Charlie Voiselle
e7bd312580 Merge pull request #5401 from hashicorp/doc-rkt-needs-root
Note rkt driver needs Nomad client run as root
2019-03-11 10:29:45 -04:00
Mahmood Ali
086677b0df run TestAllocations_Stats in CI 2019-03-08 07:57:37 -05:00
Mahmood Ali
4bbfc99102 use -dev tag until next release 2019-03-08 07:56:35 -05:00
Michael Lange
3fedff63c6 Merge pull request #5400 from jacekjagiello/5303/logs-view-wdiescreen-support
Logs view - support widescreen format
2019-03-07 10:58:58 -08:00
Mahmood Ali
9410768aa7 fix typo 2019-03-06 20:24:01 -05:00
Charlie Voiselle
1edb20fd5c Note rkt driver needs Nomad client run as root
The rkt driver requires that the Nomad agent to be running as the root user
2019-03-06 19:53:51 -05:00
Jacek Jagiello
27d5d3ea64 5303 make logs view full width to better support large screens 2019-03-06 23:29:24 +01:00
Preetha
76ac2b3bb9 Merge pull request #5380 from quasilyte/patch-1
drivers/shared/executor: fix strings.Replace call
2019-03-06 11:47:01 -06:00
Michael Schurter
76d2eeea4e Merge pull request #5381 from hashicorp/b-max-eval-wait-index
nomad: compare current eval when setting WaitIndex
2019-03-06 09:22:46 -08:00
Charlie Voiselle
d75cf587ef Tweaked deprecation wording for legacy config (#5394)
Made small adjustment to make it clear that 0.8.7 would require the legacy syntax and that the deprecation notice was more about the legacy syntax becoming unsupported at some point after v0.9.0
2019-03-06 11:07:54 -05:00
Preetha
8cf8f7d3c7 Merge pull request #5392 from hashicorp/yishan-fix-typo-1
Add missing period to sentence.
2019-03-06 09:13:40 -06:00
Mahmood Ali
32623ce3ee Support driver config fields being set to nil (#5391)
To pick up https://github.com/hashicorp/hcl2/pull/90
2019-03-05 21:47:06 -05:00
Alex Dadgar
6c8839a859 Update nomad/eval_endpoint_test.go
Co-Authored-By: schmichael <michael.schurter@gmail.com>
2019-03-05 15:19:15 -08:00
Alex Dadgar
3d8683b0db Update nomad/eval_endpoint.go
Co-Authored-By: schmichael <michael.schurter@gmail.com>
2019-03-05 15:19:07 -08:00
Michael Schurter
7970b224b0 client: emit event and call exited hooks during cleanup
Builds upon earlier commit that cleans up restored handles of terminal
allocs by also emitting terminated events and calling exited hooks when
appropriate.
2019-03-05 15:12:02 -08:00
Yishan Lin
e2b3d86e8a Add missing period to sentence. 2019-03-05 12:38:36 -08:00
Danielle Tomlinson
8499bbdfa9 Update CHANGELOG.md
Co-Authored-By: schmichael <michael.schurter@gmail.com>
2019-03-04 14:00:59 -08:00
Michael Schurter
b47b1f1cda nomad: simplify code and improve parameter name 2019-03-04 13:44:14 -08:00
Michael Schurter
b5b2718e14 test: fix NewMemDB API change 2019-03-04 13:37:20 -08:00
Michael Schurter
54177ad672 logmon: drop reattach log level as its expected
Logged once per terminal task on agent restart.
2019-03-04 13:26:01 -08:00
Michael Schurter
8d409a6e39 client: test logmon cleanup
The test is sadly quite complicated and peeks into things (logmon's
reattach config) AR doesn't normally have access to.

However, I couldn't find another way of asserting logmon got cleaned up
without resorting to smaller unit tests. Smaller unit tests risk
re-implementing dependencies in an unrealistic way, so I opted for an
ugly integration test.
2019-03-04 13:15:15 -08:00
Preetha
d8323724ef Merge pull request #5384 from hashicorp/b-fix-typo
s/mananger/manager/g
2019-03-04 13:29:18 -06:00
Preetha Appan
8a24660941 s/mananger/manager 2019-03-04 12:25:54 -06:00
Michael Schurter
3fc5765401 nomad: compare current eval when setting WaitIndex
Consider currently dequeued Evaluation's ModifyIndex when determining
its WaitIndex. Normally the Evaluation itself would already be in the
state store snapshot used to determine the WaitIndex. However, since the FSM
applies Raft messages to the state store concurrently with Dequeueing,
it's possible the currently dequeued Evaluation won't yet exist in the
state store snapshot used by JobsForEval.

This can be solved by always considering the current eval's modify index
and using it if it is greater than all of the evals returned by the
state store.
2019-03-01 15:23:39 -08:00
Michael Schurter
db9daf6631 client: ensure task is cleaned up when terminal
This commit is a significant change. TR.Run is now always executed, even
for terminal allocations. This was changed to allow TR.Run to cleanup
(run stop hooks) if a handle was recovered.

This is intended to handle the case of Nomad receiving a
DesiredStatus=Stop allocation update, persisting it, but crashing before
stopping AR/TR.

The commit also renames task runner hook data as it was very easy to
accidently set state on Requests instead of Responses using the old
field names.
2019-03-01 14:00:23 -08:00
Iskander (Alex) Sharipov
7cf58d08c1 drivers/shared/executor: fix strings.Replace call
strings.Replace call with n=0 argument makes no sense
as it will do nothing. Probably -1 is intended.

Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
2019-03-02 00:33:17 +03:00
Michael Schurter
82d37b99df Merge pull request #5372 from hashicorp/f-docker-logging-driver
drivers/docker: rename logging `type` to `driver`
2019-02-28 14:10:24 -08:00
Chris Baker
2d25f24d99 artifact docs: modified the leading example and removed a treacherous (but potentially correct) example 2019-02-28 21:48:01 +00:00
Mahmood Ali
011315ba4c logging.Type over logging.Driver 2019-02-28 16:40:18 -05:00
Mahmood Ali
314d7a0f41 drivers/docker: rename logging type to driver
Docker uses the term logging `driver` in its public documentations: in
`docker` daemon config[1], `docker run` arguments [2] and in docker compose file[3].
Interestingly, docker used `type` in its API [4] instead of everywhere
else.

It's unfortunate that Nomad used `type` modeling after the Docker API
rather than the user facing documents.  Nomad using `type` feels very
non-user friendly as it's disconnected from how Docker markets the flag
and shows internal representation instead.

Here, we rectify the situation by introducing `driver` field and
prefering it over `type` in logging.

[1] https://docs.docker.com/config/containers/logging/configure/
[2] https://docs.docker.com/engine/reference/run/#logging-drivers---log-driver
[3] https://docs.docker.com/compose/compose-file/#logging
[4] https://docs.docker.com/engine/api/v1.39/#operation/ContainerCreate
2019-02-28 16:04:03 -05:00
Nick Ethier
737ea19b90 Merge pull request #5364 from hashicorp/disable-failing-e2e-tests
tests: disable upgrade e2e tests
2019-02-28 14:02:27 -05:00
Michael Schurter
9467604d23 Backward compat note about task config validation 2019-02-28 10:58:07 -08:00
Omar Khawaja
982e73f545 update formatting and add toJSON function with explanation (#5366)
* update formatting and add toJSON function with explanation

* edit typo

* Update website/source/guides/operations/vault-integration/index.html.md

Co-Authored-By: Omar-Khawaja <Omar-Khawaja@users.noreply.github.com>

* fixing clarification bullet explaining the use of toJSON
2019-02-28 13:00:25 -05:00
Omar Khawaja
1d9c7b53f8 make root block device size configurable (#5368) 2019-02-28 11:35:57 -05:00
Mahmood Ali
1d22a0b309 docs: Update beta release link to 0.9.0-beta3 (#5365) 2019-02-27 09:49:36 -05:00
Mahmood Ali
863c34aba7 tests: disable upgrade e2e tests
Upgrade e2e tests are failing and we haven't had bandwith to fix yet.
Having them fail makes it easy for us to miss other failures and
regressions.

As such, skip the upgrade e2e tests until we fix them.
2019-02-27 08:40:09 -05:00
Mahmood Ali
f95749f1ca docker: report unhealthy in unsupported Windows (#5356)
On Windows, Nomad only supports Windows containers, so report as
unhealthy otherwise.
2019-02-27 08:10:23 -05:00
Michael Schurter
8ea6718ceb Remove generated files for 0.9.0-beta3 2019-02-26 10:34:08 -08:00