51 Commits

Author SHA1 Message Date
Tim Gross
0ae5b3f39b eval status: sort plan annotations by task group (#26428)
The plan annotations table isn't sorted by task group, which makes for a less
beautiful UX and a flaky test.
2025-08-05 09:36:12 -04:00
Tim Gross
35f3f6ce41 scheduler: add disconnect and reschedule info to reconciler output (#26255)
The `DesiredUpdates` struct that we send to the Read Eval API doesn't include
information about disconnect/reconnect and rescheduling. Annotate the
`DesiredUpdates` with this data, and adjust the `eval status` command to display
only those fields that have non-zero values in order to make the output width
manageable.

Ref: https://hashicorp.atlassian.net/browse/NMD-815
2025-07-16 08:46:38 -04:00
Tim Gross
5c909213ce scheduler: add reconciler annotations to completed evals (#26188)
The output of the reconciler stage of scheduling is only visible via debug-level
logs, typically accessible only to the cluster admin. We can give job authors
better ability to understand what's happening to their jobs if we expose this
information to them in the `eval status` command.

Add the reconciler's desired updates to the evaluation struct so it can be
exposed in the API. This increases the size of evals by roughly 15% in the state
store, or a bit more when there are preemptions (but we expect this will be a
small minority of evals).

Ref: https://hashicorp.atlassian.net/browse/NMD-818
Fixes: https://github.com/hashicorp/nomad/issues/15564
2025-07-07 09:40:21 -04:00
Tim Gross
aa3c08d069 eval status: enrich with related evals and placed allocs tables (#26156)
When debugging an evaluation, you almost always want to know about all the
related evaluations and what allocations were placed by that evaluation (and
where), not just failed placements. We can enrich the command by adding the
`related` query parameter to the API, and having the command query for the
evaluations allocations automatically. Emit this data as a pair of new tables
and expose fields like quota limits, and previous/next/blocked eval without the
`-verbose` flag.

Update the docs to include the full output and remove references to long-removed
behavior of the `-json` flag.

Ref: https://hashicorp.atlassian.net/browse/NMD-818
Ref: https://go.hashi.co/rfc/nmd-212
2025-06-30 09:23:36 -04:00
Phil Renaud
35e1ea4328 [cli] UI URL hints for common CLI commands (#24454)
* Basic implementation for server members and node status

* Commands for alloc status and job status

* -ui flag for most commands

* url hints for variables

* url hints for job dispatch, evals, and deployments

* agent config ui.cli_url_links to disable

* Fix an issue where path prefix was presumed for variables

* driver uncomment and general cleanup

* -ui flag on the generic status endpoint

* Job run command gets namespaces, and no longer gets ui hints for --output flag

* Dispatch command hints get a namespace, and bunch o tests

* Lots of tests depend on specific output, so let's not mess with them

* figured out what flagAddress is all about for testServer, oof

* Parallel outside of test instances

* Browser-opening test, sorta

* Env var for disabling/enabling CLI hints

* Addressing a few PR comments

* CLI docs available flags now all have -ui

* PR comments addressed; switched the env var to be consistent and scrunched monitor-adjacent hints a bit more

* ui.Output -> ui.Warn; moves hints from stdout to stderr

* isTerminal check and parseBool on command option

* terminal.IsTerminal check removed for test-runner-not-being-terminal reasons
2025-03-07 13:23:35 -05:00
hashicorp-copywrite[bot]
a9d61ea3fd Update copyright file headers to BUSL-1.1 2023-08-10 17:27:29 -05:00
hashicorp-copywrite[bot]
f005448366 [COMPLIANCE] Add Copyright and License Headers 2023-04-10 15:36:59 +00:00
Tim Gross
d1e90a17d6 cli: remove deprecated eval status -json list behavior (#14651)
In Nomad 1.2.6 we shipped `eval list`, which accepts a `-json` flag, and
deprecated the usage of `eval status` without an evaluation ID with an upgrade
note that it would be removed in Nomad 1.4.0. This changeset completes that
work.
2022-09-22 10:56:32 -04:00
Luiz Aoqui
52389ff726 cli: improve output of eval commands (#13581)
Use the same output format when listing multiple evals in the `eval
list` command and when `eval status <prefix>` matches more than one
eval.

Include the eval namespace in all output formats and always include the
job ID in `eval status` since, even `node-update` evals are related to a
job.

Add Node ID to the evals table output to help differentiate
`node-update` evals.

Co-authored-by: James Rasell <jrasell@hashicorp.com>
2022-07-07 13:13:34 -04:00
Chris Baker
fbdbd7736c bad boolean logic for List-on-Info commands 2021-02-03 21:29:05 +00:00
Kris Hicks
85ed8ddd4f Add gosimple linter (#9590) 2020-12-09 11:05:18 -08:00
Tim Gross
89f4f51746 command: remove -namespace from help options when not applicable 2020-11-19 16:28:39 -05:00
Kris Hicks
0e09747d5b Update monitor func not to take a prefix (#9251)
The only user of monitor(evalID, true) was command/eval_status, and
eval_status had a duplicate of the prefix-handling code inside it, so in
all cases the complete evalID was being passed to monitor.

Given that, we can remove the prefix code from command/monitor, and
remove the boolean arg.
2020-11-02 10:24:49 -08:00
Jasmine Dahilig
1bdb111127 add create and modify timestamps to evaluations (#5881) 2019-08-07 09:50:35 -07:00
Nick Ethier
45b0ce9177 command: improve help text when invalid arguments are given 2018-04-18 12:02:11 -04:00
Preetha Appan
2ec37d3e61 Show wait until value in eval status if it is set 2018-04-11 14:01:42 -05:00
Alex Dadgar
66e1763107 Fix eval status output for alloc failure 2018-04-06 17:16:43 -07:00
Alex Dadgar
c7fc6571d8 use subcommands 2018-03-21 20:27:32 -07:00
Josh Soref
e1eb3e4684 spelling: sanitize 2018-03-11 18:52:59 +00:00
Alex Dadgar
a9e3a41407 Enable more linters 2017-09-26 15:26:33 -07:00
Alex Dadgar
c85e8aa02f Merge pull request #3127 from hashicorp/b-tls-api
Fix TLSServerName for Node API Client
2017-08-29 16:10:58 -07:00
Alex Dadgar
5d65af523d Check for errors initializing client for autocomplete 2017-08-29 14:29:32 -07:00
Alex Dadgar
b86e05b4a0 use helper 2017-08-29 10:04:02 -07:00
Alex Dadgar
0852c0ab3a status commands handle uuid prefixes with hyphens 2017-08-29 09:43:28 -07:00
Alex Dadgar
ce3c316592 don't limit on one arg 2017-08-28 13:40:04 -07:00
Alex Dadgar
85a1899dfa Reduce startup time on Mac
This PR moves creating the API client into the returned predict
function. The creation of the client causes a lookup of all the system
certificates and doing that for each command on mac was extremely slow.
2017-08-28 11:29:27 -07:00
Alex Dadgar
4d97b302a0 Search respects QueryOptions and returns QueryMeta
@chelseakomlo heads up on this change
2017-08-27 22:17:51 -07:00
Chelsea Holland Komlo
e88228cc5d add global flags to autocomplete 2017-08-23 22:58:44 +00:00
Chelsea Holland Komlo
335cf888b0 use PredictAnything when an flag accepts an argument 2017-08-23 22:58:44 +00:00
Chelsea Holland Komlo
c1e5c7132a enable autocompletion of flags 2017-08-23 22:57:07 +00:00
Alex Dadgar
d493797b49 move autocomplete functions to top for consistency of placement 2017-08-22 13:41:42 -07:00
Chelsea Holland Komlo
ca6562adbd tab completion should only happen once 2017-08-16 17:04:47 +00:00
Chelsea Holland Komlo
6f0413528a adding autocomplete for nodes, evals, and jobs 2017-08-14 20:44:28 +00:00
Alex Dadgar
82e128f038 Fix eval-status bug 2017-07-25 17:37:09 -07:00
Alex Dadgar
3cd8d50bbc Multiple matched objects now treated as an error condition. 2017-07-20 17:31:07 -07:00
Alex Dadgar
468c886282 Formatting abilities 2017-07-07 12:07:07 -07:00
Cameron Stokes
48e99e01f1 Fix inconsistencies in usage cli output. 2016-12-24 12:39:33 -08:00
Kenjiro Nakayama
5aceb8eacf Update after another review 2016-08-09 22:50:18 +09:00
Kenjiro Nakayama
7d804a41c7 Add test to check both -json and -t are not specified 2016-08-09 21:06:20 +09:00
Kenjiro Nakayama
4edc906be4 Support JSON and template data output list when no args specified 2016-08-09 21:06:20 +09:00
Kenjiro Nakayama
4a3f63f641 Update help and error message 2016-08-09 21:06:20 +09:00
Kenjiro Nakayama
02613e170b Stop using format option and support json and t option 2016-08-09 21:06:20 +09:00
Kenjiro Nakayama
6c694014b4 Support JSON and template format with nomad CLI 2016-08-09 21:06:20 +09:00
Alex Dadgar
fb81caa1bb unify cli output 2016-06-12 13:16:07 -07:00
Alex Dadgar
185c896ac0 helper 2016-06-10 11:02:15 -07:00
Alex Dadgar
f6aa384efb better placement failure text for blocked evals 2016-06-10 10:56:32 -07:00
Alex Dadgar
c77026f5da plan shows failure reasons and ordered annotations 2016-05-31 21:51:23 +00:00
Alex Dadgar
f5398d25e2 Clean failed placement output 2016-05-31 18:18:58 +00:00
Alex Dadgar
c993b51c4b eval-status website docs 2016-05-27 11:50:15 -07:00
Alex Dadgar
edbbcd5deb Show failure reason in status 2016-05-27 11:50:15 -07:00