Commit Graph

18288 Commits

Author SHA1 Message Date
Seth Hoenig
051e387d0c build: use hashicorp hclfmt
We have been using fatih/hclfmt which is long abandoned. Instead, switch
to HashiCorp's own hclfmt implementation. There are some trivial changes in
behavior around whitespace.
2020-05-24 18:31:57 -05:00
Tim Gross
cc7e4b226b csi: skip unit tests on unsupported platforms (#8033)
Some of the unit tests for CSI require platform-specific APIs that aren't
available on macOS. We can safely skip these tests.
2020-05-21 13:56:50 -04:00
Tim Gross
262cafcdff docs: add missing fields to driver Capabilities (#8037)
Adds `NetIsolationModes`, `MustInitiateNetwork`, and `MountConfigs` fields to
the driver `Capabilities` internals documentation.
2020-05-21 13:56:40 -04:00
Buck Doyle
07fb795fa1 Add test-timing comparison for UI PRs (#7929)
This runs ember-test-audit for UI PRs to compare how long
the tests take for the base vs the PR. It posts or updates
a comparison of times and test count.

It’s somewhat slow to report back as it runs the test suite
three times to even out variability in a shared environment.
If we end up being unhappy with that slowness, we could try
running the repetitions in parallel as well, but that would
involve more changes to ember-test-audit.
2020-05-21 11:41:13 -05:00
Michael Lange
4b54536086 Merge pull request #8024 from hashicorp/f-ui/csi-plugin-allocations
UI: CSI Plugin Allocations Page
2020-05-21 09:16:45 -07:00
Tim Gross
8860b72bc3 volumes: return better error messages for unsupported task drivers (#8030)
When an allocation runs for a task driver that can't support volume mounts,
the mounting will fail in a way that can be hard to understand. With host
volumes this usually means failing silently, whereas with CSI the operator
gets inscrutable internals exposed in the `nomad alloc status`.

This changeset adds a MountConfig field to the task driver Capabilities
response. We validate this when the `csi_hook` or `volume_hook` fires and
return a user-friendly error.

Note that we don't currently have a way to get driver capabilities up to the
server, except through attributes. Validating this when the user initially
submits the jobspec would be even better than what we're doing here (and could
be useful for all our other capabilities), but that's out of scope for this
changeset.

Also note that the MountConfig enum starts with "supports all" in order to
support community plugins in a backwards compatible way, rather than cutting
them off from volume mounting unexpectedly.
2020-05-21 09:18:02 -04:00
Michael Lange
5302c08b9b Prevent sticky query params for plugin alloc filtering 2020-05-20 14:34:16 -07:00
Michael Lange
57bad784ed Show the number of allocations in the the goto links on plugin detail 2020-05-20 14:22:47 -07:00
Tim Gross
b3a33e0d46 csi: don't pass volume claim releases thru GC eval (#8021)
Following the new volumewatcher in #7794 and performance improvements
to it that landed afterwards, there's no particular reason we should
be threading claim releases through the GC eval rather than writing an
empty `CSIVolumeClaimRequest` with the mode set to
`CSIVolumeClaimRelease`, just as the GC evaluation would do.

Also, by batching up these raft messages, we can reduce the amount of
raft writes by 1 and cross-server RPCs by 1 per volume we release
claims on.
2020-05-20 15:22:51 -04:00
Tim Gross
db4c88f71b stats_hook: log normal shutdown condition as debug, not error (#8028)
The `stats_hook` writes an Error log every time an allocation becomes
terminal. This is a normal condition, not an error. A real error
condition like a failure to collect the stats is logged later. It just
creates log noise, and this is a particularly bad operator experience
for heavy batch workloads.
2020-05-20 10:28:30 -04:00
Tim Gross
c2dd6f9dba docs: notice to operators about script check timeouts (#8015)
The tasklet passes the timeout for the script check into the task
driver's `Exec`, and its up to the task driver to enforce that via a
golang `context.WithDeadline`. In practice, this deadline is started
before the task driver starts setting up the execution
environment (because we need it to do things like timeout Docker API
calls).

Under even moderate load, the time it takes to set up the execution
context for the script check regularly exceeds a full second or
two. This can cause script checks to unexpected timeout or even never
execute if the context expires before the task driver ever gets a
chance to `execve`.

This changeset adds a notice to operators about setting script check
timeouts with plenty of padding and what to monitor for problems.
2020-05-20 10:28:14 -04:00
Tim Gross
47588bd1b8 csi: check for empty arguments on CSI endpoint (#8027)
Some of the CSI RPC endpoints were missing validation that the ID or
the Volume definition was present. This could result in nonsense
`CSIVolume` structs being written to raft during registration. This
changeset corrects that bug and adds validation checks to present
nicer error messages to operators in some other cases.
2020-05-20 10:22:24 -04:00
James Rasell
06f0f3a415 Merge pull request #8013 from hashicorp/gh-8008
api: return custom error if API attempts to decode empty body.
2020-05-20 09:55:05 +02:00
James Rasell
041e25152c Merge pull request #8007 from hashicorp/volumes-docs-csi-put-blocking
docs: update CSI PUT operation blocking query support yes->no.
2020-05-20 09:38:38 +02:00
Michael Lange
2aeb1eca66 Test coverage for the plugin allocations page 2020-05-19 19:22:12 -07:00
Michael Lange
c90354179c Test coverage for the limited alloc tables and goto links 2020-05-19 18:01:42 -07:00
Michael Lange
24ba64a298 Limit the length of the alloc tables on the plugin overview page 2020-05-19 17:30:00 -07:00
Michael Lange
909d3b2055 Add a title to the plugin/allocations page
Typically these filterable list views don't have titles beyond the
breadcrumbs, but since this page has no search bar, the title really
helps balance it out.
2020-05-19 17:29:05 -07:00
Michael Lange
f255a1c963 Expose existing qp serialization util as a helper 2020-05-19 17:28:23 -07:00
Mahmood Ali
3c50825e17 Merge pull request #8020 from hashicorp/vendor-hcl2-20200519
Update hcl2 vendoring
2020-05-19 16:25:14 -04:00
Mahmood Ali
fcddfa4971 Update hcl2 vendoring
The hcl2 library has moved from http://github.com/hashicorp/hcl2 to https://github.com/hashicorp/hcl/tree/hcl2.

This updates Nomad's vendoring to start using hcl2 library.  Also
updates some related libraries (e.g. `github.com/zclconf/go-cty/cty` and
`github.com/apparentlymart/go-textseg`).
2020-05-19 15:00:03 -04:00
Charlie Voiselle
46fbd0a1b4 Merge pull request #7994 from shantanugadgil/patch-3
update docs to mention spread algorithm
2020-05-19 14:49:19 -04:00
Shantanu Gadgil
f3f1467278 Merge branch 'master' into patch-3 2020-05-20 00:16:43 +05:30
Charlie Voiselle
1778c387a5 Merge pull request #7870 from hashicorp/d-fix-version-typo
[docs] Fix version typo
2020-05-19 14:09:53 -04:00
Charlie Voiselle
27c12a6e70 Interlinking API, FAQ, and Config
Creating a FAQ question to provide a home for additional context around
bootstrapping. Linking from API page to `default_server_config`
attribute. Added sample API response to to discuss "Updated: false"
2020-05-19 13:51:47 -04:00
Michael Lange
99f117a288 Merge pull request #7986 from hashicorp/missing-changelog-entry
Add missing bug fix from the changelog for 0.11.2
2020-05-19 09:20:23 -07:00
Michael Lange
a07e64bca2 Merge pull request #8006 from hashicorp/f-ui/csi-node-only-support
UI: CSI node only support
2020-05-19 09:08:30 -07:00
Seth Hoenig
36684bd808 Merge pull request #8003 from hashicorp/c-use-taskkind
consul/connect: use task kind to get service name
2020-05-19 08:51:21 -06:00
James Rasell
87d51e6898 api: return custom error if API attempts to decode empty body. 2020-05-19 15:46:31 +02:00
Charlie Voiselle
2e4919d616 Adding info about bootstrap 2020-05-19 09:14:17 -04:00
Michael Lange
58f23eefc3 Add filtering to the plugin allocations page 2020-05-18 23:55:52 -07:00
James Rasell
8c217f27a4 docs: update CSI PUT operation blocking query support yes->no. 2020-05-19 08:42:48 +02:00
Michael Lange
4daae6b296 Scaffold the plugin allocations page 2020-05-18 23:36:12 -07:00
Michael Lange
1cdf519b18 Add a subnav to the plugin page 2020-05-18 23:24:02 -07:00
Michael Lange
7fba336963 Fix scrunched availability chart bug on double chart layout 2020-05-18 22:48:55 -07:00
Michael Lange
2b8c910114 Add plugin/allocations route 2020-05-18 22:48:23 -07:00
Michael Lange
7d71b5e3a8 Merge pull request #7983 from spuder/patch-3
Fix typo in changelog
2020-05-18 17:27:35 -07:00
Michael Lange
cb5cea646c Work around a mirage bug 2020-05-18 17:23:55 -07:00
Michael Lange
f760027ccf Test coverage for node only view of the plugin detail page 2020-05-18 17:23:54 -07:00
Michael Lange
3da88c6925 Test coverage for the node-only change to the list view 2020-05-18 15:30:00 -07:00
Michael Lange
ebc402ac5f Add availability gauges to the plugin page object 2020-05-18 15:30:00 -07:00
Michael Lange
3cf81d2741 Handle node-only views 2020-05-18 15:30:00 -07:00
Mahmood Ali
61d1f0eb4e Merge pull request #8005 from hashicorp/je.fix-shell-snippets
Fix shell-session snippet error
2020-05-18 18:15:09 -04:00
Jeff Escalante
e69fc1f459 fix shell-session snippet error 2020-05-18 16:53:06 -04:00
Seth Hoenig
0dd159635e consul/connect: use task kind to get service name
Fixes #8000

When requesting a Service Identity token from Consul, use the TaskKind
of the Task to get at the service name associated with the task. In
the past using the TaskName worked because it was generated as a sidecar
task with a name that included the service. In the Native context, we
need to get at the service name in a more correct way, i.e. using the
TaskKind which is defined to include the service name.
2020-05-18 13:46:00 -06:00
Charlie Voiselle
8623725397 Alternative treatment
A variation of the treatment that surfaces "spread scheduling" in the example while referring to the API docs as canonical for this setting.
2020-05-18 09:51:16 -04:00
Chris Baker
9400ac674e Merge pull request #7992 from hashicorp/docs-website-fix
docs: server configuration metadata was missing a dash
2020-05-18 08:47:40 -05:00
James Rasell
2058f40e12 Merge pull request #7995 from hashicorp/tidy-go-mod-api
api: tidy Go module to remove unused modules.
2020-05-18 14:53:19 +02:00
Shantanu Gadgil
860fb4d35b Update server.mdx 2020-05-18 17:54:27 +05:30
Tim Gross
64c6a8db22 csi: improve plugin error messages and volume validation (#7984)
Some CSI plugins don't return much for errors over the gRPC socket
above and beyond the bare minimum error codes. This changeset improves
the operator experience by unpacking the error codes when available
and wrapping the error with some user-friendly direction.

Improving these errors also revealed a bad comparison with
`require.Error` when `require.EqualError` should be used in the test
code for plugin errors. This defect in turn was hiding a bug in volume
validation where we're being overly permissive in allowing mount
flags, which is now fixed.
2020-05-18 08:23:17 -04:00