Commit Graph

15308 Commits

Author SHA1 Message Date
Chris Baker a2b3e83499 update changelog 2019-06-18 14:16:49 +00:00
Chris Baker f71114f5b8 cleanup test 2019-06-18 14:15:25 +00:00
Chris Baker a2dc351fd0 formatting and clarity 2019-06-18 14:00:57 +00:00
Damien Churchill 9ee17f32c0 run new file through goimports 2019-06-18 08:35:25 +01:00
Damien Churchill dba5bd96cd run gofmt over the new file 2019-06-18 08:35:25 +01:00
Damien Churchill 4d7d352d7e drivers/docker: move lifted code out to separate file and link the source & license 2019-06-18 08:35:25 +01:00
Damien Churchill 70daca3395 lift code from docker/volume/mounts for splitting windows volumes
Using the API as provided from the `mounts` package imposes validation
on the `src:dest` which shouldn't be performed at this time. To workaround
that lift the internal code from that library required to only perform
the split.
2019-06-18 08:35:25 +01:00
Buck Doyle 456c4c8bd2
Add exclusion of UI branches for AppVeyor (#5842)
As with #5839 on Travis CI, this skips AppVeyor for UI branches.
2019-06-17 16:31:11 -07:00
Preetha Appan 599eba3be1
docs for new metrics 2019-06-17 15:51:49 -05:00
Preetha Appan 104d66f10c
Changed name of metric 2019-06-17 15:51:31 -05:00
Chris Baker e0170e1c67 metrics: add namespace label to allocation metrics 2019-06-17 20:50:26 +00:00
Mahmood Ali c1f6c7b457 Upgrade hcl2 to validate arrays for unknown values
This upgrades hcl2 library dependency to pick up
https://github.com/hashicorp/hcl2/pull/113 .

Prior to this change, parsing and decoding array attributes containing
invalid errors (e.g. references to unknown variables) are silently
dropped, with `cty.Unknown` being assigned to the bad element.  Rather
than showing a type/meaningful error from hcl2, we get a very decrypted
error message from msgpack layer trying to handle `cty.unknown`.

This ensures that we propagate diagnostics correctly and report
meaningful errors to users.

Fixes https://github.com/hashicorp/nomad/issues/5694
Fixes https://github.com/hashicorp/nomad/issues/5680
2019-06-17 12:28:14 -04:00
Mahmood Ali cb92b5d162 Add a test for unknown variables 2019-06-17 12:25:43 -04:00
Buck Doyle bbf8307ce6
Remove non-UI jobs for branches starting with .-ui (#5839)
Branches that follow the UI naming convention will no longer produce
non-UI jobs on Travis CI.
2019-06-14 15:41:34 -07:00
Preetha Appan c54b4a5b17
Emit metrics with raft commit and apply index and statestore latest index 2019-06-14 16:30:27 -05:00
Buck Doyle 5390d71648 Update changelog properly
I failed to amend my commit! 😭
2019-06-14 08:55:13 -07:00
Buck Doyle 5282765284 Update changelog 2019-06-13 16:55:00 -07:00
Jasmine Dahilig 43382ab52b update changelog 2019-06-13 14:41:56 -07:00
Mahmood Ali 8d4f914be9
Merge pull request #5790 from hashicorp/b-reschedule-desired-state
Mark rescheduled allocs as stopped.
2019-06-13 17:28:59 -04:00
Michael Schurter f48289ebbd
Merge pull request #5786 from hashicorp/docs-docs
docs: initial attempt at developer docs
2019-06-13 14:19:41 -07:00
Buck Doyle 2d96e37390
Change sort arrow to pass through pointer events (#5833)
Without this, clicking on the sort arrow didn’t change the
sort direction.
2019-06-13 16:14:35 -05:00
Michael Schurter 32138e2977
Merge branch 'master' into docs-docs 2019-06-13 14:13:41 -07:00
Mahmood Ali 962921f86c Use init to handle plugin invocation
Currently, nomad "plugin" processes (e.g. executor, logmon, docker_logger) are started as CLI
commands to be handled by command CLI framework.  Plugin launchers use
`discover.NomadBinary()` to identify the binary and start it.

This has few downsides: The trivial one is that when running tests, one
must re-compile the nomad binary as the tests need to invoke the nomad
executable to start plugin.  This is frequently overlooked, resulting in
puzzlement.

The more significant issue with `executor` in particular is in relation
to external driver:

* Plugin must identify the path of invoking nomad binary, which is not
trivial; `discvoer.NomadBinary()` now returns the path to the plugin
rather than to nomad, preventing external drivers from launching
executors.

* The external driver may get a different version of executor than it
expects (specially if we make a binary incompatible change in future).

This commit addresses both downside by having the plugin invocation
handling through an `init()` call, similar to how libcontainer init
handler is done in [1] and recommened by libcontainer [2].  `init()`
will be invoked and handled properly in tests and external drivers.

For external drivers, this change will cause external drivers to launch
the executor that's compiled against.

There a are a couple of downsides to this approach:
* These specific packages (i.e executor, logmon, and dockerlog) need to
be careful in use of `init()`, package initializers.  Must avoid having
command execution rely on any other init in the package.  I prefixed
files with `z_` (golang processes files in lexical order), but ensured
we don't depend on order.
* The command handling is spread in multiple packages making it a bit
less obvious how plugin starts are handled.

[1] drivers/shared/executor/libcontainer_nsenter_linux.go
[2] eb4aeed24f/libcontainer (using-libcontainer)
2019-06-13 16:48:01 -04:00
Mahmood Ali 5ec68c31e7
Merge pull request #5831 from hashicorp/golang-1.11.11
Update golang to 1.11.11
2019-06-13 16:44:32 -04:00
Mahmood Ali 5e6327b6a1 Test behavior no reschedule for service/batch jobs 2019-06-13 16:41:19 -04:00
Jasmine Dahilig 8d479523d9 update changelog 2019-06-13 12:28:54 -07:00
Jasmine Dahilig ed9740db10
Merge pull request #5664 from hashicorp/f-http-hcl-region
backfill region from hcl for jobUpdate and jobPlan
2019-06-13 12:25:01 -07:00
Jasmine Dahilig 51e141be7a backfill region from job hcl in jobUpdate and jobPlan endpoints
- updated region in job metadata that gets persisted to nomad datastore
- fixed many unrelated unit tests that used an invalid region value
(they previously passed because hcl wasn't getting picked up and
the job would default to global region)
2019-06-13 08:03:16 -07:00
Danielle c798d21f23
Merge pull request #5801 from jrasell/patch-5
Fix incorrect link to the sample Grafana dashboard
2019-06-13 16:39:23 +02:00
Danielle b7fc81031b
Merge pull request #5829 from hashicorp/dani/b-5819
consul: Include port-label in service registration
2019-06-13 16:20:45 +02:00
Mahmood Ali 6aaec8b861 Update golang to 1.11.11
It's the latest 1.11 point release as of now
2019-06-13 09:49:21 -04:00
Mahmood Ali 2d0025fba4
Merge pull request #5830 from hashicorp/docs-go-version-update
Updated minimum development go version
2019-06-13 09:48:34 -04:00
Mahmood Ali faf643a375 Don't stop rescheduleLater allocations
When an alloc is due to be rescheduleLater, it goes through the
reconciler twice: once to be ignored with a follow up evals, and once
again when processing the follow up eval where they appear as
rescheduleNow.

Here, we ignore them in the first run and mark them as stopped in second
iteration; rather than stop them twice.
2019-06-13 09:44:41 -04:00
Charlie Voiselle 9f0473d32f
Updated minimum development go version 2019-06-13 09:36:09 -04:00
Danielle Lancashire 8112177503
consul: Include port-label in service registration
It is possible to provide multiple identically named services with
different port assignments in a Nomad configuration.

We introduced a regression when migrating to stable service identifiers where
multiple services with the same name would conflict, and the last definition
would take precedence.

This commit includes the port label in the stable service identifier to
allow the previous behaviour where this was supported, for example
providing:

```hcl
service {
  name = "redis-cache"
  tags = ["global", "cache"]
  port = "db"
  check {
    name     = "alive"
    type     = "tcp"
    interval = "10s"
    timeout  = "2s"
  }
}

service {
  name = "redis-cache"
  tags = ["global", "foo"]
  port = "foo"

  check {
    name     = "alive"
    type     = "tcp"
    port     = "db"
    interval = "10s"
    timeout  = "2s"
  }
}

service {
  name = "redis-cache"
  tags = ["global", "bar"]
  port = "bar"

  check {
    name     = "alive"
    type     = "tcp"
    port     = "db"
    interval = "10s"
    timeout  = "2s"
  }
}
```

in a nomad task definition is now completely valid. Each service
definition with the same name must still have a unique port label however.
2019-06-13 15:24:54 +02:00
Nick Ethier 1b7fa4fe29
Optional Consul service tags for nomad server and agent services (#5706)
Optional Consul service tags for nomad server and agent services
2019-06-13 09:00:35 -04:00
Michael Schurter b2d62096d0 docs: checklists don't support numbered lists
The order didn't really make sense anyway.
2019-06-12 15:35:48 -07:00
Mahmood Ali 1ead8b60d2 update website to link to Nomad 0.9.3 2019-06-12 14:56:18 -04:00
Mahmood Ali e31159bf1f Prepare for 0.9.4 dev cycle 2019-06-12 18:47:50 +00:00
Mahmood Ali 21aa1cdc0e
Release v0.9.3 2019-06-12 18:44:47 +00:00
Nomad Release bot 4803215109 Generate files for 0.9.3 release 2019-06-12 16:11:16 +00:00
Preetha 71ba7eb9cb
Merge pull request #5815 from hashicorp/f-downgrade-docs
Add warning docs around downgrades
2019-06-12 10:39:43 -05:00
Danielle Lancashire 54d544e874
update changelog 2019-06-12 17:35:57 +02:00
Preetha 8a98817fe4
Merge pull request #5820 from hashicorp/r-assorted-changes-20190612_1
Assorted minor changes
2019-06-12 10:33:16 -05:00
Danielle f923b568e0
Merge pull request #5821 from hashicorp/dani/b-5770
trhooks: Add TaskStopHook interface to services
2019-06-12 17:30:49 +02:00
Chris Baker 6d4e840453
Merge pull request #5825 from hashicorp/docs-updated-alloc-examples
documentation: fixed incorrect URLs in allocation signal/restart documentation
2019-06-12 11:28:05 -04:00
Chris Baker ccb9992930 documentation: fixed incorrect URLs in allocation signal/restart documentation 2019-06-12 15:14:34 +00:00
Danielle cc82195d05
Merge pull request #5823 from hashicorp/dani/fix-restart-api
alloc-lifecycle: Fix restart with empty body
2019-06-12 17:07:46 +02:00
Danielle Lancashire c326344b57
trt: Fix test 2019-06-12 17:06:11 +02:00
Danielle 559ccfe797
Merge pull request #5822 from hashicorp/dani/allocrestartapidocs
docs: Add missing docs for alloc restart api
2019-06-12 16:58:59 +02:00