bacalhau-project / bacalhau

Compute over Data framework for public, transparent, and optionally verifiable computation
https://docs.bacalhau.org
Apache License 2.0
675 stars 88 forks source link

The `--no-style` flag is not respected for the `job history` command #4518

Open frrist opened 1 week ago

frrist commented 1 week ago

Bug Description

This is most obvious when using the watch command coupled with the job history command, e.g.:

watch -n 1 bacalhau job history j-fc782bc4-056c-4ef6-b071-467492de8218 --no-style
Every 1.0s: bacalhau job history j-fc782bc4-056c-4ef6-b071-467492de8218 --no-style                                                                           cypress: Tue Sep 24 11:16:13 2024

 TIME                 LEVEL           REV.  EXEC. ID    NODE ID     STATE      TOPIC            EVENT
 Sep 24 18:10:07.262  JobLevel        1                             Pending    Submission       Job submitted
 Sep 24 18:10:07.277  ExecutionLevel  1     e-36b30571  n-e002001e  New
 Sep 24 18:10:07.283  ExecutionLevel  2     e-36b30571  n-e002001e  AskForBid
 Sep 24 18:12:07.393  ExecutionLevel  3     e-36b30571  n-e002001e  Failed     Requesting Node  ^[31mcalculating resource usage of job: error getting job disk sp^[0m
                                                                                                ^[31mace requirements: IPFS storage provider was unable to retrie^[0m
                                                                                                ^[31mve content "QmeCoP6LsPDADw5WWdJQ8aWwAfrP9eL1ALEkzAjcTVQVhz" ^[0m
                                                                                                ^[31mbefore timeout 2m0s: Post "http://127.0.0.1:5001/api/v0/obje^[0m
                                                                                                ^[31mct/stat?arg=%2Fipfs%2FQmeCoP6LsPDADw5WWdJQ8aWwAfrP9eL1ALEkzA^[0m
                                                                                                ^[31mjcTVQVhz": context deadline exceeded^[0m
 Sep 24 18:12:07.414  ExecutionLevel  1     e-e4bf035f  n-e002001e  New
 Sep 24 18:12:07.426  ExecutionLevel  2     e-e4bf035f  n-e002001e  AskForBid
 Sep 24 18:14:07.668  ExecutionLevel  3     e-e4bf035f  n-e002001e  Failed     Requesting Node  ^[31mcalculating resource usage of job: error getting job disk sp^[0m
                                                                                                ^[31mace requirements: IPFS storage provider was unable to retrie^[0m
                                                                                                ^[31mve content "QmeCoP6LsPDADw5WWdJQ8aWwAfrP9eL1ALEkzAjcTVQVhz" ^[0m
                                                                                                ^[31mbefore timeout 2m0s: Post "http://127.0.0.1:5001/api/v0/obje^[0m
                                                                                                ^[31mct/stat?arg=%2Fipfs%2FQmeCoP6LsPDADw5WWdJQ8aWwAfrP9eL1ALEkzA^[0m
                                                                                                ^[31mjcTVQVhz": context deadline exceeded^[0m
 Sep 24 18:14:07.681  JobLevel        2                             Failed     Scheduling       ^[31mnot enough nodes to run job. requested: 1, available: 3, sui^[0m
                                                                                                ^[31mtable: 0.^[0m
                                                                                                ^[31m• Node QmPLPUUj: node busy with available capacity {CPU: 0.3^[0m
                                                                                                ^[31m500000000000001, Memory: 3.7 GB, Disk: 1.7 TB, GPU: 0} and q^[0m
                                                                                                ^[31mueue capacity {CPU: 1.5, Memory: 5.0 GB, Disk: 16 GB, GPU: 0^[0m
                                                                                                ^[31m}^[0m
                                                                                                ^[31m• Node QmbxGSsM: node busy with available capacity {CPU: 0.1^[0m
                                                                                                ^[31m0000000000000009, Memory: 1.7 GB, Disk: 1.7 TB, GPU: 0} and ^[0m
                                                                                                ^[31mqueue capacity {CPU: 1, Memory: 2.0 GB, Disk: 2.8 kB, GPU: 0^[0m
                                                                                                ^[31m}^[0m
                                                                                                ^[31m• Node n-e002001e: job already executed on this node more th^[0m
                                                                                                ^[31man once^[0m

The Event column should respect the --no-style flag.

wdbaruni commented 1 week ago

It works for me. Which version are you using?

image

Walid-MacBook-5: ~
→ bacalhau \
    docker run \
    -i src=ipfs://qmbrr4kuxmxqfzpnlusb1ksmdvftbucv1hvsdaauke4epj/ \
ubuntu echo hello
Job successfully submitted. Job ID: j-3e92a91a-75aa-452b-a7dd-289e29964c5e
Checking job status... (Enter Ctrl+C to exit at any time, your job will continue running):

 TIME          EXEC. ID    TOPIC            EVENT
 14:17:10.592  ----------  Submission       Job submitted
 14:17:10.604  ----------  Scheduling       Error: not enough nodes to run job. requested: 1, available: 1, suitable: 0.
                                            • Node n-c5d27044: does not support ipfs, only s3, urldownload, inline

Error: job failed

To get more details about the run, execute:
    bacalhau job describe j-3e92a91a-75aa-452b-a7dd-289e29964c5e

To get more details about the run executions, execute:
    bacalhau job executions j-3e92a91a-75aa-452b-a7dd-289e29964c5e

Walid-MacBook-5: ~
→ bacalhau job history j-3e92a91a-75aa-452b-a7dd-289e29964c5e
 TIME                 LEVEL     EXEC. ID    TOPIC       EVENT
 Sep 25 14:17:10.592  JobLevel  ----------  Submission  Job submitted
 Sep 25 14:17:10.604  JobLevel  ----------  Scheduling  Error: not enough nodes to run job. requested: 1, available: 1, suitable: 0.
                                                        • Node n-c5d27044: does not support ipfs, only s3, urldownload, inline

Walid-MacBook-5: ~
→ bacalhau job history j-3e92a91a-75aa-452b-a7dd-289e29964c5e --no-style
 TIME                 LEVEL     EXEC. ID    TOPIC       EVENT
 Sep 25 14:17:10.592  JobLevel  ----------  Submission  Job submitted
 Sep 25 14:17:10.604  JobLevel  ----------  Scheduling  Error: not enough nodes to run job. requested: 1, available: 1, suitable: 0.
                                                        • Node n-c5d27044: does not support ipfs, only s3, urldownload, inline
frrist commented 1 week ago

I am on latest main: d00404208ffc4e643db855122fbbeeab7edc0ca3

image

And it's not working, per screenshot colored text is still being printed when run with --no-style