Skip to content

Commit

Permalink
Merge branch 'pj/contract-pruning' into pj/contract-pruning-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Dec 4, 2023
2 parents d47d7e6 + 8f391dd commit 499d619
Show file tree
Hide file tree
Showing 10 changed files with 125 additions and 112 deletions.
File renamed without changes.
3 changes: 2 additions & 1 deletion api/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ type (
}

MemoryResponse struct {
Upload MemoryStatus `json:"upload"`
Download MemoryStatus `json:"download"`
Upload MemoryStatus `json:"upload"`
}

MemoryStatus struct {
Expand Down
1 change: 1 addition & 0 deletions cmd/renterd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ var (
DownloadMaxOverdrive: 5,
DownloadOverdriveTimeout: 3 * time.Second,

DownloadMaxMemory: 1 << 30, // 1 GiB
UploadMaxMemory: 1 << 30, // 1 GiB
UploadMaxOverdrive: 5,
UploadOverdriveTimeout: 3 * time.Second,
Expand Down
1 change: 1 addition & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ type (
DownloadOverdriveTimeout time.Duration `yaml:"downloadOverdriveTimeout"`
UploadOverdriveTimeout time.Duration `yaml:"uploadOverdriveTimeout"`
DownloadMaxOverdrive uint64 `yaml:"downloadMaxOverdrive"`
DownloadMaxMemory uint64 `yaml:"downloadMaxMemory"`
UploadMaxMemory uint64 `yaml:"uploadMaxMemory"`
UploadMaxOverdrive uint64 `yaml:"uploadMaxOverdrive"`
AllowUnauthenticatedDownloads bool `yaml:"allowUnauthenticatedDownloads"`
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
go.sia.tech/jape v0.11.1
go.sia.tech/mux v1.2.0
go.sia.tech/siad v1.5.10-0.20230228235644-3059c0b930ca
go.sia.tech/web/renterd v0.33.0
go.sia.tech/web/renterd v0.34.0
go.uber.org/zap v1.25.0
golang.org/x/crypto v0.15.0
golang.org/x/term v0.14.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ go.sia.tech/siad v1.5.10-0.20230228235644-3059c0b930ca h1:aZMg2AKevn7jKx+wlusWQf
go.sia.tech/siad v1.5.10-0.20230228235644-3059c0b930ca/go.mod h1:h/1afFwpxzff6/gG5i1XdAgPK7dEY6FaibhK7N5F86Y=
go.sia.tech/web v0.0.0-20230817201630-c3d9328334b1 h1:qzS1HFVPuQlOyh17zqO4Qkz63Q0YwADGMt9YAiL9mrk=
go.sia.tech/web v0.0.0-20230817201630-c3d9328334b1/go.mod h1:RKODSdOmR3VtObPAcGwQqm4qnqntDVFylbvOBbWYYBU=
go.sia.tech/web/renterd v0.33.0 h1:3RJM+Kup3bKDyFcQI51ImyItEkLOdgZ5U/OwO3UBWPY=
go.sia.tech/web/renterd v0.33.0/go.mod h1:FgXrdmAnu591a3h96RB/15pMZ74xO9457g902uE06BM=
go.sia.tech/web/renterd v0.34.0 h1:SaoTesq+Kp92nE2bWu/xHeygrt5BhDWQVUtmrRs+MXw=
go.sia.tech/web/renterd v0.34.0/go.mod h1:FgXrdmAnu591a3h96RB/15pMZ74xO9457g902uE06BM=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
Expand Down
2 changes: 1 addition & 1 deletion internal/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func NewBus(cfg BusConfig, dir string, seed types.PrivateKey, l *zap.Logger) (ht

func NewWorker(cfg config.Worker, b worker.Bus, seed types.PrivateKey, l *zap.Logger) (http.Handler, ShutdownFn, error) {
workerKey := blake2b.Sum256(append([]byte("worker"), seed...))
w, err := worker.New(workerKey, cfg.ID, b, cfg.ContractLockTimeout, cfg.BusFlushInterval, cfg.DownloadOverdriveTimeout, cfg.UploadOverdriveTimeout, cfg.DownloadMaxOverdrive, cfg.UploadMaxMemory, cfg.UploadMaxOverdrive, cfg.AllowPrivateIPs, l)
w, err := worker.New(workerKey, cfg.ID, b, cfg.ContractLockTimeout, cfg.BusFlushInterval, cfg.DownloadOverdriveTimeout, cfg.UploadOverdriveTimeout, cfg.DownloadMaxOverdrive, cfg.DownloadMaxMemory, cfg.UploadMaxMemory, cfg.UploadMaxOverdrive, cfg.AllowPrivateIPs, l)
if err != nil {
return nil, nil, err
}
Expand Down
1 change: 1 addition & 0 deletions internal/testing/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ func testWorkerCfg() config.Worker {
BusFlushInterval: testBusFlushInterval,
DownloadOverdriveTimeout: 500 * time.Millisecond,
UploadOverdriveTimeout: 500 * time.Millisecond,
DownloadMaxMemory: 1 << 28, // 256 MiB
UploadMaxMemory: 1 << 28, // 256 MiB
UploadMaxOverdrive: 5,
}
Expand Down
Loading

0 comments on commit 499d619

Please sign in to comment.