Commit Graph

20418 Commits

Author SHA1 Message Date
Tim Gross c320c1ba57
CSI: fix struct copying errors (#9239)
The CSIVolume struct "denormalizes" allocations when it's first queried from
the state store. The CSIVolumeByID method on the state store copies the volume
before denormalizing so that we don't end up with unexpected changes. The
copying has some subtle bugs that meant that Allocations (as well as
Topologies and MountOptions) were not getting copied when expected.

Also, ensure we never write allocations attached to volumes to the state store
during claims.
2020-11-18 10:59:25 -05:00
Chris Baker 6a4cdc3bb1
Merge pull request #9387 from hashicorp/docs-9386-alloc-job-api
document `api.Allocation.Job` field
2020-11-18 09:57:28 -06:00
Chris Baker c8364656e6 document `api.Allocation.Job` field, to address issue from #9386 2020-11-18 15:00:52 +00:00
Michael Schurter ff91bba70e client: fix interpolation in template source
While Nomad v0.12.8 fixed `NOMAD_{ALLOC,TASK,SECRETS}_DIR` use in
`template.destination`, interpolating these variables in
`template.source` caused a path escape error.

**Why not apply the destination fix to source?**

The destination fix forces destination to always be relative to the task
directory. This makes sense for the destination as a destination outside
the task directory would be unreachable by the task. There's no reason
to ever render a template outside the task directory. (Using `..` does
allow destinations to escape the task directory if
`template.disable_file_sandbox = true`. That's just awkward and unsafe
enough I hope no one uses it.)

There is a reason to source a template outside a task
directory. At least if there weren't then I can't think of why we
implemented `template.disable_file_sandbox`. So v0.12.8 left the
behavior of `template.source` the more straightforward "Interpolate and
validate."

However, since outside of `raw_exec` every other driver uses absolute
paths for `NOMAD_*_DIR` interpolation, this means those variables are
unusable unless `disable_file_sandbox` is set.

**The Fix**

The variables are now interpolated as relative paths *only for the
purpose of rendering templates.* This is an unfortunate special case,
but reflects the fact that the templates view of the filesystem is
completely different (unconstrainted) vs the task's view (chrooted).
Arguably the values of these variables *should be context-specific.*
I think it's more reasonable to think of the "hack" as templating
running uncontainerized than that giving templates different paths is a
hack.

**TODO**

- [ ] E2E tests
- [ ] Job validation may still be broken and prevent my fix from
      working?

**raw_exec**

`raw_exec` is actually broken _a different way_ as exercised by tests in
this commit. I think we should probably remove these tests and fix that
in a followup PR/release, but I wanted to leave them in for the initial
review and discussion. Since non-containerized source paths are broken
anyway, perhaps there's another solution to this entire problem I'm
overlooking?
2020-11-17 22:03:04 -08:00
Michael Schurter cb9f9800bf docs: document artifact bug #6929 2020-11-17 22:00:21 -08:00
Kris Hicks bb82e45363
doc: Simplify "Contributing" section of README (#9378)
This is mostly switching paragraphs to bullets to make following
instructions easier. In doing so, this also adds instructions to install
things that were previously assumed to be installed, like Vagrant,
Virtualbox, and Consul.

It also removes the expectation that Nomad is cloned to $GOPATH, as that
is not necessary.
2020-11-17 11:20:38 -08:00
Nick Ethier b84273fd93
Merge pull request #9363 from 42wim/fixcni
cni: use correct interface for netStatus
2020-11-17 12:03:39 -05:00
Kris Hicks 511c2e9db2
proto: Switch to using buf (#9308)
This replaces all usage of `protoc` with `buf`. See `tools/buf/README.md` for more.
2020-11-17 07:01:48 -08:00
Chris Baker afe6fa82c2
Merge pull request #9368 from hashicorp/b-9367-duped-ports
fix duplication of ports in `AllocatedResources`
2020-11-16 11:41:34 -06:00
Chris Baker a207050f01 changelog for #9368 2020-11-16 16:52:40 +00:00
Tim Gross a1532d7cf8
vendor: sync api/tasks for poststop hook 2020-11-16 11:28:02 -05:00
Seth Hoenig 6eda03fd62
Merge pull request #9356 from hashicorp/b-bridgefp-upgrade-path
scheduler: enable upgrade path for bridge network finger print
2020-11-16 09:29:03 -06:00
James Rasell 5811052344
Merge pull request #9372 from hashicorp/f-docs-move-ruby-sdk-unsupported
docs: move Ruby SDK to unsupported listing.
2020-11-16 15:58:35 +01:00
Tim Gross a788557579
csi: alloc status -verbose should query volume request 'source' (#9354)
The `nomad alloc status -verbose` command returns a 404 from CSI volumes
because the volume mount block in the task points back to the
`job.group.volume` block. So using the `Name` field to query is the "name" as
seen in the jobspec, and not the name of the volume that we need for querying.

Show both the job-specific name and the volume ID in the resulting output,
which clarifies the difference between the two fields and is more consistent
with the web UI.
2020-11-16 08:28:52 -05:00
James Rasell 4b34e705f6
docs: Add new Autoscaling Azure VMSS target plugin detail. (#9186)
Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
2020-11-16 11:40:22 +01:00
James Rasell f9480ca147
docs: move Ruby SDK to unsupported listing. 2020-11-16 11:38:27 +01:00
Chris Baker 7c6071e6c4 updated alloc_endpoint to mutate a copy of the returned allocation, instead of the instance in the state store 2020-11-15 17:52:50 +00:00
Chris Baker b244d5e949 documenting test for #9367 2020-11-15 17:47:50 +00:00
Chris Baker 7390298783
Merge pull request #9365 from hashicorp/website-to-beta3
website: update downloads page to beta3
2020-11-15 09:22:18 -06:00
Chris Baker e529e95594 website: update downloads page to beta3 2020-11-15 13:53:05 +00:00
Wim 4e37897dd9 Use correct interface for netStatus
CNI plugins can return multiple interfaces, eg the bridge plugin.
We need the interface with the sandbox.
2020-11-14 22:29:30 +01:00
Tim Gross 8df5f28dc3
ui/csi: fix links to volume IDs (#9355) 2020-11-13 15:44:34 -05:00
Seth Hoenig 6b89527505 scheduler: enable upgrade path for bridge network finger print
This PR enables users of Nomad < 0.12 to upgrade to Nomad 0.12
and beyond. Nomad 0.12 introduced a network fingerprinter for
bridge networks, which is a contstraint checked for if bridge
network is being used. If users upgrade servers first as is
recommended, suddenly no clients running older versions of Nomad
will satisfy the bridge network resource constraint. Instead,
this change only enforces the constraint if the Nomad client
version is also >= 0.12.

Closes #8423
2020-11-13 14:17:01 -06:00
Seth Hoenig 4cc3c01d5b
Merge pull request #9352 from hashicorp/f-artifact-headers
jobspec: add support for headers in artifact stanza
2020-11-13 14:04:27 -06:00
Tim Gross 14215c80c6
hclfmt digitalocean demo to pass linting (#9353) 2020-11-13 14:16:15 -05:00
Seth Hoenig bb8a5816a0 jobspec: add support for headers in artifact stanza
This PR adds the ability to set HTTP headers when downloading
an artifact from an `http` or `https` resource.

The implementation in `go-getter` is such that a new `HTTPGetter`
must be created for each artifact that sets headers (as opposed
to conveniently setting headers per-request). This PR maintains
the memoization of the default Getter objects, creating new ones
only for artifacts where headers are set.

Closes #9306
2020-11-13 12:03:54 -06:00
Tim Gross bc03133479
demo: CSI example for DigitalOcean block storage (#9351) 2020-11-13 12:26:04 -05:00
Mahmood Ali 1d3fa2afaa
release: infer node version (#9336)
Avoids setting the node version in the release Dockerfile, by using
an alias.  This allows us to update the node version in one file only.

Co-authored-by: Michael Schurter <mschurter@hashicorp.com>
2020-11-13 11:33:07 -05:00
Tim Gross 7e4fd79eee
e2e: CSI test should detect un-deregisterable volumes (#9343)
Assert that deregistering a volume works without errors following a volume
reap. Use CLI helpers where feasible to exercise CSI command line. Dump plugin
allocation logs on deregistration failures for debugging purposes.
2020-11-13 09:31:21 -05:00
Lars Lehtonen 60936f554c
nomad/structs: fix noop breaks (#9348) 2020-11-13 08:28:11 -05:00
Michael Schurter d38f3e6e04
Merge pull request #9345 from hashicorp/go-1.15.5
build: upgrade from Go 1.15.4 to 1.15.5
2020-11-12 14:41:10 -08:00
Michael Schurter 156410807f docs: mention upgrade to Go 1.15.5 2020-11-12 14:23:32 -08:00
Michael Schurter 65175d15cc build: upgrade from Go 1.15.4 to 1.15.5
Despite being a security release for Go, we do not believe Nomad is
impacted.
2020-11-12 14:19:26 -08:00
Michael Lange 65d2d28fc9
Merge pull request #8807 from hashicorp/f-ui/lifecycle-poststop
UI: Task lifecycle poststop phase.
2020-11-12 09:50:24 -08:00
Michael Lange c041236629 Fix flaky lifecycle chart tests 2020-11-12 09:16:53 -08:00
Michael Lange f543137ec9 Revert "Temporarily remove poststop from the UI"
This reverts commit f8a505ea2f9def2a7ce7a93e6d0529e1b5da4894.
2020-11-12 09:16:52 -08:00
Jasmine Dahilig 19640c8588
Merge pull request #9340 from hashicorp/changelog-poststop
changelog: added poststop to task lifecycle
2020-11-12 09:04:35 -08:00
Mahmood Ali d9a9950854
Merge pull request #9339 from hashicorp/b-hcl2-job-tweaks
Restrict HCL special casing of map[string]interface{} fields
2020-11-12 11:59:45 -05:00
Jasmine Dahilig aa5587f5df changelog: added poststop to task lifecycle 2020-11-12 08:56:46 -08:00
Mahmood Ali 1798523a78 appease deadcode linter 2020-11-12 11:44:49 -05:00
Mahmood Ali 73af6fd220 Restrict HCL special casing of map[string]interface{} fields
The HCL2 parser needs to apply special parsing tweaks so it can parse
the task config the same way as HCL1. Particularly, it needs to
reinterprets `map[string]interface{}` fields and blocks that appear when
attributes are expected.

This commit restricts the special casing to the Job fields, and ignore
`variables` and `locals` block.
2020-11-12 11:35:39 -05:00
Dave May e89302aa4b
nomad operator debug - add client node filtering arguments (#9331)
* operator debug - add client node filtering arguments

* add WaitForClient helper function

* use RPC in WaitForClient to avoid unnecessary imports

* guard against nil values

* move initialization up and shorten test duration

* cleanup nodeLookupFailCount logic

* only display max node notice if we actually tried to capture nodes
2020-11-12 11:25:28 -05:00
Jasmine Dahilig d6110cbed4
lifecycle: add poststop hook (#8194) 2020-11-12 08:01:42 -08:00
Seth Hoenig 41bcc26940
Merge pull request #9338 from hashicorp/d-update-client-subnet
docs: update brige network subnet docs
2020-11-12 09:59:24 -06:00
Seth Hoenig f7e5fc65c7 docs: update brige network subnet docs
Update the default value for `client.bridge_network_subnet` in docs
to match the new value from 99742f2665. Was `172.26.66.0/23`, is
now `172.26.64.0/20`.

Fixes #9316
2020-11-12 09:11:24 -06:00
Mahmood Ali 34d7d3b3d6
Merge pull request #9334 from hashicorp/b-pin-node-version
ui: Pin ui node version
2020-11-12 09:18:37 -05:00
Mahmood Ali 6907c8df19
Merge pull request #9335 from hashicorp/docs-assorted-changes-20201112
Assorted changelog and docs changes
2020-11-12 08:50:17 -05:00
Mahmood Ali ed6968ade8 changelog: Update 0.12.8 and backported releases 2020-11-12 08:41:03 -05:00
Mahmood Ali bd654c4020 tweak 1.0 changelog 2020-11-12 08:40:49 -05:00
Mahmood Ali 25281a88e7 driver/docker: mark cpusets as beta
The cpuset_cpus flag may be subject to change when we revise cpu
management. Also, it's only available in 1.0.0 Beta.
2020-11-12 08:28:50 -05:00