Avoid automaxprocs default logger to printf (#6524)

* Avoid automaxprocs default logger to printf
* Merge branch 'master' into maxprocs
* gofmt, goimports
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
* gazelle for docker images
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
* fix docker
* Merge refs/heads/master into maxprocs
* Merge refs/heads/master into maxprocs
This commit is contained in:
Preston Van Loon
2020-07-10 17:57:43 -07:00
committed by GitHub
parent 6c7965e82a
commit c9ca5857f8
26 changed files with 64 additions and 34 deletions

View File

@@ -20,6 +20,7 @@ go_library(
"//shared/debug:go_default_library",
"//shared/featureconfig:go_default_library",
"//shared/logutil:go_default_library",
"//shared/maxprocs:go_default_library",
"//shared/version:go_default_library",
"@com_github_ethereum_go_ethereum//log:go_default_library",
"@com_github_ipfs_go_log_v2//:go_default_library",
@@ -28,7 +29,6 @@ go_library(
"@com_github_urfave_cli_v2//:go_default_library",
"@com_github_urfave_cli_v2//altsrc:go_default_library",
"@com_github_x_cray_logrus_prefixed_formatter//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)
@@ -65,7 +65,7 @@ go_image(
"@com_github_urfave_cli_v2//:go_default_library",
"@com_github_urfave_cli_v2//altsrc:go_default_library",
"@com_github_x_cray_logrus_prefixed_formatter//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
"//shared/maxprocs:go_default_library",
],
)

View File

@@ -11,9 +11,9 @@ go_library(
visibility = ["//visibility:private"],
deps = [
"//beacon-chain/gateway:go_default_library",
"//shared/maxprocs:go_default_library",
"@com_github_joonix_log//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)
@@ -40,7 +40,7 @@ go_image(
"@com_github_grpc_ecosystem_grpc_gateway//runtime:go_default_library",
"@com_github_joonix_log//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
"//shared/maxprocs:go_default_library",
],
)

View File

@@ -11,8 +11,8 @@ import (
joonix "github.com/joonix/log"
"github.com/prysmaticlabs/prysm/beacon-chain/gateway"
_ "github.com/prysmaticlabs/prysm/shared/maxprocs"
"github.com/sirupsen/logrus"
_ "go.uber.org/automaxprocs"
)
var (

View File

@@ -16,12 +16,12 @@ import (
"github.com/prysmaticlabs/prysm/shared/debug"
"github.com/prysmaticlabs/prysm/shared/featureconfig"
"github.com/prysmaticlabs/prysm/shared/logutil"
_ "github.com/prysmaticlabs/prysm/shared/maxprocs"
"github.com/prysmaticlabs/prysm/shared/version"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v2/altsrc"
prefixed "github.com/x-cray/logrus-prefixed-formatter"
_ "go.uber.org/automaxprocs"
)
var appFlags = []cli.Flag{

View File

@@ -2885,6 +2885,11 @@ def prysm_deps():
importpath = "go.uber.org/automaxprocs",
sum = "h1:II28aZoGdaglS5vVNnspf28lnZpXScxtIozx1lAjdb0=",
version = "v1.3.0",
build_directives = [
# Do not use this library directly.
# Rather, load maxprocs from github.com/prysmaticlabs/shared/maxprocs.
"gazelle:go_visibility @prysm//shared/maxprocs:__pkg__",
],
)
go_repository(
name = "com_github_prysmaticlabs_go_ssz",

View File

@@ -0,0 +1,9 @@
load("@prysm//tools/go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["maxprocs.go"],
importpath = "github.com/prysmaticlabs/prysm/shared/maxprocs",
visibility = ["//visibility:public"],
deps = ["@org_uber_go_automaxprocs//maxprocs:go_default_library"],
)

View File

@@ -0,0 +1,16 @@
// Package maxprocs automatically sets GOMAXPROCS to match the Linux
// container CPU quota, if any. This will not override the environment
// variable of GOMAXPROCS.
package maxprocs
import (
"go.uber.org/automaxprocs/maxprocs"
)
// Initialize Uber maxprocs.
func init() {
_, err := maxprocs.Set()
if err != nil {
panic(err)
}
}

View File

@@ -14,6 +14,7 @@ go_library(
"//proto/beacon/p2p/v1:go_default_library",
"//shared/iputils:go_default_library",
"//shared/logutil:go_default_library",
"//shared/maxprocs:go_default_library",
"//shared/params:go_default_library",
"//shared/runutil:go_default_library",
"//shared/version:go_default_library",
@@ -28,7 +29,6 @@ go_library(
"@com_github_prometheus_client_golang//prometheus/promauto:go_default_library",
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)
@@ -67,7 +67,7 @@ go_image(
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
"@com_github_prysmaticlabs_go_ssz//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
"//shared/maxprocs:go_default_library",
],
)
@@ -99,10 +99,10 @@ go_test(
flaky = True,
deps = [
"//shared/iputils:go_default_library",
"//shared/maxprocs:go_default_library",
"@com_github_btcsuite_btcd//btcec:go_default_library",
"@com_github_ethereum_go_ethereum//p2p/discover:go_default_library",
"@com_github_ethereum_go_ethereum//p2p/enode:go_default_library",
"@com_github_libp2p_go_libp2p_core//crypto:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)

View File

@@ -36,11 +36,11 @@ import (
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
"github.com/prysmaticlabs/prysm/shared/iputils"
"github.com/prysmaticlabs/prysm/shared/logutil"
_ "github.com/prysmaticlabs/prysm/shared/maxprocs"
"github.com/prysmaticlabs/prysm/shared/params"
"github.com/prysmaticlabs/prysm/shared/runutil"
"github.com/prysmaticlabs/prysm/shared/version"
"github.com/sirupsen/logrus"
_ "go.uber.org/automaxprocs"
)
var (

View File

@@ -12,7 +12,7 @@ import (
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/prysmaticlabs/prysm/shared/iputils"
_ "go.uber.org/automaxprocs"
_ "github.com/prysmaticlabs/prysm/shared/maxprocs"
)
func TestBootnode_OK(t *testing.T) {

View File

@@ -11,9 +11,9 @@ go_library(
visibility = ["//visibility:private"],
deps = [
"//proto/cluster:go_default_library",
"//shared/maxprocs:go_default_library",
"@com_github_bazelbuild_buildtools//file:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)
@@ -41,7 +41,7 @@ go_image(
"//shared/params:go_default_library",
"@com_github_bazelbuild_buildtools//file:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
"//shared/maxprocs:go_default_library",
],
)

View File

@@ -8,7 +8,7 @@ import (
"github.com/bazelbuild/buildtools/file"
pb "github.com/prysmaticlabs/prysm/proto/cluster"
_ "go.uber.org/automaxprocs"
_ "github.com/prysmaticlabs/prysm/shared/maxprocs"
"google.golang.org/grpc"
)

View File

@@ -24,6 +24,7 @@ go_library(
"//shared/bytesutil:go_default_library",
"//shared/depositutil:go_default_library",
"//shared/keystore:go_default_library",
"//shared/maxprocs:go_default_library",
"//shared/params:go_default_library",
"//shared/prometheus:go_default_library",
"@com_github_ethereum_go_ethereum//:go_default_library",
@@ -46,7 +47,6 @@ go_library(
"@io_k8s_client_go//rest:go_default_library",
"@io_opencensus_go//plugin/ocgrpc:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)
@@ -113,7 +113,7 @@ go_image(
"@io_k8s_client_go//rest:go_default_library",
"@io_opencensus_go//plugin/ocgrpc:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
"//shared/maxprocs:go_default_library",
],
)

View File

@@ -6,9 +6,9 @@ import (
"net"
pb "github.com/prysmaticlabs/prysm/proto/cluster"
_ "github.com/prysmaticlabs/prysm/shared/maxprocs"
"github.com/prysmaticlabs/prysm/shared/prometheus"
"github.com/sirupsen/logrus"
_ "go.uber.org/automaxprocs"
"google.golang.org/grpc"
)

View File

@@ -9,7 +9,7 @@ go_library(
srcs = ["main.go"],
importpath = "github.com/prysmaticlabs/prysm/tools/contract-addr",
visibility = ["//visibility:private"],
deps = ["@org_uber_go_automaxprocs//:go_default_library"],
deps = ["//shared/maxprocs:go_default_library"],
)
go_binary(
@@ -29,7 +29,7 @@ go_image(
race = "off",
tags = ["manual"],
visibility = ["//visibility:private"],
deps = ["@org_uber_go_automaxprocs//:go_default_library"],
deps = ["//shared/maxprocs:go_default_library"],
)
container_bundle(

View File

@@ -12,7 +12,7 @@ import (
"log"
"net/http"
_ "go.uber.org/automaxprocs"
_ "github.com/prysmaticlabs/prysm/shared/maxprocs"
)
var address = flag.String("address-path", "", "The file path to the plain text file with the contract address")

View File

@@ -10,12 +10,12 @@ go_library(
importpath = "github.com/prysmaticlabs/prysm/tools/enr-calculator",
visibility = ["//visibility:private"],
deps = [
"//shared/maxprocs:go_default_library",
"@com_github_btcsuite_btcd//btcec:go_default_library",
"@com_github_ethereum_go_ethereum//p2p/enode:go_default_library",
"@com_github_ethereum_go_ethereum//p2p/enr:go_default_library",
"@com_github_libp2p_go_libp2p_core//crypto:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)
@@ -42,7 +42,7 @@ go_image(
"@com_github_ethereum_go_ethereum//p2p/enr:go_default_library",
"@com_github_libp2p_go_libp2p_core//crypto:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
"//shared/maxprocs:go_default_library",
],
)

View File

@@ -13,8 +13,8 @@ import (
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/enr"
"github.com/libp2p/go-libp2p-core/crypto"
_ "github.com/prysmaticlabs/prysm/shared/maxprocs"
log "github.com/sirupsen/logrus"
_ "go.uber.org/automaxprocs"
)
var (

View File

@@ -10,11 +10,11 @@ go_library(
importpath = "github.com/prysmaticlabs/prysm/tools/eth1exporter",
visibility = ["//visibility:private"],
deps = [
"//shared/maxprocs:go_default_library",
"@com_github_ethereum_go_ethereum//common:go_default_library",
"@com_github_ethereum_go_ethereum//ethclient:go_default_library",
"@com_github_ethereum_go_ethereum//params:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)
@@ -40,7 +40,7 @@ go_image(
"@com_github_ethereum_go_ethereum//ethclient:go_default_library",
"@com_github_ethereum_go_ethereum//params:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
"//shared/maxprocs:go_default_library",
],
)

View File

@@ -17,8 +17,8 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/params"
_ "github.com/prysmaticlabs/prysm/shared/maxprocs"
"github.com/sirupsen/logrus"
_ "go.uber.org/automaxprocs"
)
var (

View File

@@ -14,6 +14,7 @@ SRCS = [
DEPS = [
"//proto/faucet:faucet_go_proto",
"//shared/roughtime:go_default_library",
"//shared/maxprocs:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//peer:go_default_library",
"@org_golang_google_grpc//metadata:go_default_library",
@@ -24,7 +25,6 @@ DEPS = [
"@com_github_ethereum_go_ethereum//params:go_default_library",
"@com_github_ethereum_go_ethereum//crypto:go_default_library",
"@com_github_ethereum_go_ethereum//core/types:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
]
go_library(

View File

@@ -7,7 +7,7 @@ import (
"github.com/prestonvanloon/go-recaptcha"
faucetpb "github.com/prysmaticlabs/prysm/proto/faucet"
_ "go.uber.org/automaxprocs"
_ "github.com/prysmaticlabs/prysm/shared/maxprocs"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
)

View File

@@ -10,13 +10,13 @@ go_library(
importpath = "github.com/prysmaticlabs/prysm/tools/relaynode",
visibility = ["//visibility:private"],
deps = [
"//shared/maxprocs:go_default_library",
"//shared/version:go_default_library",
"@com_github_ipfs_go_log//:go_default_library",
"@com_github_libp2p_go_libp2p//:go_default_library",
"@com_github_libp2p_go_libp2p_circuit//:go_default_library",
"@com_github_libp2p_go_libp2p_crypto//:go_default_library",
"@com_github_multiformats_go_multiaddr//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)
@@ -38,7 +38,7 @@ go_image(
"@com_github_libp2p_go_libp2p_circuit//:go_default_library",
"@com_github_libp2p_go_libp2p_crypto//:go_default_library",
"@com_github_multiformats_go_multiaddr//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
"//shared/maxprocs:go_default_library",
],
)

View File

@@ -18,8 +18,8 @@ import (
circuit "github.com/libp2p/go-libp2p-circuit"
crypto "github.com/libp2p/go-libp2p-crypto"
"github.com/multiformats/go-multiaddr"
_ "github.com/prysmaticlabs/prysm/shared/maxprocs"
"github.com/prysmaticlabs/prysm/shared/version"
_ "go.uber.org/automaxprocs"
)
var (

View File

@@ -19,6 +19,7 @@ go_library(
"//shared/debug:go_default_library",
"//shared/featureconfig:go_default_library",
"//shared/logutil:go_default_library",
"//shared/maxprocs:go_default_library",
"//shared/params:go_default_library",
"//shared/version:go_default_library",
"//validator/accounts/v1:go_default_library",
@@ -33,7 +34,6 @@ go_library(
"@com_github_urfave_cli_v2//altsrc:go_default_library",
"@com_github_x_cray_logrus_prefixed_formatter//:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)
@@ -75,7 +75,7 @@ go_image(
"@com_github_urfave_cli_v2//altsrc:go_default_library",
"@com_github_x_cray_logrus_prefixed_formatter//:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
"//shared/maxprocs:go_default_library",
],
)

View File

@@ -19,6 +19,7 @@ import (
"github.com/prysmaticlabs/prysm/shared/debug"
"github.com/prysmaticlabs/prysm/shared/featureconfig"
"github.com/prysmaticlabs/prysm/shared/logutil"
_ "github.com/prysmaticlabs/prysm/shared/maxprocs"
"github.com/prysmaticlabs/prysm/shared/params"
"github.com/prysmaticlabs/prysm/shared/version"
v1 "github.com/prysmaticlabs/prysm/validator/accounts/v1"
@@ -30,7 +31,6 @@ import (
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v2/altsrc"
prefixed "github.com/x-cray/logrus-prefixed-formatter"
_ "go.uber.org/automaxprocs"
"google.golang.org/grpc"
)