Commit Graph

14434 Commits

Author SHA1 Message Date
Michael Schurter
010b9575db Bump download page to 0.9.0-rc2 2019-04-03 07:46:28 -07:00
Michael Schurter
b51e9e09fc Remove 0.9.0-rc2 generated files 2019-04-03 07:41:09 -07:00
Michael Schurter
865e433673 Release v0.9.0-rc2 2019-04-03 07:27:45 -07:00
Nomad Release bot
6a838b8c3b Generate files for 0.9.0-rc2 release 2019-04-03 01:54:29 +00:00
Preetha Appan
a09fb7d7bf small tweaks to load test jobs to make them work in Nomad 0.8.7 2019-04-02 20:38:56 -05:00
Mahmood Ali
39555db45f Merge pull request #5511 from hashicorp/b-executor-path-executable
This is a follow up work to https://github.com/hashicorp/nomad/pull/4813 to fix #4809 and fix a regression introduced in 0.9 in marking files in libcontainer executable.

#4809 bug is that `lookupBin` uses `exec.LookPath` when not inspecting task dir files.  `exec.LookPath` only returns a file if it's already marked as an executable path in https://github.com/golang/go/blob/go1.12.1/src/os/exec/lp_unix.go#L24-L27 .  This affects raw exec as if passed an absolute path to file, `lookupBin` returns an error if file isn't already an executable.  This explains why the error manifests when an absolute interpolated path is used (e.g. `${NOMAD_TASK_DIR}/hellov1`) but not when using a task rel dir (e.g. `local/hellov1`) in the above examples used in ticket.

PR #4813 remedied this problem for raw exec but inadvertably broke libcontainer executor, as it made `lookupBin` returns the paths to host files rather than ones found inside chroot.

This PR reorders the evaluation, so we go back to 0.8 behavior of looking up task directories first, but then check for host paths before using `exec.LookPath`.

This PR is broken into three commits to illustrate evolution and confirming hypothesis:
1. 9adab75ac8 : Adding a test illustrating how libcontainer executor fails at marking processes as executable in https://travis-ci.org/hashicorp/nomad/jobs/514942694 - note that the test doesn't depend on artifacts or interpolated paths
2. d441cdd52f: reverting PR #4809 and showing the test fail now with raw_exec case (as expected) in https://travis-ci.org/hashicorp/nomad/jobs/514944065
2. 244544b735: in where we add the check in appropriate place next to `exec.LookPath(...)` for absolute paths and have a green job in https://travis-ci.org/hashicorp/nomad/jobs/514945024

## Future work

Inspecting `lookupBin` in 0.8 and 0.9 case, we have a bug in using `exec.LookPath` for the libcontainer executor case.  We should be looking up paths based on the container chroot and container PATH rather than the host's.  However, this is not a 0.9.0 regression and was present in 0.8; so punting to fix it post 0.9.
2019-04-02 20:53:31 -04:00
Mahmood Ali
244544b735 an alternative order 2019-04-02 20:00:54 -04:00
Mahmood Ali
d441cdd52f try not without checking stat first 2019-04-02 19:55:44 -04:00
Mahmood Ali
9adab75ac8 basic test for #4809 2019-04-02 19:50:35 -04:00
Michael Schurter
800bd848c1 Merge pull request #5504 from hashicorp/b-exec-path
executor/linux: make chroot binary paths absolute
2019-04-02 14:09:50 -07:00
Michael Schurter
56048bda0a executor/linux: comment this bizarre code 2019-04-02 11:25:45 -07:00
Michael Schurter
21e895e2e7 Revert "executor/linux: add defensive checks to binary path"
This reverts commit cb36f4537e.
2019-04-02 11:17:12 -07:00
Michael Schurter
8920d56212 Merge pull request #5503 from hashicorp/docs-nomad-oss-debug
Mention nomad-oss-debug in issue template
2019-04-02 10:08:07 -07:00
Michael Schurter
c37cff61b8 Mention nomad-oss-debug in issue template
Also reordered the sections to put the logs at the end.
2019-04-02 10:07:06 -07:00
Michael Schurter
0007443db7 Merge pull request #5510 from hashicorp/b-docker-stats
docker: fix send after close panic in stats
2019-04-02 10:01:28 -07:00
Michael Schurter
cb36f4537e executor/linux: add defensive checks to binary path 2019-04-02 09:40:53 -07:00
Michael Schurter
855a08810c docker: improve stats names and comments 2019-04-02 09:18:38 -07:00
Mahmood Ali
82d3c43e31 Update drivers/docker/stats.go comment
Co-Authored-By: schmichael <michael.schurter@gmail.com>
2019-04-02 09:09:17 -07:00
Michael Schurter
a69664e5ee docker: fix send after close panic in stats
destCh was being written to by one goroutine and closed by another
goroutine. This panic occurred in Travis:

```
=== FAIL: drivers/docker TestDockerCoordinator_ConcurrentPulls (117.66s)
=== PAUSE TestDockerCoordinator_ConcurrentPulls
=== CONT  TestDockerCoordinator_ConcurrentPulls

panic: send on closed channel

goroutine 5358 [running]:
github.com/hashicorp/nomad/drivers/docker.dockerStatsCollector(0xc0003a4a20, 0xc0003a49c0, 0x3b9aca00)
	/home/travis/gopath/src/github.com/hashicorp/nomad/drivers/docker/stats.go:108 +0x167

created by
github.com/hashicorp/nomad/drivers/docker.TestDriver_DockerStatsCollector
	/home/travis/gopath/src/github.com/hashicorp/nomad/drivers/docker/stats_test.go:33 +0x1ab
```

The 2 ways to fix this kind of error are to either (1) add extra
coordination around multiple goroutines writing to a chan or (2) make it
so only one goroutines writes to a chan.

I implemented (2) first as it's simpler, but @notnoop pointed out since
the same destCh in reused in the stats loop there's now a double close
panic possible!

So this implements (1) by adding a *usageSender struct for handling
concurrent senders and closing.
2019-04-02 08:28:08 -07:00
Mahmood Ali
6ffb3e265a Merge pull request #5508 from hashicorp/d-docker-force-pull-latest
document force_pull and :latest tag interaction
2019-04-02 09:37:55 -04:00
Mahmood Ali
92af1caa28 document force_pull and :latest tag interaction 2019-04-02 08:48:34 -04:00
Preetha Appan
aae61695f5 added cpu/disk/memory stress jobs for e2e tests 2019-04-01 22:28:18 -05:00
Michael Schurter
254901a51e executor/linux: make chroot binary paths absolute
Avoid libcontainer.Process trying to lookup the binary via $PATH as the
executor has already found where the binary is located.
2019-04-01 15:45:31 -07:00
Mahmood Ali
12242b69f7 Merge pull request #5499 from hashicorp/r-fifo-plain-file
fifo: Use plain fifo file in Unix
2019-04-01 17:23:11 -04:00
Mahmood Ali
1450197936 comment configureTLogging 2019-04-01 16:52:58 -04:00
Mahmood Ali
714c41185c rename fifo methods for clarity 2019-04-01 16:52:58 -04:00
Mahmood Ali
7661857c6e clarify closeDone blocking and field name 2019-04-01 16:10:34 -04:00
Preetha Appan
9d4c84e663 Added nginx to e2e test 2019-04-01 14:52:58 -05:00
Mahmood Ali
3c68c946c4 no requires in a test goroutine 2019-04-01 15:38:39 -04:00
Michael Lange
816b348593 Merge pull request #5496 from hashicorp/b-ui/reattach-resources-to-stats-trackers
UI: Reattach resources to stats trackers in the event they were destroyed
2019-04-01 11:31:28 -07:00
Mahmood Ali
48259078df avoid opening files just to close them 2019-04-01 13:24:18 -04:00
Mahmood Ali
3fb377ae6e Add test cases for waiting on children
Also, make the test use files just like in the non-test case.
2019-04-01 13:24:18 -04:00
Mahmood Ali
9f1ee37687 log when fifo fails to open 2019-04-01 13:18:03 -04:00
Mahmood Ali
0517bcb403 run fifo tests on Windows 2019-04-01 13:18:03 -04:00
Mahmood Ali
5ca9b6eb37 fifo: Use plain fifo file in Unix
This PR switches to using plain fifo files instead of golang structs
managed by containerd/fifo library.

The library main benefit is management of opening fifo files.  In Linux,
a reader `open()` request would block until a writer opens the file (and
vice-versa).  The library uses goroutines so that it's the first IO
operation that blocks.

This benefit isn't really useful for us: Given that logmon simply
streams output in a separate process, blocking of opening or first read
is effectively the same.

The library additionally makes further complications for managing state
and tracking read/write permission that seems overhead for our use,
compared to using a file directly.

Looking here, I made the following incidental changes:
* document that we do handle if fifo files are already created, as we
rely on that behavior for logmon restarts
* use type system to lock read vs write: currently, fifo library returns
`io.ReadWriteCloser` even if fifo is opened for writing only!
2019-04-01 13:18:03 -04:00
Mahmood Ali
da430f86c5 Merge pull request #5497 from hashicorp/b-exec-cpu-stats
exec: report cpu usage summary stat
2019-04-01 12:37:01 -04:00
Preetha Appan
05637ae076 Remove unnecessary step in getting node client
All allocation stats are routable from the server
2019-04-01 10:45:41 -05:00
Mahmood Ali
af25b6b146 Merge pull request #5468 from hashicorp/b-test-exec-kill-wait
Adding tests for killing task without grace
2019-03-31 20:37:15 -04:00
Michael Schurter
e162e3b631 Update drivers/shared/executor/executor_test.go
Co-Authored-By: notnoop <mahmood@notnoop.com>
2019-03-31 20:34:24 -04:00
Preetha Appan
46b012fd3b Add e2e test with raw exec job for verifying allocation resource stats 2019-03-31 09:46:23 -05:00
Mahmood Ali
b8f80e5124 Simplify proto conversion and handle swap
Convert all cpu and memory usage fields regardless of stated measured
fields, and handle swap fields
2019-03-30 15:18:28 -04:00
Mahmood Ali
484ccfafab deserialize total ticks 2019-03-30 07:14:57 -04:00
Mahmood Ali
a880f93a61 Always report TotalTicks when percent is measured
Fix a case where TotalTicks doesn't get serialized across executor grpc
calls.

Here, I opted to implicit add field, rather than explicitly mark it as a
measured field, because it's a derived field and to preserve 0.8
behavior where total ticks aren't explicitly marked as a measured field.
2019-03-29 22:34:28 -04:00
Michael Lange
a0e893ed84 Reattach resources to stats trackers in the event they were destroyed 2019-03-29 16:09:14 -07:00
Michael Schurter
f75f5c9b3b Merge pull request #5491 from hashicorp/b-docker-container-name
docker: restore pre-0.9 container names
2019-03-29 15:41:04 -07:00
Michael Schurter
010a1973a9 docker: restore pre-0.9 container names
As far as I can tell Nomad itself does not use the container name after
container creation, so this should be safe.

OP: https://groups.google.com/d/topic/nomad-tool/kYkyERfVRXE/discussion
v0.8.7 code: https://github.com/hashicorp/nomad/blob/v0.8.7/client/driver/docker.go#L1530-L1531
2019-03-29 13:55:43 -07:00
Jeff Mitchell
b5d8053635 Add go.mod/go.sum (#5493) 2019-03-29 15:02:32 -04:00
Jeff Mitchell
5676986196 Divest api/ package of deps elsewhere in the nomad repo. (#5488)
* Divest api/ package of deps elsewhere in the nomad repo.

This will allow making api/ a module without then pulling in the
external repo, leading to a package name conflict.

This required some migration of tests to an apitests/ folder (can be
moved anywhere as it has no deps on it). It also required some
duplication of code, notably some test helpers from api/ -> apitests/
and part (but not all) of testutil/ -> api/testutil/.

Once there's more separation and an e.g. sdk/ folder those can be
removed in favor of a dep on the sdk/ folder, provided the sdk/ folder
doesn't depend on api/ or /.

* Also remove consul dep from api/ package

* Fix stupid linters

* Some restructuring
2019-03-29 14:47:40 -04:00
Preetha
654c96bf10 Merge pull request #5480 from hashicorp/docs-centos6
docs: mention support for centos6 is dropped
2019-03-29 09:21:08 -05:00
Preetha
2bbd05d18f Merge pull request #5489 from hashicorp/b-plugin-config-bugfix
Fix json parsing bug with plugins that don't provide args
2019-03-29 09:13:26 -05:00