diff --git a/.gitignore b/.gitignore index be28b41..87d60f2 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,4 @@ dist/ /starter-game # Built binary -world +./world diff --git a/common/docker/service/evm.go b/common/docker/service/evm.go index 391b220..a22016f 100644 --- a/common/docker/service/evm.go +++ b/common/docker/service/evm.go @@ -28,7 +28,7 @@ func EVM(cfg *config.Config) Service { faucetEnabled := cfg.DockerEnv["FAUCET_ENABLED"] if faucetEnabled == "" { - faucetEnabled = "false" //nolint:goconst // default values should be local to the service + faucetEnabled = "false" } faucetAddress := cfg.DockerEnv["FAUCET_ADDRESS"] diff --git a/common/docker/service/jaeger.go b/common/docker/service/jaeger.go index 4224f2d..b7a7b83 100644 --- a/common/docker/service/jaeger.go +++ b/common/docker/service/jaeger.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/mount" "pkg.world.dev/world-cli/common/config" ) @@ -19,10 +20,30 @@ func Jaeger(cfg *config.Config) Service { Name: getJaegerContainerName(cfg), Config: container.Config{ Image: "jaegertracing/all-in-one:1.61.0", + // hard-coding this since it won't change much and the defaults work. users most likely + // won't need to change these. note that this storage configuration isn't recommended to + // be used for production environment, but is good enough for local development. + // for more info see: https://www.jaegertracing.io/docs/1.62/deployment/#span-storage-backends + Env: []string{ + "SPAN_STORAGE_TYPE=badger", + "BADGER_EPHEMERAL=false", + "BADGER_DIRECTORY_VALUE=/badger/data", + "BADGER_DIRECTORY_KEY=/badger/key", + "QUERY_ADDITIONAL_HEADERS=Access-Control-Allow-Origin:*", + }, + // running as the default user (uid 10001) doesn't work on mac because the volume is owned by + // root. A way to get around this is to create another container to change the owner of the + // /badger directory. since we're not able to start services following a dependency graph yet, + // we'll just run as root. world cli is also mainly used for local dev, so the security + // benefits of running as non-root doesn't really apply here. + // src: https://github.com/jaegertracing/jaeger/issues/4906 + User: "root", }, HostConfig: container.HostConfig{ PortBindings: newPortMap(exposedPorts), NetworkMode: container.NetworkMode(cfg.DockerEnv["CARDINAL_NAMESPACE"]), + Mounts: []mount.Mount{{Type: mount.TypeVolume, + Source: cfg.DockerEnv["CARDINAL_NAMESPACE"], Target: "/badger"}}, }, } } diff --git a/common/docker/service/nakama.go b/common/docker/service/nakama.go index 0372ca2..3fb60c4 100644 --- a/common/docker/service/nakama.go +++ b/common/docker/service/nakama.go @@ -37,7 +37,7 @@ func Nakama(cfg *config.Config) Service { traceEnabled := cfg.DockerEnv["NAKAMA_TRACE_ENABLED"] if traceEnabled == "" || !cfg.Telemetry { - traceEnabled = "false" + traceEnabled = "true" } traceSampleRate := cfg.DockerEnv["NAKAMA_TRACE_SAMPLE_RATE"] @@ -45,7 +45,7 @@ func Nakama(cfg *config.Config) Service { traceSampleRate = "0.6" } - metricsEnabled := false + metricsEnabled := true if cfg.Telemetry { cfgMetricsEnabled, err := strconv.ParseBool(cfg.DockerEnv["NAKAMA_METRICS_ENABLED"]) if err == nil {