Skip to content

Commit

Permalink
[#1592] Remove debug builds
Browse files Browse the repository at this point in the history
Signed-off-by: Evgenii Stratonikov <[email protected]>
  • Loading branch information
fyrchik committed Jul 14, 2022
1 parent b850858 commit c4b86cf
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 104 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ SHELL = bash

REPO ?= $(shell go list -m)
VERSION ?= $(shell git describe --tags --dirty --always 2>/dev/null || cat VERSION 2>/dev/null || echo "develop")
DEBUG ?= false

HUB_IMAGE ?= nspccdev/neofs
HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')"
Expand Down Expand Up @@ -34,8 +33,7 @@ $(BINS): $(DIRS) dep
@echo "⇒ Build $@"
CGO_ENABLED=0 \
go build -v -trimpath \
-ldflags "-X $(REPO)/misc.Version=$(VERSION) \
-X $(REPO)/misc.Debug=$(DEBUG)" \
-ldflags "-X $(REPO)/misc.Version=$(VERSION)" \
-o $@ ./cmd/$(notdir $@)

$(DIRS):
Expand Down
4 changes: 1 addition & 3 deletions cmd/neofs-ir/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ func main() {
exitErr(err)

log.Info("application started",
zap.String("version", misc.Version),
zap.String("debug", misc.Debug),
)
zap.String("version", misc.Version))

select {
case <-ctx.Done():
Expand Down
16 changes: 0 additions & 16 deletions cmd/neofs-node/config/util.go

This file was deleted.

4 changes: 1 addition & 3 deletions cmd/neofs-node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ func bootUp(c *cfg) {

func wait(c *cfg) {
c.log.Info("application started",
zap.String("version", misc.Version),
zap.String("debug", misc.Debug),
)
zap.String("version", misc.Version))

select {
case <-c.ctx.Done(): // graceful shutdown
Expand Down
6 changes: 1 addition & 5 deletions misc/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@ import (
var (
// Version is an application version.
Version = "dev"

// Debug is an application debug mode flag.
Debug = "false"
)

// BuildInfo returns human-readable information about this binary.
func BuildInfo(component string) string {
return fmt.Sprintf("%s\nVersion: %s \nGoVersion: %s\nDebug: %s\n",
return fmt.Sprintf("%s\nVersion: %s \nGoVersion: %s\n",
component,
Version,
runtime.Version(),
Debug,
)
}
57 changes: 0 additions & 57 deletions pkg/innerring/config/config.go

This file was deleted.

8 changes: 2 additions & 6 deletions pkg/innerring/innerring.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,6 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper, errChan chan<-
cfg.GetDuration("indexer.cache_timeout"),
)

// create global runtime config reader
globalConfig := config.NewGlobalConfigReader(cfg, server.netmapClient)

clientCache := newClientCache(&clientCacheParams{
Log: log,
Key: &server.key.PrivateKey,
Expand Down Expand Up @@ -602,11 +599,10 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper, errChan chan<-

// create settlement processor dependencies
settlementDeps := settlementDeps{
globalConfig: globalConfig,
log: server.log,
cnrSrc: cntClient.AsContainerSource(cnrClient),
auditClient: server.auditClient,
nmSrc: server.netmapClient,
nmClient: server.netmapClient,
clientCache: clientCache,
balanceClient: server.balanceClient,
}
Expand All @@ -630,7 +626,7 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper, errChan chan<-
SGStorage: auditCalcDeps,
AccountStorage: auditCalcDeps,
Exchanger: auditCalcDeps,
AuditFeeFetcher: auditCalcDeps,
AuditFeeFetcher: server.netmapClient,
},
auditSettlement.WithLogger(server.log),
)
Expand Down
16 changes: 5 additions & 11 deletions pkg/innerring/settlement.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
auditClient "github.com/nspcc-dev/neofs-node/pkg/morph/client/audit"
balanceClient "github.com/nspcc-dev/neofs-node/pkg/morph/client/balance"
containerClient "github.com/nspcc-dev/neofs-node/pkg/morph/client/container"
netmapClient "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
auditAPI "github.com/nspcc-dev/neofs-sdk-go/audit"
containerAPI "github.com/nspcc-dev/neofs-sdk-go/container"
Expand All @@ -29,26 +30,19 @@ import (
"go.uber.org/zap"
)

type globalConfig interface {
BasicIncomeRate() (uint64, error)
AuditFee() (uint64, error)
}

const (
auditSettlementContext = "audit"
basicIncomeSettlementContext = "basic income"
)

type settlementDeps struct {
globalConfig

log *logger.Logger

cnrSrc container.Source

auditClient *auditClient.Client

nmSrc netmap.Source
nmClient *netmapClient.Client

clientCache *ClientCache

Expand Down Expand Up @@ -132,9 +126,9 @@ func (s settlementDeps) buildContainer(e uint64, cid cid.ID) ([][]netmapAPI.Node
)

if e > 0 {
nm, err = s.nmSrc.GetNetMapByEpoch(e)
nm, err = s.nmClient.GetNetMapByEpoch(e)
} else {
nm, err = netmap.GetLatestNetworkMap(s.nmSrc)
nm, err = netmap.GetLatestNetworkMap(s.nmClient)
}

if err != nil {
Expand Down Expand Up @@ -254,7 +248,7 @@ func (s settlementDeps) Transfer(sender, recipient user.ID, amount *big.Int, det
}

func (b basicIncomeSettlementDeps) BasicRate() (uint64, error) {
return b.BasicIncomeRate()
return b.nmClient.BasicIncomeRate()
}

func (b basicIncomeSettlementDeps) Estimations(epoch uint64) ([]*containerClient.Estimations, error) {
Expand Down

0 comments on commit c4b86cf

Please sign in to comment.