Commit Graph

592 Commits

Author SHA1 Message Date
Danielle Tomlinson
cf08f85413 api: Validate the slash variant of a given path
This validates the slash variant of a RelativeDest, rather than the
platform native version, to support test execution on windows.
2019-01-17 18:43:13 +01:00
Preetha Appan
7cdaf6e37d Make spread weight a pointer with default value if unset 2019-01-11 10:31:21 -06:00
Michael Schurter
4a70644df0 drain: fix node drain monitoring
The whole approach to monitoring drains has ordering issues and lacks
state to output useful error messages.

AFAICT to get the tests passing reliably I needed to change the behavior
of monitoring.

Parts of these tests are skipped in CI, and they should be rewritten as
e2e tests.
2019-01-08 09:35:16 -08:00
Nick Ethier
145827d8b7 fix tests that fail as a result of async client startup 2018-12-20 00:53:44 -05:00
Mahmood Ali
313fc5f10d Merge pull request #4978 from hashicorp/f-device-tweaks
Display device attributes in `nomad node status -verbose`
2018-12-12 19:45:07 -05:00
Mahmood Ali
40164b3dc6 Use max 3 precision in displaying floats
When formating floats in `nomad node status`, use a maximum precision of
3.
2018-12-10 12:18:24 -05:00
Mahmood Ali
a802984c9a device attributes in nomad node status -verbose
This reports device attributes like the following:

```
$ nomad node status -self -verbose
ID          = f7adb958-29e1-2a5a-2303-9d61ffaab33a
Name        = mars.local
Class       = <none>
DC          = dc1
Drain       = false
Eligibility = eligible
Status      = ready
Uptime      = 12h40m13s

Drivers
Driver       Detected  Healthy  Message                               Time
docker       true      true     healthy                               2018-12-10T11:47:19-05:00
...

Attributes
cpu.arch                      = amd64
cpu.frequency                 = 2200
cpu.modelname                 = Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
cpu.numcores                  = 12
...

Device Group Attributes
Device Group = nomad/file/mock
block_device = sda1
filesystem   = ext4
size         = 63.2 GB

Meta
```
2018-12-10 12:18:24 -05:00
Alex Dadgar
0953d913ed Deprecate IOPS
IOPS have been modelled as a resource since Nomad 0.1 but has never
actually been detected and there is no plan in the short term to add
detection. This is because IOPS is a bit simplistic of a unit to define
the performance requirements from the underlying storage system. In its
current state it adds unnecessary confusion and can be removed without
impacting any users. This PR leaves IOPS defined at the jobspec parsing
level and in the api/ resources since these are the two public uses of
the field. These should be considered deprecated and only exist to allow
users to stop using them during the Nomad 0.9.x release. In the future,
there should be no expectation that the field will exist.
2018-12-06 15:09:26 -08:00
Mahmood Ali
58cbafe913 Populate alloc stats API with device stats
This change makes few compromises:

* Looks up the devices associated with tasks at look up time.  Given
that `nomad alloc status` is called rarely generally (compared to stats
telemetry and general job reporting), it seems fine.  However, the
lookup overhead grows bounded by number of `tasks x total-host-devices`,
which can be significant.

* `client.Client` performs the task devices->statistics lookup.  It
passes self to alloc/task runners so they can look up the device statistics
allocated to them.
  * Currently alloc/task runners are responsible for constructing the
entire RPC response for stats
  * The alternatives for making task runners device statistics aware
don't seem appealing (e.g. having task runners contain reference to hostStats)

* On the alloc aggregation resource usage, I did a naive merging of task device statistics.
  * Personally, I question the value of such aggregation, compared to
costs of struct duplication and bloating the response - but opted to be
consistent in the API.
  * With naive concatination, device instances from a single device group used by separate tasks in the alloc, would be aggregated in two separate device group statistics.
2018-11-16 10:26:32 -05:00
Mahmood Ali
276149eaa7 device stats summary in node status
Sample output with a mock device:

```
Host Resource Utilization
CPU             Memory          Disk
2651/26400 MHz  9.6 GiB/16 GiB  98 GiB/234 GiB

Device Resource Utilization
nomad/file/mock[README.md]    511 bytes
nomad/file/mock[e2e.go]       239 bytes
nomad/file/mock[e2e_test.go]  128 bytes

Allocations
No allocations placed
```
2018-11-14 22:13:23 -05:00
Mahmood Ali
c212716dda Add NodeResource Device types in api package 2018-11-14 14:42:36 -05:00
Mahmood Ali
ba3fe15f7e Add Client Device Stats structs in api package 2018-11-14 14:41:19 -05:00
Preetha Appan
3eeb229116 change path to v1/scheduler/configuration 2018-11-12 15:57:45 -06:00
Preetha Appan
1fe9203aa6 Use response object/querymeta/writemeta in scheduler config API 2018-11-10 10:31:10 -06:00
Preetha Appan
6bb8e5aa58 Show preemption output in plan CLI 2018-11-08 09:48:43 -06:00
Preetha Appan
35d31f8be6 more minor review feedback 2018-11-01 17:05:17 -05:00
Preetha Appan
88005852e3 Introduce a response object for scheduler configuration 2018-10-30 11:06:32 -05:00
Preetha Appan
191b8626d2 More review comments 2018-10-30 11:06:32 -05:00
Preetha Appan
6966e3c3e8 Make preemption config a struct to allow for enabling based on scheduler type 2018-10-30 11:06:32 -05:00
Preetha Appan
784b96c104 Support for new scheduler config API, first use case is to disable preemption 2018-10-30 11:06:32 -05:00
Preetha Appan
bf7192c58d Add number of evictions to DesiredUpdates struct to use in CLI/API 2018-10-30 11:06:32 -05:00
Preetha Appan
5f27e0010d structs and API changes to plan and alloc structs needed for preemption 2018-10-30 11:06:32 -05:00
Alex Dadgar
262ccbcc10 rename api TotalShares -> CpuShares 2018-10-16 17:25:55 -07:00
Alex Dadgar
5e67b37aad use int64 2018-10-16 15:34:32 -07:00
Preetha Appan
3ca71ae935 Change CPU/Disk/MemoryMB to int everywhere in new resource structs 2018-10-16 16:21:42 -05:00
Alex Dadgar
e9ddf2c533 parse affinities and constraints on devices 2018-10-11 14:05:19 -07:00
Alex Dadgar
e47ddbdd9f parse devices 2018-10-08 16:09:41 -07:00
Alex Dadgar
8b9b77dd59 Define device request structs 2018-10-08 15:38:03 -07:00
Alex Dadgar
49c2d4f775 Scheduler uses allocated resources 2018-10-02 17:08:25 -07:00
Alex Dadgar
f969298854 Node reserved resources 2018-09-29 18:44:55 -07:00
Alex Dadgar
b310a54aa6 Node resources on client 2018-09-29 17:23:41 -07:00
Alex Dadgar
a5a26db04a Merge pull request #4642 from hashicorp/b-vet
Fix vet errors and use newer go version in travis
2018-09-04 17:04:02 -07:00
Alex Dadgar
da0bec03c1 Fix make check errors 2018-09-04 16:03:52 -07:00
Preetha Appan
a2284d0f3e code review feedback 2018-09-04 16:10:11 -05:00
Preetha Appan
f6cbfbfef6 Track top k nodes by norm score rather than top k nodes per scorer 2018-09-04 16:10:11 -05:00
Preetha Appan
4d68d935e4 Use heap to store top K scoring nodes.
Scoring metadata is now aggregated by scorer type to make it easier
to parse when reading it in the CLI.
2018-09-04 16:10:11 -05:00
Preetha Appan
ed4ed16b5d Parsing and API layer for spread stanza 2018-09-04 16:10:11 -05:00
Preetha Appan
0cd73bdce0 Fix test 2018-09-04 16:10:11 -05:00
Preetha Appan
f907c42ba5 More review comments 2018-09-04 16:10:11 -05:00
Preetha Appan
1774aa2526 Remove unused field 2018-09-04 16:10:11 -05:00
Preetha Appan
8f2d5742c4 Affinity parsing, api and structs 2018-09-04 16:10:11 -05:00
Nick Ethier
8e453d0b8f nomad: add 'Dispatch' field to Job
New -bash: Dispatch: command not found field is used to denote if the Job is a child dispatched job of
a parameterized job.
2018-06-11 11:59:03 -04:00
Alex Dadgar
3402f2539f code review 2018-06-06 14:52:26 -07:00
Alex Dadgar
3c9ad243a4 Monitoring non-draining node exits 2018-06-05 17:58:44 -07:00
Alex Dadgar
269ad04c08 Merge pull request #4354 from hashicorp/b-job-modify
Deployment adds JobSpecModifyIndex
2018-05-31 17:57:38 +00:00
Alex Dadgar
a5d0fe6574 code review fixes 2018-05-31 10:57:08 -07:00
Preetha Appan
bcf34c3449 Set node eligibility to true when old client calls disable 2018-05-30 16:54:07 -05:00
Alex Dadgar
b683439b0d Deployment adds JobSpecModifyIndex
Deployment tracks the Job.JobModifyIndex so that PUTS against /v1/jobs
can be more easily coorelated with the created deployment.

Fixes https://github.com/hashicorp/nomad/issues/4301
2018-05-30 11:33:56 -07:00
Nick Ethier
faeb612bd9 api: emit different monitor message if node's drain strategy is never set 2018-05-24 06:39:09 -04:00
Preetha
447527ab2b Merge pull request #4274 from hashicorp/f-force-rescheduling
Add CLI and API support for forcing rescheduling of failed allocs
2018-05-21 16:24:22 -07:00