68 Commits

Author SHA1 Message Date
Charlie Voiselle
30ab8897d2 deps: Switch from mitchellh/cli to hashicorp/cli (#19321)
Co-authored-by: James Rasell <jrasell@hashicorp.com>
2024-12-19 15:41:11 +00:00
Luiz Aoqui
50c50a6328 cli: fix return code when job deployment succeeds (#19876)
When a job eval is blocked due to missing capacity, the `nomad job run`
command will monitor the deployment, which may succeed once additional
capacity is made available.

But the current implementation would return `2` even when the deployment
succeeded because it only took the first eval status into account.

This commit updates the eval monitoring logic to reset the scheduling
error state if the deployment eventually succeeds.
2024-02-05 18:32:25 -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
Jack
66c61e4fd2 cli: wait flag for use with deployment status -monitor (#15262) 2022-11-23 16:36:13 -05:00
James Rasell
581390bed1 cli: do not import structs, use API package only. (#13938) 2022-08-02 16:33:08 +02:00
James Rasell
24220d0a02 core: allow pausing and un-pausing of leader broker routine (#13045)
* core: allow pause/un-pause of eval broker on region leader.

* agent: add ability to pause eval broker via scheduler config.

* cli: add operator scheduler commands to interact with config.

* api: add ability to pause eval broker via scheduler config

* e2e: add operator scheduler test for eval broker pause.

* docs: include new opertor scheduler CLI and pause eval API info.
2022-07-06 16:13:48 +02:00
Lukas W
bb1fc6ec5f CLI: Return non-zero exit code when deployment fails in nomad run (#11550)
* Exit non-zero from run command if deployment fails
* Fix typo in deployment monitor introduced in 0edda11
2021-12-09 09:09:28 -05:00
Luiz Aoqui
e76557289a cli: include all possible scores in alloc status metric table (#11128) 2021-09-08 17:30:11 -04:00
Isabel Suchanek
ca010f9f87 cli: check deployment exists before monitoring (#10757)
System and batch jobs don't create deployments, which means nomad tries
to monitor a non-existent deployment when it runs a job and outputs an
error message. This adds a check to make sure a deployment exists before
monitoring. Also fixes some formatting.

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2021-06-14 16:42:38 -07:00
Isabel Suchanek
0edda116ad cli: add monitor flag to deployment status
Adding '-verbose' will print out the allocation information for the
deployment. This also changes the job run command so that it now blocks
until deployment is complete and adds timestamps to the output so that
it's more in line with the output of node drain.

This uses glint to print in place in running in a tty. Because glint
doesn't yet support cmd/powershell, Windows workflows use a different
library to print in place, which results in slightly different
formatting: 1) different margins, and 2) no spinner indicating
deployment in progress.
2021-06-09 16:18:45 -07: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
Derek Strickland
3ed990296b update log output to clarify that nodes were filtered out rather than down 2020-03-17 14:45:11 -04:00
Drew Bailey
6980ab0a81 Prevent nomad alloc status output inconsistency
Prevent random map ordering and sort alphabetically

better variable name
2019-11-01 14:01:32 -04:00
Preetha Appan
4a35d62887 Fix formatting of allocation score metrics 2018-10-30 12:03:23 -05:00
Preetha Appan
b8facd8756 Fix linting 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
Michael Schurter
56997eac67 cli: remove info color on monitored output 2018-03-30 15:51:48 -07:00
Josh Soref
e1eb3e4684 spelling: sanitize 2018-03-11 18:52:59 +00:00
Alex Dadgar
f6fbb36054 sync 2017-10-13 14:36:02 -07:00
Alex Dadgar
a9e3a41407 Enable more linters 2017-09-26 15:26:33 -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
fe990ca3e0 Fix some tests, eval monitor shows deployment id and deployment cancels based on version 2017-07-07 12:12:48 -07:00
Diptanu Choudhury
42ba68a201 Removing the queued state of Job Summary and alloc desired status false 2016-07-13 13:20:46 -06:00
Alex Dadgar
c77026f5da plan shows failure reasons and ordered annotations 2016-05-31 21:51:23 +00:00
Alex Dadgar
ed94128d68 output and test fix 2016-05-24 18:42:05 -07:00
Alex Dadgar
92bddbc3a5 rename SpawnedBlockedEval and simplify map safety check 2016-05-24 18:12:59 -07:00
Alex Dadgar
9f5ab6648f print spawned eval in monitor 2016-05-19 13:16:10 -07:00
Alex Dadgar
154875c0bc Show task group failures in eval-monitor 2016-05-18 22:02:51 -07:00
Alex Dadgar
0764b8f161 Shorted eval id and only print waiting if time > 0 2016-02-06 16:09:39 -08:00
Alex Dadgar
4836bd5656 limit length of string, taking into account its length 2016-01-27 10:42:10 -08:00
Alex Dadgar
7847357382 Merge pull request #692 from iverberk/f-detect-half-byte-prefix
Detect a half-byte prefix
2016-01-21 14:12:27 -08:00
Ivo Verberk
cc4fea99fc Provide a consistent user experience with prefix based lookups.
* Require at least two characters for identifier
* Automatically strip off the last character in case of uneven length
2016-01-21 22:21:35 +01:00
Ivo Verberk
2559bd68c8 Do not use the exact internal field names in the CLI output 2016-01-21 21:35:56 +01:00
Ivo Verberk
de3bc00a00 Detect a half-byte prefix and display a user-friendly error. 2016-01-21 20:53:05 +01:00
Ivo Verberk
4330157b78 Cleanup code and add comments 2016-01-20 00:02:17 +01:00
Ivo Verberk
ab9409184a Shorten CLI identifiers
* Truncate all UUID identifiers to eight characters by default
* Refactor the node identifier to an auto-generated UUID
* Created and updated tests and mocks
2016-01-14 21:57:43 +01:00
Alex Dadgar
37d9c4d9f7 commnet 2016-01-07 15:43:30 -08:00
Alex Dadgar
0a85e74aae Make monitoring based on prefix optional 2016-01-07 15:25:08 -08:00
Alex Dadgar
012db31100 Change multiple match cli output 2016-01-06 15:08:47 -08:00
Alex Dadgar
cf3152d924 Merge pull request #575 from nautsio/f-short-ids
Allow lookups based on short identifiers
2016-01-06 14:36:19 -08:00
Ivo Verberk
62951082e2 Improvements for short identifiers
* Fix tests
* Update documentation
2016-01-06 22:46:57 +01:00
Alex Dadgar
892c7ddee3 Fix bug, add tests, and cli output 2016-01-04 14:23:06 -08:00
Ivo Verberk
905742249e Refactoring continued
* Refactor other cli commands to new design
* Add PrefixList method to api package
* Add more tests
2015-12-24 20:53:37 +01:00
Ivo Verberk
91075e130a Short identifiers functionality
* Use go-memdb prefix indexer for lookups
* Add Job lookups
* Update state store with new ByIDPrefix get methods
* Call new methods when exact lookup fails or is not applicable
2015-12-19 21:55:28 +01:00
Ryan Uber
a58b60b8ea command: better output for alloc-status 2015-09-27 13:59:27 -07:00
Ryan Uber
243d15fba7 command/monitor: set initial status to 'pending' 2015-09-22 10:45:08 -07:00
Ryan Uber
7d64e1fa2d command: print a warning if we get 0 evaluated nodes 2015-09-22 10:45:08 -07:00