Michael Schurter
85073f9d29
client: properly support hook env vars
...
The old approach was incomplete. Hook env vars are now:
* persisted and restored between agent restarts
* deterministic (LWW if 2 hooks set the same key)
2018-11-27 17:25:33 -08:00
Alex Dadgar
4ee603c382
Device hook and devices affect computed node class
...
This PR introduces a device hook that retrieves the device mount
information for an allocation. It also updates the computed node class
computation to take into account devices.
TODO Fix the task runner unit test. The environment variable is being
lost even though it is being properly set in the prestart hook.
2018-11-27 17:25:33 -08:00
Michael Schurter
e565c63eed
gofmt -s -w drivers/rkt/driver_test.go
2018-11-27 17:24:23 -08:00
Michael Schurter
27e07f657e
Merge pull request #4896 from hashicorp/b-prevalloc-deadlock
...
Fix deadlock in previous alloc watcher by emitting last alloc update
2018-11-27 19:07:16 -06:00
Michael Schurter
b75f79a793
fix test breakage caused by rebase
2018-11-27 16:34:01 -08:00
Michael Schurter
91da566935
fix mispelings
2018-11-27 16:33:55 -08:00
Chris Baker
a1fb1f3830
Merge pull request #4891 from hashicorp/b-1150-rkt-volume-names
...
drivers/rkt: fix invalid volumes
2018-11-27 18:55:00 -05:00
Chris Baker
c0bc9d069d
change to docs in the driver proto to reflect standard pattern
2018-11-27 23:52:24 +00:00
Danielle Tomlinson
3651dbdc25
Merge pull request #4909 from hashicorp/b-restart-delay
...
taskrunner: Return the restart delay correctly
2018-11-27 23:55:54 +01:00
Michael Schurter
22149a661e
client: comment on importance of chan ops ordering
2018-11-27 14:11:32 -08:00
Mahmood Ali
05a958dc21
Update client/structs/broadcaster.go
...
Co-Authored-By: schmichael <michael.schurter@gmail.com>
2018-11-27 14:06:08 -08:00
Michael Schurter
81b6a24a84
client: fix send-after-close in broadcaster
2018-11-27 14:06:08 -08:00
Michael Schurter
c429e6b0ab
client: check if prev alloc is already terminated
...
This is a defensive fast-path as 7c6aa0be already fixed the deadlock.
2018-11-27 14:06:08 -08:00
Michael Schurter
944ea6d38b
client: emit last sent alloc to new listeners
...
Fixes a deadlock where the allocwatcher would block forever waiting for
an update from a terminal alloc.
Made the broadcaster easier to debug as well.
2018-11-27 14:06:08 -08:00
Michael Schurter
1e4ef139dd
Merge pull request #4883 from hashicorp/f-graceful-shutdown
...
Support graceful shutdowns in agent
2018-11-27 15:55:15 -06:00
Omar Khawaja
77945c9e4f
New Nomad Vault Integration Guide ( #4886 )
...
* add vault integration guide in guides section and move current vault integration content to docs section
* complete guide with image
* fix typos
* rename step 6 and fix typos
* fix typos and awkward phrasing along with links
* fix duplicated step #
* fix typo
* fix links so that pages that pointed to the original vault integration content still point there
2018-11-27 10:28:01 -05:00
Preetha Appan
b9a22f8047
Fix panic in test setup when task does not have resources
...
This affects exec/rawexec drivers
2018-11-26 21:42:45 -06:00
Preetha Appan
125869686b
Fix nil dereference in copy method
2018-11-26 15:53:15 -06:00
Chris Baker
3dd6ba514a
drivers/rkt: updated test to include new AllocID field in TaskConfig
2018-11-26 21:37:58 +00:00
Michael Schurter
4f7e6f9464
client: fix races in use of goroutine group
...
The group utility struct does not support asynchronously launched
goroutines (goroutines-inside-of-goroutines), so switch those uses to a
normal go call.
This means watchNodeUpdates and watchNodeEvents may not be shutdown when
Shutdown() exits. During nomad agent shutdown this does not matter.
During tests this means a test may leak those goroutines or be unable to
know when those goroutines have exited.
Since there's no runtime impact and these goroutines do not affect alloc
state syncing it seems ok to risk leaking them.
2018-11-26 12:52:55 -08:00
Michael Schurter
9f43fb6d29
client: reuse group instead of diy'ing it
2018-11-26 12:52:31 -08:00
Michael Schurter
22771aa19e
client/ar: remove useless wait ch from runTasks
...
Arguably this makes task.WaitCh() useless, but I think exposing a wait
chan from TaskRunners is a generically useful API.
2018-11-26 12:51:18 -08:00
Michael Schurter
2fdd013956
client: document how AR/TR Run methods behave
2018-11-26 12:50:35 -08:00
Omar Khawaja
be1c2e6624
Move current telemetry page to docs ( #4898 )
...
* move current telemetry page to docs
* fix broken links to telemetry doc
2018-11-26 15:18:57 -05:00
Chris Baker
9bd4317139
modified TaskConfig to include AllocID
...
use this for volume names in drivers/rkt to address #1150
2018-11-26 18:54:26 +00:00
Mahmood Ali
71249a28fc
Merge pull request #4917 from hashicorp/r-docker-plugin-followup-1
...
Fix linter job
2018-11-25 15:35:51 -05:00
Mahmood Ali
141092e46d
Formatting and typo fixes
2018-11-25 11:53:21 -05:00
Mahmood Ali
c61d99b525
Merge pull request #4908 from hashicorp/f-docker-opts-storageopt
...
Add support for docker storage options
2018-11-20 21:08:27 -05:00
Nick Ethier
95362eaa02
Merge pull request #4844 from hashicorp/f-docker-plugin
...
Docker driver plugin
2018-11-20 20:43:03 -05:00
Nick Ethier
1f3fe02e62
docker: sync access to exit result within a handle
2018-11-20 20:41:32 -05:00
Michael Schurter
2275153875
Apply suggestions from code review
...
Co-Authored-By: nickethier <ncethier@gmail.com>
2018-11-20 20:33:31 -05:00
Mahmood Ali
e2098a9fa3
Merge pull request #4817 from hashicorp/b-vault-client-tweaks
...
Vault API Client Tweaks
2018-11-20 18:31:49 -05:00
Mahmood Ali
2e6133fd33
nil secrets as recoverable to keep renew attempts
2018-11-20 17:11:55 -05:00
Mahmood Ali
5827438983
Renew past recorded expiry till unrecoverable error
...
Keep attempting to renew Vault token past locally recorded expiry, just
in case the token was renewed out of band, e.g. on another Nomad server,
until Vault returns an unrecoverable error.
2018-11-20 17:10:55 -05:00
Mahmood Ali
5836a341dd
fix typo
2018-11-20 17:10:55 -05:00
Mahmood Ali
93add67e04
round ttl duration for users
2018-11-20 17:10:55 -05:00
Mahmood Ali
4a0544b369
Track renewal expiration properly
2018-11-20 17:10:55 -05:00
Mahmood Ali
79aa934a4b
reconcile interface
2018-11-20 17:10:55 -05:00
Mahmood Ali
6efea6d8fc
Populate agent-info with vault
...
Return Vault TTL info to /agent/self API and `nomad agent-info` command.
2018-11-20 17:10:55 -05:00
Mahmood Ali
6034af5084
Avoid explicit precomputed stats field
...
Seems like the stats field is a micro-optimization that doesn't justify
the complexity it introduces. Removing it and computing the stats from
revoking field directly.
2018-11-20 17:10:54 -05:00
Mahmood Ali
14842200ec
More metrics for Server vault
...
Add a gauge to track remaining time-to-live, duration of renewal request API call.
2018-11-20 17:10:54 -05:00
Mahmood Ali
e1994e59bd
address review comments
2018-11-20 17:10:54 -05:00
Mahmood Ali
35179c9655
Wrap Vault API api errors for easing debugging
2018-11-20 17:10:54 -05:00
Mahmood Ali
171b73fde7
Emit metric counters for Vault token and renewal failures
2018-11-20 17:10:54 -05:00
Mahmood Ali
55456fc823
Set a 1s floor for Vault renew operation backoff
2018-11-20 17:10:54 -05:00
Mahmood Ali
5b10da5de6
Set User-Agent header when hitting Vault API
2018-11-20 17:10:54 -05:00
Preetha
789b1e5b6d
Merge pull request #4911 from hashicorp/add-circleci-master
...
Add CircleCI configuration for website build
2018-11-20 16:01:57 -06:00
Alvin Huang
25601a8a57
remove packer.json since CircleCI builds the site
2018-11-20 16:59:42 -05:00
Alvin Huang
436229fd31
add circleci website build
2018-11-20 16:59:34 -05:00
Mahmood Ali
841c1ec79b
document storage opts
2018-11-20 16:11:02 -05:00