Commit Graph

56 Commits

Author SHA1 Message Date
hashicorp-copywrite[bot]
2d35e32ec9 Update copyright file headers to BUSL-1.1 2023-08-10 17:27:15 -05:00
Seth Hoenig
a4cc76bd3e numa: enable numa topology detection (#18146)
* client: refactor cgroups management in client

* client: fingerprint numa topology

* client: plumb numa and cgroups changes to drivers

* client: cleanup task resource accounting

* client: numa client and config plumbing

* lib: add a stack implementation

* tools: remove ec2info tool

* plugins: fixup testing for cgroups / numa changes

* build: update makefile and package tests and cl
2023-08-10 17:05:30 -05:00
hashicorp-copywrite[bot]
f005448366 [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
Michael Schurter
d677b48625 fingerprint: lengthen Vault check after seen (#14693)
Extension of #14673

Once Vault is initially fingerprinted, extend the period since changes
should be infrequent and the fingerprint is relatively expensive since
it is contacting a central Vault server.

Also move the period timer reset *after* the fingerprint. This is
similar to #9435 where the idea is to ensure the retry period starts
*after* the operation is attempted. 15s will be the *minimum* time
between fingerprints now instead of the *maximum* time between
fingerprints.

In the case of Vault fingerprinting, the original behavior might cause
the following:

1. Timer is reset to 15s
2. Fingerprint takes 16s
3. Timer has already elapsed so we immediately Fingerprint again

Even if fingerprinting Vault only takes a few seconds, that may very
well be due to excessive load and backing off our fingerprints is
desirable. The new bevahior ensures we always wait at least 15s between
fingerprint attempts and should allow some natural jittering based on
server load and network latency.
2022-09-26 12:14:19 -07:00
James Rasell
ab9ba35e6a chore: fixup inconsistent method receiver names. (#11704) 2021-12-20 11:44:21 +01:00
Michael Schurter
f44c04ecd1 s/0.13/1.0/g
1.0 here we come!
2020-10-14 15:17:47 -07:00
Yoan Blanc
c14c616194 use allow/deny instead of the colored alternatives (#9019)
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-10-12 08:47:05 -04:00
Nick Ethier
33ce12cda9 CNI Implementation (#7518) 2020-06-18 11:05:29 -07:00
Michael Schurter
158c74887e goimports until make check is happy 2019-01-23 06:27:14 -08:00
Michael Schurter
0d61ff0fb9 move pluginutils -> helper/pluginutils
I wanted a different color bikeshed, so I get to paint it
2019-01-22 15:50:08 -08:00
Alex Dadgar
c19cd2e5cf loader and singleton 2019-01-22 15:11:57 -08:00
Nick Ethier
39ca1b00dd client/drivermananger: add driver manager
The driver manager is modeled after the device manager and is started by the client.
It's responsible for handling driver lifecycle and reattachment state, as well as
processing the incomming fingerprint and task events from each driver. The mananger
exposes a method for registering event handlers for task events that is used by the
task runner to update the server when a task has been updated with an event.

Since driver fingerprinting has been implemented by the driver manager, it is no
longer needed in the fingerprint mananger and has been removed.
2018-12-18 22:55:18 -05:00
Danielle Tomlinson
da48a7eab3 client: Move fingerprint structs to pkg
This removes a cyclical dependency when importing client/structs from
dependencies of the plugin_loader, specifically, drivers. Due to
client/config also depending on the plugin_loader.

It also better reflects the ownership of fingerprint structs, as they
are fairly internal to the fingerprint manager.
2018-12-01 17:10:39 +01:00
Preetha Appan
829bf74aa8 modify fingerprint interface to use typed attribute struct 2018-11-28 10:01:03 -06:00
Nick Ethier
3244a4cc57 plumb NomadConfig into plugins 2018-10-16 22:47:22 -04:00
Nick Ethier
19b222b127 client: log retry during driver fingerprint redispense 2018-10-16 16:56:56 -07:00
Nick Ethier
2e055fe18a client: add test for driverfailure during fingerprinting 2018-10-16 16:56:56 -07:00
Nick Ethier
44cc52a0d4 client: simplify driver plugin logic from review comments 2018-10-16 16:56:56 -07:00
Nick Ethier
4f9522dd54 client: review comments and fixup/skip tests 2018-10-16 16:56:56 -07:00
Nick Ethier
d335a82859 client: begin driver plugin integration
client: fingerprint driver plugins
2018-10-16 16:56:56 -07:00
Alex Dadgar
9a2c2a4f68 client uses passed logger and fix fingerprinters 2018-10-16 16:53:30 -07:00
Michael Schurter
9da25adc54 client: hclog-ify most of the client
Leaving fingerprinters in case that interface changes with plugins.
2018-10-16 16:53:30 -07:00
Javier Palomo Almena
3e6c3437af DriverContext: Add the TaskGroup and the Job name
Adding this fields to the DriverContext object, will allow us to pass
them to the drivers.

An use case for this, will be to emit tagged metrics in the drivers,
which contain all relevant information:
- Job
- TaskGroup
- Task
- ...

Ref: https://github.com/hashicorp/nomad/pull/4185
2018-04-23 00:15:29 +02:00
Alex Dadgar
741975657d fix race node access 2018-04-16 15:45:51 -07:00
Alex Dadgar
e0171acbdd Move where attribute for driver detection is set 2018-04-12 15:50:25 -07:00
Chelsea Holland Komlo
228a2319c2 delete driver name from only health check attributes 2018-04-12 18:24:41 -04:00
Alex Dadgar
f45b51a138 Driver health detection cleanups
This PR does:

1. Health message based on detection has format "Driver XXX detected"
and "Driver XXX not detected"
2. Set initial health description based on detection status and don't
wait for the first health check.
3. Combine updating attributes on the node, fingerprint and health
checking update for drivers into a single call back.
4. Condensed driver info in `node status` only shows detected drivers
and make the output less wide by removing spaces.
2018-04-12 12:46:40 -07:00
Chelsea Holland Komlo
a40750e596 update comment for when the fingerprinter setting health status 2018-04-10 16:53:00 -04:00
Chelsea Holland Komlo
46ec4633fe fingerprinter should set health check status if health check is not periodic 2018-04-10 15:29:51 -04:00
Chelsea Holland Komlo
9eaa1e7c9e add setters for access to the fingerprint manager's node
refactor extracting driver info
2018-04-10 15:29:51 -04:00
Chelsea Holland Komlo
49e12b1ad2 guard against overwriting health status 2018-04-10 15:29:51 -04:00
Chelsea Holland Komlo
d3f0d05ac8 immediately set healthy to false when driver moves to undetected 2018-04-10 15:29:51 -04:00
Chelsea Holland Komlo
af8fc4f62c only run health check if driver moves from undetected to detected 2018-04-09 10:10:43 -04:00
Chelsea Holland Komlo
bf3b7d8588 ux improvments to driver health checks 2018-03-22 18:38:29 -04:00
Chelsea Holland Komlo
eb3a53efa2 always set initial health status for every driver 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
127b2c6ef7 set driver to unhealthy once if it cannot be detected in periodic check 2018-03-21 15:15:26 -04:00
Alex Dadgar
ffe9292e24 Only run health check if driver is detected 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
9c143301de fix issue when updating node events 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
cba0a4d441 function rename and re-arrange functions in fingerprint_manager 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
06a306e460 improve comments; update watchDriver 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
7b2ed01472 remove unused function 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
8597da0c5d simplify logic
bump log level
2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
8aefd294e1 Code review feedback 2018-03-21 15:15:26 -04:00
Alex Dadgar
3ad03d9498 notes from walk through 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
8a0ed4e5ff improve tests 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
521fbd4f97 refresh driver information for non-health checking drivers periodically 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
240fee4848 fix up codereview feedback 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
865b7e0ace fix up racy tests 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
fd25db9e1d updating comments; locking concurrent node access 2018-03-21 15:15:26 -04:00
Chelsea Holland Komlo
9ec5a93bc1 fix scheduler driver name; create node structs file 2018-03-21 15:15:25 -04:00