Skip to content

Commit 786ed6f

Browse files
author
Lars T Hansen
committed
Fix #244 - Remove CSV and old-format JSON formatting
1 parent 346cec5 commit 786ed6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+63
-3924
lines changed

README.md

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,8 @@ are known to work for both. Also see comments in `gpuapi/Makefile`.
5959

6060
## Output format options
6161

62-
There are two output formats, [the old format](doc/OLD-FORMAT.md) and [the new
63-
format](doc/NEW-FORMAT.md), currently coexisting but the old format will be phased out.
64-
65-
The recommended (and default as of v0.16) output format is the "new" JSON format. There are command
66-
line switches to force the older formats, CSV or an older JSON format.
62+
As of v0.17 there is only one output format, known as [the new format](doc/NEW-FORMAT.md), a JSON
63+
encoding. Support for the older CSV format and an older JSON encoding have been removed.
6764

6865
## Examples
6966

@@ -75,34 +72,19 @@ cluster", below. For a full description of the output formats and fields, see t
7572
It's sensible to run `sonar ps` every 5 minutes on every compute node if you care mostly about
7673
long-running jobs, or at higher frequency if sbrief jobs are of interest to you.
7774

78-
Here is an example output (with the older CSV output format):
75+
Here is an example output:
7976
```console
8077
$ sonar ps --exclude-system-jobs --min-cpu-time=10
81-
82-
v=0.7.0,time=2023-08-10T11:09:41+02:00,host=somehost,cores=8,user=someone,job=0,cmd=fish,cpu%=2.1,cpukib=64400,gpus=none,gpu%=0,gpumem%=0,gpukib=0,cputime_sec=138
83-
v=0.7.0,time=2023-08-10T11:09:41+02:00,host=somehost,cores=8,user=someone,job=0,cmd=sonar,cpu%=761,cpukib=372,gpus=none,gpu%=0,gpumem%=0,gpukib=0,cputime_sec=137
84-
v=0.7.0,time=2023-08-10T11:09:41+02:00,host=somehost,cores=8,user=someone,job=0,cmd=brave,cpu%=14.6,cpukib=2907168,gpus=none,gpu%=0,gpumem%=0,gpukib=0,cputime_sec=3532
85-
v=0.7.0,time=2023-08-10T11:09:41+02:00,host=somehost,cores=8,user=someone,job=0,cmd=alacritty,cpu%=0.8,cpukib=126700,gpus=none,gpu%=0,gpumem%=0,gpukib=0,cputime_sec=51
86-
v=0.7.0,time=2023-08-10T11:09:41+02:00,host=somehost,cores=8,user=someone,job=0,cmd=pulseaudio,cpu%=0.7,cpukib=90640,gpus=none,gpu%=0,gpumem%=0,gpukib=0,cputime_sec=399
87-
v=0.7.0,time=2023-08-10T11:09:41+02:00,host=somehost,cores=8,user=someone,job=0,cmd=slack,cpu%=3.9,cpukib=716924,gpus=none,gpu%=0,gpumem%=0,gpukib=0,cputime_sec=266
78+
...
8879
```
8980

9081
### Collect system information with `sonar sysinfo`
9182

92-
The `sysinfo` subcommand collects information about the system and prints it in JSON form on stdout
93-
(this is the older JSON format):
83+
The `sysinfo` subcommand collects information about the system and prints it on stdout.
9484

9585
```console
9686
$ sonar sysinfo
97-
{
98-
"timestamp": "2024-02-26T00:00:02+01:00",
99-
"hostname": "ml1.hpc.uio.no",
100-
"description": "2x14 (hyperthreaded) Intel(R) Xeon(R) Gold 5120 CPU @ 2.20GHz, 125 GB, 3x NVIDIA GeForce RTX 2080 Ti @ 11GB",
101-
"cpu_cores": 56,
102-
"mem_gb": 125,
103-
"gpu_cards": 3,
104-
"gpumem_gb": 33
105-
}
87+
...
10688
```
10789

10890
Typical usage for `sysinfo` is to run the command after reboot and (for hot-swappable systems and

doc/CHANGELOG.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@ general, all relevant fixes are uplifted from release branches to main, so a cha
55
will always be on main and in all later releases.
66

77
Since v0.13.0, the output format is documented mainly by the file
8-
[util/formats/newfmt/types.go](../util/formats/newfmt/types.go), which specifies the new JSON output
8+
[util/formats/newfmt/types.go](../util/formats/newfmt/types.go), which specifies the JSON output
99
format in terms of a Go data structure with JSON annotations. Changes to the output format can most
1010
easily be be seen by diffing this file against a desired tag, starting with "v0.13.0". Such changes
11-
are therefore no longer mentioned specially below. Recall that to get the new format, Sonar must be
12-
run in daemon mode or with the --json switch (which also requires the --cluster).
11+
are therefore no longer mentioned specially below.
1312

14-
The "old" output formats are for the most part not being extended with new fields and should not be
15-
relied upon. Consumers should expect to see the "new" JSON format for new data, and all producers
16-
should ask for that format.
1713

1814
## Changes in v0.17.0 (on `main`)
1915

20-
* Bug 434 - **IMPORTANT FUNCTIONALITY.** Introduce the batch-size setting to allow very large
21-
slurm job lists to be split into multiple messages.
16+
* Bug 244 - **REMOVED FUNCTIONALITY.** Remove all code related to producing CSV and the "old" JSON
17+
format, asking for those formats will now cause errors. The --json switch is still accepted but
18+
has no effect.
19+
* Bug 434 - **IMPORTANT FUNCTIONALITY.** Introduce the batch-size setting to allow very large slurm
20+
job lists to be split into multiple messages.
2221

2322

2423
## Changes in v0.16.0 (on `release_0_16`)
@@ -29,8 +28,8 @@ should ask for that format.
2928
* Bug 352 - **MAJOR FUNCTIONALITY.** Populate the `topo_svg` field, introduce a `topo_text` field,
3029
and expand the config file so as to be able to specify how to generate those data
3130
* Bug 353 - Remove the `software` field.
32-
* Bug 387 - **IMPORTANT FIX.** Parse some slurm data, notably ReqMem, correctly. Previously the parser
33-
would always return 0 for this field
31+
* Bug 387 - **IMPORTANT FIX.** Parse some slurm data, notably ReqMem, correctly. Previously the
32+
parser would always return 0 for this field
3433
* Bug 401 - better error messages for Kafka
3534
* Bug 402 - synthesize a UUID on AMD cards when needed
3635
* Bug 402 - change the syntax of synthesized UUIDs on XPU (now joint with AMD)
@@ -40,10 +39,10 @@ should ask for that format.
4039
is no longer a required argument for that (defaulting to the empty string).
4140
* Bug 410 - output on stderr does not by itself cause a subcommand to fail, so long as the
4241
exit code is 0
43-
* Bug 409 / 437 - **MAJOR FUNCTIONALITY.** Run scontrol in addition to sacct in order to extract resource
44-
request for pending jobs. Remove the unused `gres_detail` field of slurm job data and introduce
45-
two fields `allocated_resources` and `requested_resources` and fill them with unparsed resouce data from
46-
sacct and scontrol.
42+
* Bug 409 / 437 - **MAJOR FUNCTIONALITY.** Run scontrol in addition to sacct in order to extract
43+
resource request for pending jobs. Remove the unused `gres_detail` field of slurm job data and
44+
introduce two fields `allocated_resources` and `requested_resources` and fill them with unparsed
45+
resouce data from sacct and scontrol.
4746
* Testing (sundry): Many testing improvements
4847
* Doc (sundry): Various improvements
4948

0 commit comments

Comments
 (0)