Conversation
Signed-off-by: Sander Pick <sanderpick@gmail.com>
Signed-off-by: Sander Pick <sanderpick@gmail.com>
365e3e5 to
5fc99a1
Compare
| [](https://textile.io) | ||
| [](https://slack.textile.io) | ||
| [](./LICENSE) | ||
| [](https://goreportcard.com/report/github.com/textileio/textile?style=flat-square) |
There was a problem hiding this comment.
Removing since it's broken.
| "time" | ||
|
|
||
| logging "github.com/ipfs/go-log" | ||
| "gopkg.in/segmentio/analytics-go.v3" |
|
|
||
| logging "github.com/ipfs/go-log" | ||
| "gopkg.in/segmentio/analytics-go.v3" | ||
| logging "github.com/ipfs/go-log/v2" |
There was a problem hiding this comment.
Switched everything to v2.
|
|
||
| VOLUME $BUCKETS_PATH | ||
|
|
||
| ENTRYPOINT ["dlv", "--listen=0.0.0.0:40000", "--headless=true", "--accept-multiclient", "--continue", "--api-version=2", "exec", "/usr/local/bin/buckd"] |
There was a problem hiding this comment.
exec the binary with dlv and listen on 40000. This allows multiple debug sessions to attach, without requiring any.
Signed-off-by: Sander Pick <sanderpick@gmail.com>
| security_opt: | ||
| - "seccomp:unconfined" | ||
| cap_add: | ||
| - SYS_PTRACE |
There was a problem hiding this comment.
Some things needed for remote debugging.
jsign
left a comment
There was a problem hiding this comment.
LGTM! Cool thing for remote debugging.
| debug := config.Viper.GetBool("log.debug") | ||
| logFile := config.Viper.GetString("log.file") | ||
| if logFile != "" { | ||
| err = util.SetupDefaultLoggingConfig(logFile) | ||
| err = cmd.SetupDefaultLoggingConfig(logFile) |
There was a problem hiding this comment.
Q: SetupDefaultLoggingConfig seems to have a fixed ERROR level. Is that correct considering the log.debug flag? Or maybe log.debug only applies if log.file is empty?
There was a problem hiding this comment.
This just sets the default on start, and then later on the debug flag is applied to textile modules. Setting anything other than debug here would cause all the libp2p modules to spew lots of logs.
| security_opt: | ||
| - "seccomp:unconfined" | ||
| cap_add: | ||
| - SYS_PTRACE |
I've had a local branch with a bunch of docker edits for awhile, but haven't had the time to make a real PR. Here goes...
tiniandbusybox.make hub-upormake buck-upwill leverage new development images that allow for remote debugging by using adlvbasedENTRYPOINTand some additional-gcflags. Start a debug session with delve, or via an IDE (GoLand shown below). Using the dev docker compose files, thetextileandbucketsservices exposes port40000for debugging (since you wouldn't run them at the same time), andbillingexposes port40001. This allows you to spin the whole stack locally with one line and still get debugging.threads.logsince ago-threadsutil was being used everywhere. Related, the log file must now be specified, which is a more expected behavior. The default now is just to log tostdout.