superbenchmark icon indicating copy to clipboard operation
superbenchmark copied to clipboard

superbench logging: 'color' output should be optional

Open LiweiPeng opened this issue 3 years ago • 3 comments
trafficstars

In current superbench code, the logger has a hard-coded 'color' mode. While this design is good for interactive mode, it is bad when processing the logs programmatically in system like Geneva.

The following is superbench output's raw text: ^[[0;33m[1,4]:^[[0m[^[[36m2022-08-29 22:50:16,377 node1:287^[[0m][^[[34mexecutor.py:125^[[0m][^[[32mINFO^[[0m] Executor succeeded in nccl-bw:nvlink.^[[0m^[[0m^M

Expected: the color mode should be an option to 'sb' command. or it can be turned off by some environmental variable. The following is the expectd raw text:

[1,4]:[2022-08-29 22:50:16,377 ND40rsv201000009:287][executor.py:125][INFO] Executor succeeded in nccl-bw:nvlink.

LiweiPeng avatar Aug 29 '22 21:08 LiweiPeng

  • For logs directly written to file (sb-run.log, sb-exec.log), there's no color by default
  • For logs written to stdout/stderr, you can disable it with ANSIBLE_NOCOLOR=1 and NO_COLOR=1

abuccts avatar Aug 31 '22 10:08 abuccts

where to set these env variables? When I set them on the console like below. the output still has colors

export ANSIBLE_NOCOLOR=1 export NO_COLOR=1 sb run -f local.ini -c debug/run1.yaml

image

LiweiPeng avatar Aug 31 '22 17:08 LiweiPeng

did you try with the latest release/0.6 branch? will need to pull the code and rerun python3 -m pip install . on management node

abuccts avatar Sep 01 '22 01:09 abuccts

fixed with latest PR.

LiweiPeng avatar Sep 02 '22 02:09 LiweiPeng