Skip to content

Commit

Permalink
automaxprocs (#2770)
Browse files Browse the repository at this point in the history
  • Loading branch information
prestonvanloon authored and terencechain committed Jun 13, 2019
1 parent 3a167e5 commit dd13156
Show file tree
Hide file tree
Showing 23 changed files with 73 additions and 35 deletions.
6 changes: 6 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,12 @@ go_repository(
importpath = "github.com/ghodss/yaml",
)

go_repository(
name = "org_uber_go_automaxprocs",
commit = "823363ffcd16c8f3ebaa3a067550d97c70f52194",
importpath = "go.uber.org/automaxprocs",
)

go_repository(
name = "com_github_libp2p_go_libp2p_core",
build_file_proto_mode = "disable_global",
Expand Down
2 changes: 2 additions & 0 deletions beacon-chain/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ go_library(
"@com_github_sirupsen_logrus//:go_default_library",
"@com_github_urfave_cli//:go_default_library",
"@com_github_x_cray_logrus_prefixed_formatter//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)

Expand Down Expand Up @@ -53,6 +54,7 @@ go_image(
"@com_github_sirupsen_logrus//:go_default_library",
"@com_github_urfave_cli//:go_default_library",
"@com_github_x_cray_logrus_prefixed_formatter//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)

Expand Down
2 changes: 2 additions & 0 deletions beacon-chain/gateway/server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ go_library(
"//beacon-chain/gateway:go_default_library",
"@com_github_joonix_log//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)

Expand All @@ -36,6 +37,7 @@ go_image(
"@com_github_joonix_log//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@grpc_ecosystem_grpc_gateway//runtime:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)

Expand Down
1 change: 1 addition & 0 deletions beacon-chain/gateway/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
joonix "github.com/joonix/log"
"github.com/prysmaticlabs/prysm/beacon-chain/gateway"
"github.com/sirupsen/logrus"
_ "go.uber.org/automaxprocs"
)

var (
Expand Down
8 changes: 4 additions & 4 deletions beacon-chain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import (
"runtime"

joonix "github.com/joonix/log"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
prefixed "github.com/x-cray/logrus-prefixed-formatter"

"github.com/prysmaticlabs/prysm/beacon-chain/node"
"github.com/prysmaticlabs/prysm/beacon-chain/utils"
"github.com/prysmaticlabs/prysm/shared/cmd"
"github.com/prysmaticlabs/prysm/shared/debug"
"github.com/prysmaticlabs/prysm/shared/featureconfig"
"github.com/prysmaticlabs/prysm/shared/logutil"
"github.com/prysmaticlabs/prysm/shared/version"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"github.com/x-cray/logrus-prefixed-formatter"
_ "go.uber.org/automaxprocs"
)

var appFlags = []cli.Flag{
Expand Down
2 changes: 2 additions & 0 deletions tools/bootnode/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ go_library(
"@com_github_libp2p_go_libp2p_kad_dht//opts:go_default_library",
"@com_github_libp2p_go_libp2p_protocol//:go_default_library",
"@com_github_multiformats_go_multiaddr//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)

Expand All @@ -43,6 +44,7 @@ go_image(
"@com_github_libp2p_go_libp2p_kad_dht//opts:go_default_library",
"@com_github_libp2p_go_libp2p_protocol//:go_default_library",
"@com_github_multiformats_go_multiaddr//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)

Expand Down
1 change: 1 addition & 0 deletions tools/bootnode/bootnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
protocol "github.com/libp2p/go-libp2p-protocol"
ma "github.com/multiformats/go-multiaddr"
"github.com/prysmaticlabs/prysm/shared/version"
_ "go.uber.org/automaxprocs"
)

var (
Expand Down
14 changes: 8 additions & 6 deletions tools/cluster-pk-manager/client/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ go_library(
"//shared/keystore:go_default_library",
"//shared/params:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)

Expand All @@ -25,21 +26,22 @@ go_binary(
go_image(
name = "image",
srcs = ["main.go"],
goarch = "amd64",
goos = "linux",
importpath = "github.com/prysmaticlabs/prysm/tools/cluster-pk-manager/client",
pure = "on",
race = "off",
static = "on",
tags = ["manual"],
visibility = ["//visibility:private"],
deps = [
"//proto/cluster:go_default_library",
"//shared/bls:go_default_library",
"//shared/keystore:go_default_library",
"//shared/params:go_default_library",
"@org_golang_google_grpc//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
pure = "on",
static = "on",
tags = ["manual"],
goarch = "amd64",
goos = "linux",
race = "off",
)

container_push(
Expand Down
1 change: 1 addition & 0 deletions tools/cluster-pk-manager/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/prysmaticlabs/prysm/shared/bls"
"github.com/prysmaticlabs/prysm/shared/keystore"
"github.com/prysmaticlabs/prysm/shared/params"
_ "go.uber.org/automaxprocs"
"google.golang.org/grpc"
)

Expand Down
4 changes: 3 additions & 1 deletion tools/cluster-pk-manager/server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ 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",
],
)

Expand Down Expand Up @@ -83,7 +84,6 @@ go_image(
"//shared/bytesutil:go_default_library",
"//shared/keystore:go_default_library",
"//shared/prometheus:go_default_library",
"@com_github_prysmaticlabs_go_ssz//:go_default_library",
"@com_github_boltdb_bolt//:go_default_library",
"@com_github_ethereum_go_ethereum//accounts/abi/bind:go_default_library",
"@com_github_ethereum_go_ethereum//common:go_default_library",
Expand All @@ -93,13 +93,15 @@ go_image(
"@com_github_gogo_protobuf//proto:go_default_library",
"@com_github_prometheus_client_golang//prometheus:go_default_library",
"@com_github_prometheus_client_golang//prometheus/promauto:go_default_library",
"@com_github_prysmaticlabs_go_ssz//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@io_k8s_api//core/v1:go_default_library",
"@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
"@io_k8s_client_go//kubernetes:go_default_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",
],
)

Expand Down
1 change: 1 addition & 0 deletions tools/cluster-pk-manager/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
pb "github.com/prysmaticlabs/prysm/proto/cluster"
"github.com/prysmaticlabs/prysm/shared/prometheus"
"github.com/sirupsen/logrus"
_ "go.uber.org/automaxprocs"
"google.golang.org/grpc"
)

Expand Down
14 changes: 7 additions & 7 deletions tools/contract-addr/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,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"],
)

go_binary(
Expand All @@ -18,16 +19,15 @@ go_binary(
go_image(
name = "image",
srcs = ["main.go"],
importpath = "github.com/prysmaticlabs/prysm/tools/contract-addr",
visibility = ["//visibility:private"],
static = "on",
tags = ["manual"],
goarch = "amd64",
goos = "linux",
deps = [
],
race = "off",
importpath = "github.com/prysmaticlabs/prysm/tools/contract-addr",
pure = "on",
race = "off",
static = "on",
tags = ["manual"],
visibility = ["//visibility:private"],
deps = ["@org_uber_go_automaxprocs//:go_default_library"],
)

container_push(
Expand Down
2 changes: 2 additions & 0 deletions tools/contract-addr/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"io/ioutil"
"log"
"net/http"

_ "go.uber.org/automaxprocs"
)

var address = flag.String("address-path", "", "The file path to the plain text file with the contract address")
Expand Down
2 changes: 2 additions & 0 deletions tools/eth1exporter/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ go_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",
"@org_uber_go_automaxprocs//:go_default_library",
],
)

Expand All @@ -34,6 +35,7 @@ go_image(
"@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",
"@org_uber_go_automaxprocs//:go_default_library",
],
)

Expand Down
1 change: 1 addition & 0 deletions tools/eth1exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/params"
_ "go.uber.org/automaxprocs"
)

var (
Expand Down
15 changes: 9 additions & 6 deletions tools/faucet/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("@io_bazel_rules_docker//container:container.bzl", "container_push")

IMPORT_PATH = "github.com/prysmaticlabs/prysm/tools/faucet"

SRCS = [
"main.go",
"server.go",
]

DEPS = [
"//proto/faucet:faucet_go_proto",
"@org_golang_google_grpc//:go_default_library",
Expand All @@ -21,11 +23,12 @@ 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(
name = "go_default_library",
srcs = SRCS,
srcs = SRCS,
importpath = IMPORT_PATH,
visibility = ["//visibility:private"],
deps = DEPS,
Expand All @@ -40,14 +43,14 @@ go_binary(
go_image(
name = "image",
srcs = SRCS,
importpath = IMPORT_PATH,
deps = DEPS,
pure = "off", # depends on cgo for go-ethereum crypto
static = "off", # go-ethereum is bad about static
tags = ["manual"],
goarch = "amd64",
goos = "linux",
importpath = IMPORT_PATH,
pure = "off", # depends on cgo for go-ethereum crypto
race = "off",
static = "off", # go-ethereum is bad about static
tags = ["manual"],
deps = DEPS,
)

container_push(
Expand Down
1 change: 1 addition & 0 deletions tools/faucet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

recaptcha "github.com/prestonvanloon/go-recaptcha"
faucetpb "github.com/prysmaticlabs/prysm/proto/faucet"
_ "go.uber.org/automaxprocs"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
)
Expand Down
12 changes: 7 additions & 5 deletions tools/relaynode/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,30 @@ go_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",
],
)

go_image(
name = "image",
srcs = ["relaynode.go"],
goarch = "amd64",
goos = "linux",
importpath = "github.com/prysmaticlabs/prysm/tools/relaynode",
visibility = ["//visibility:private"],
pure = "on",
race = "off",
static = "on",
tags = ["manual"],
goarch = "amd64",
goos = "linux",
visibility = ["//visibility:private"],
deps = [
"//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",
],
race = "off",
pure = "on",
)

container_push(
Expand Down
1 change: 1 addition & 0 deletions tools/relaynode/relaynode.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
crypto "github.com/libp2p/go-libp2p-crypto"
multiaddr "github.com/multiformats/go-multiaddr"
"github.com/prysmaticlabs/prysm/shared/version"
_ "go.uber.org/automaxprocs"
)

var (
Expand Down
12 changes: 7 additions & 5 deletions tools/ssz-server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ go_library(
deps = [
"//proto/beacon/p2p/v1:go_default_library",
"@com_github_prysmaticlabs_go_ssz//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
)

Expand All @@ -22,18 +23,19 @@ go_binary(
go_image(
name = "image",
srcs = ["main.go"],
goarch = "amd64",
goos = "linux",
importpath = "github.com/prysmaticlabs/prysm/tools/ssz-server",
visibility = ["//visibility:private"],
pure = "on",
race = "off",
static = "on",
tags = ["manual"],
goarch = "amd64",
goos = "linux",
visibility = ["//visibility:private"],
deps = [
"//proto/beacon/p2p/v1:go_default_library",
"@com_github_prysmaticlabs_go_ssz//:go_default_library",
"@org_uber_go_automaxprocs//:go_default_library",
],
race = "off",
pure = "on",
)

container_push(
Expand Down
1 change: 1 addition & 0 deletions tools/ssz-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

ssz "github.com/prysmaticlabs/go-ssz"
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
_ "go.uber.org/automaxprocs"
)

func main() {
Expand Down
Loading

0 comments on commit dd13156

Please sign in to comment.