Commit graph

18271 commits

Author SHA1 Message Date
Tim Gross aa8927abb4
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
Tim Gross 72430a4e62
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 065fa7af8b
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 4b4bf84d79
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 3902709c0a
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 6db1bc69d0
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 779d58397a
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
Mahmood Ali 1bd4496feb
Merge pull request #8020 from hashicorp/vendor-hcl2-20200519
Update hcl2 vendoring
2020-05-19 16:25:14 -04:00
Mahmood Ali 751f337f1c 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 bde545b4db
Merge pull request #7994 from shantanugadgil/patch-3
update docs to mention spread algorithm
2020-05-19 14:49:19 -04:00
Shantanu Gadgil d5fc981636
Merge branch 'master' into patch-3 2020-05-20 00:16:43 +05:30
Charlie Voiselle 31c71767ec
Merge pull request #7870 from hashicorp/d-fix-version-typo
[docs] Fix version typo
2020-05-19 14:09:53 -04:00
Charlie Voiselle e63346560c
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 af6846e10e
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 7199570d2f
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 a6436b5ac6
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 ae0fb98c6b
api: return custom error if API attempts to decode empty body. 2020-05-19 15:46:31 +02:00
Charlie Voiselle 15d6f0e80e
Adding info about bootstrap 2020-05-19 09:14:17 -04:00
James Rasell 7bd35dd11c
docs: update CSI PUT operation blocking query support yes->no. 2020-05-19 08:42:48 +02:00
Michael Lange c60b987729
Merge pull request #7983 from spuder/patch-3
Fix typo in changelog
2020-05-18 17:27:35 -07:00
Michael Lange 22cc9bec74 Work around a mirage bug 2020-05-18 17:23:55 -07:00
Michael Lange 49724673d4 Test coverage for node only view of the plugin detail page 2020-05-18 17:23:54 -07:00
Michael Lange eabac917f1 Test coverage for the node-only change to the list view 2020-05-18 15:30:00 -07:00
Michael Lange af5ac78eba Add availability gauges to the plugin page object 2020-05-18 15:30:00 -07:00
Michael Lange 19916dc028 Handle node-only views 2020-05-18 15:30:00 -07:00
Mahmood Ali fcb98d2c54
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 636f174f48
fix shell-session snippet error 2020-05-18 16:53:06 -04:00
Seth Hoenig f6c8db8a8a 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 2dd34efacc
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 a6a8c385ab
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 6910c61839
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 32046d6f18
Update server.mdx 2020-05-18 17:54:27 +05:30
Tim Gross 0f1946d395
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
James Rasell 01236e842b
api: tidy Go module to remove unused modules. 2020-05-18 09:56:23 +02:00
Shantanu Gadgil fb4c070aae
update docs to mention spread algorithm
update docs to mention spread algorithm
2020-05-18 11:38:52 +05:30
Chris Baker 10ab0ef9b5 docs: server configuration metadata was missing a dash, causing problems
rendering that page
2020-05-17 15:07:46 +00:00
Mahmood Ali 3fa040183f
Merge pull request #7988 from tcassaert/vault_int_docs
Docs: Vault integration token creation docs missing command
2020-05-16 11:38:32 -04:00
Mahmood Ali 0a337a19c5
Merge pull request #7970 from hashicorp/go1.14.3
Go1.14.3
2020-05-16 11:33:15 -04:00
Michael Schurter ca9907a967 build: update from Go 1.14.1 to Go 1.14.3 2020-05-16 10:41:20 -04:00
Michael Schurter 7e0f0f75d0 scripts: add usage to update_golang_version.sh 2020-05-16 10:40:11 -04:00
tcassaert feba5384ff
Command was missing due to missing end of line 2020-05-16 12:49:18 +02:00
Michael Lange 15e5bd2dd2 Add missing bug fix from the changelog for 0.11.2 2020-05-15 16:58:07 -07:00
Mahmood Ali be6cc94346
fix grammar in DST upgrade snippet (#7985) 2020-05-15 15:59:56 -04:00
Spencer Owen 6b37144cb5
Fix typo in changelog
Removes duplicate entry in the change log
2020-05-15 13:02:39 -06:00
Buck Doyle 86cf076a3c
Remove Ember server from Storybook startup (#7980)
The presence of Storybook’s preview-head.html file in the repository
is a constant annoyance: it’s only needed for Storybook and it changes
all the time, producing a lot of Git noise. By making it a separate
step to have the Ember CLI server running before starting Storybook,
we no longer need to have preview-head in the repository. It needed to
be present because there was a race condition where it was sometimes
not generated in time for the Storybook parallel startup.
2020-05-15 13:53:31 -05:00
Mahmood Ali 11db5392f8
Merge pull request #7982 from hashicorp/mdeggies-remove-appveyor
Windows CircleCI Follow
2020-05-15 13:57:41 -04:00
Mahmood Ali f8cb5719f4 revert vendored file accidental changes
[ci skip]
2020-05-15 13:37:03 -04:00
Mahmood Ali bbb341ec66 quiet unzip 2020-05-15 13:19:21 -04:00
Mahmood Ali 3441cdf00e Predownload image before tests start 2020-05-15 12:55:53 -04:00
Mahmood Ali 34b22047b7 Use an image managed by nomad account
This is a retag of stefanscherer/busybox-windows@sha256:af396324c4c62e369a388ebb38d4efd44211dc7c95a438e6feb62b4ae4194c5b
2020-05-15 12:55:22 -04:00