bacalhau-project / bacalhau

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

Should never write raw logs #4437

Closed aronchick closed 1 month ago

aronchick commented 1 month ago

Why is this printing out raw logs?

❯ bacalhau-1.5.0 serve --orchestrator --compute --data-dir v1.5.0/data-dir
17:47:15.886 | WRN cmd/cli/serve/serve.go:146 > --name flag with value  ignored. Name n-a4e0671b-2679-4bc0-86b7-160ac093d2dc already exists
17:47:15.923 | INF cmd/cli/serve/serve.go:218 > starting bacalhau...
17:47:15.933 | INF pkg/nats/logger.go:47 > Starting nats-server [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.933 | INF pkg/nats/logger.go:47 >   Version:  2.10.11 [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.933 | INF pkg/nats/logger.go:47 >   Git:      [not set] [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.933 | INF pkg/nats/logger.go:47 >   Name:     n-a4e0671b-2679-4bc0-86b7-160ac093d2dc [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.933 | INF pkg/nats/logger.go:47 >   Node:     KQ4D6Bsn [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.933 | INF pkg/nats/logger.go:47 >   ID:       NAHOOVFFW6WBVND7VJUWUFYMDINK737DS3V4A7XELLW44KXBWYMLVNVF [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.935 | INF pkg/nats/logger.go:47 > Starting JetStream [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.936 | INF pkg/nats/logger.go:47 > ---------------- JETSTREAM ---------------- [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.936 | INF pkg/nats/logger.go:47 >   Max Memory:      48.00 GB [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.936 | INF pkg/nats/logger.go:47 >   Max Storage:     50.10 GB [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.936 | INF pkg/nats/logger.go:47 >   Store Directory: "v1.5.0/data-dir/orchestrator/nats-store/jetstream" [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.936 | INF pkg/nats/logger.go:47 > ------------------------------------------- [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.937 | INF pkg/nats/logger.go:47 >   Starting restore for stream '$G > KV_node_v1' [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.938 | WRN pkg/nats/logger.go:47 > Filestore [KV_node_v1] Stream state encountered internal inconsistency on recover [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.94 | INF pkg/nats/logger.go:47 >   Restored 1 messages for stream '$G > KV_node_v1' in 3ms [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.94 | INF pkg/nats/logger.go:47 > Listening for client connections on 0.0.0.0:4222 [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.94 | INF pkg/nats/logger.go:47 > Server is ready [Server:n-a4e0671b-2679-4bc0-86b7-160ac093d2dc]
17:47:15.958 | INF pkg/nats/server.go:49 > NATS server NAHOOVFFW6WBVND7VJUWUFYMDINK737DS3V4A7XELLW44KXBWYMLVNVF listening on nats://0.0.0.0:4222 [NodeID:n-a4e0671b]
17:47:17.969 | INF pkg/node/manager/node_manager.go:47 > Nodes joining the cluster will be assigned approval state: APPROVED
17:47:17.969 | INF pkg/node/heartbeat/server.go:59 > Heartbeat server started [NodeID:n-a4e0671b]
17:47:17.97 | INF pkg/node/manager/node_manager.go:66 > Node manager started [NodeID:n-a4e0671b]
17:47:17.976 | INF pkg/publisher/local/server.go:52 > Running local publishing server on 0.0.0.0:6001 [NodeID:n-a4e0671b]
17:47:17.976 | INF pkg/lib/watcher/watcher.go:59 > No checkpoint found, starting from latest [NodeID:n-a4e0671b] [watcher_id:compute-logger]
17:47:17.976 | INF pkg/lib/watcher/watcher.go:68 > starting watcher [NodeID:n-a4e0671b] [starting_at:latest] [watcher_id:compute-logger]
error starting node: listen tcp 35.194.189.115:1234: bind: can't assign requested address
frrist commented 1 month ago

What is the expectation here? Would we prefer less logs or to only log at level warn or error?

aronchick commented 1 month ago

Expectation: we would thoughtfully decide what is appropriate to print out and present it in a user friendly form (no timestamp, no log level, human understanding).

The above would go to a log file - but much less on INFO - just what makes sense)

frrist commented 1 month ago

I think https://github.com/bacalhau-project/bacalhau/pull/4469 addresses this issue, if it does feel free to close this.