Documentation ¶
Index ¶
- Variables
- func WithPriority(ctx context.Context, priority int) context.Context
- type FaultTracker
- type LocalWorker
- func (l *LocalWorker) AddPiece(ctx context.Context, sector abi.SectorID, epcs []abi.UnpaddedPieceSize, ...) (abi.PieceInfo, error)
- func (l *LocalWorker) Close() error
- func (l *LocalWorker) Closing(ctx context.Context) (<-chan struct{}, error)
- func (l *LocalWorker) Fetch(ctx context.Context, sector abi.SectorID, fileType stores.SectorFileType, ...) error
- func (l *LocalWorker) FinalizeSector(ctx context.Context, sector abi.SectorID, keepUnsealed []storage2.Range) error
- func (l *LocalWorker) Info(context.Context) (storiface.WorkerInfo, error)
- func (l *LocalWorker) MoveStorage(ctx context.Context, sector abi.SectorID, types stores.SectorFileType) error
- func (l *LocalWorker) NewSector(ctx context.Context, sector abi.SectorID) error
- func (l *LocalWorker) Paths(ctx context.Context) ([]stores.StoragePath, error)
- func (l *LocalWorker) ReadPiece(ctx context.Context, writer io.Writer, sector abi.SectorID, ...) (bool, error)
- func (l *LocalWorker) ReleaseUnsealed(ctx context.Context, sector abi.SectorID, safeToFree []storage2.Range) error
- func (l *LocalWorker) Remove(ctx context.Context, sector abi.SectorID) error
- func (l *LocalWorker) SealCommit1(ctx context.Context, sector abi.SectorID, ticket abi.SealRandomness, ...) (output storage2.Commit1Out, err error)
- func (l *LocalWorker) SealCommit2(ctx context.Context, sector abi.SectorID, phase1Out storage2.Commit1Out) (proof storage2.Proof, err error)
- func (l *LocalWorker) SealPreCommit1(ctx context.Context, sector abi.SectorID, ticket abi.SealRandomness, ...) (out storage2.PreCommit1Out, err error)
- func (l *LocalWorker) SealPreCommit2(ctx context.Context, sector abi.SectorID, phase1Out storage2.PreCommit1Out) (cids storage2.SectorCids, err error)
- func (l *LocalWorker) TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error)
- func (l *LocalWorker) UnsealPiece(ctx context.Context, sector abi.SectorID, index storiface.UnpaddedByteIndex, ...) error
- type Manager
- func (m *Manager) AddLocalStorage(ctx context.Context, path string) error
- func (m *Manager) AddPiece(ctx context.Context, sector abi.SectorID, ...) (abi.PieceInfo, error)
- func (m *Manager) AddWorker(ctx context.Context, w Worker) error
- func (m *Manager) CheckProvable(ctx context.Context, spt abi.RegisteredSealProof, sectors []abi.SectorID) ([]abi.SectorID, error)
- func (m *Manager) Close(ctx context.Context) error
- func (m *Manager) FinalizeSector(ctx context.Context, sector abi.SectorID, keepUnsealed []storage.Range) error
- func (m *Manager) FsStat(ctx context.Context, id stores.ID) (fsutil.FsStat, error)
- func (m *Manager) NewSector(ctx context.Context, sector abi.SectorID) error
- func (m *Manager) ReadPiece(ctx context.Context, sink io.Writer, sector abi.SectorID, ...) error
- func (m *Manager) ReleaseUnsealed(ctx context.Context, sector abi.SectorID, safeToFree []storage.Range) error
- func (m *Manager) Remove(ctx context.Context, sector abi.SectorID) error
- func (m *Manager) SchedDiag(ctx context.Context) (interface{}, error)
- func (m *Manager) SealCommit1(ctx context.Context, sector abi.SectorID, ticket abi.SealRandomness, ...) (out storage.Commit1Out, err error)
- func (m *Manager) SealCommit2(ctx context.Context, sector abi.SectorID, phase1Out storage.Commit1Out) (out storage.Proof, err error)
- func (m *Manager) SealPreCommit1(ctx context.Context, sector abi.SectorID, ticket abi.SealRandomness, ...) (out storage.PreCommit1Out, err error)
- func (m *Manager) SealPreCommit2(ctx context.Context, sector abi.SectorID, phase1Out storage.PreCommit1Out) (out storage.SectorCids, err error)
- func (m *Manager) SectorSize() abi.SectorSize
- func (m *Manager) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (m *Manager) StorageLocal(ctx context.Context) (map[stores.ID]string, error)
- func (m *Manager) WorkerJobs() map[uint64][]storiface.WorkerJob
- func (m *Manager) WorkerStats() map[uint64]storiface.WorkerStats
- type Resources
- type SchedDiagInfo
- type SchedDiagRequestInfo
- type SealerConfig
- type SectorManager
- type StorageAuth
- type URLs
- type Worker
- type WorkerAction
- type WorkerConfig
- type WorkerID
- type WorkerSelector
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultSchedPriority = 0
View Source
var ErrNoWorkers = errors.New("no suitable workers found")
View Source
var InitWait = 3 * time.Second
View Source
var ParallelDenom uint64 = 100
View Source
var ParallelNum uint64 = 92
Percent of threads to allocate to parallel tasks
12 * 0.92 = 11 16 * 0.92 = 14 24 * 0.92 = 22 32 * 0.92 = 29 64 * 0.92 = 58 128 * 0.92 = 117
View Source
var ResourceTable = map[sealtasks.TaskType]map[abi.RegisteredSealProof]Resources{ sealtasks.TTAddPiece: { abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{ MaxMemory: 8 << 30, MinMemory: 8 << 30, MaxParallelism: 1, BaseMinMemory: 1 << 30, }, abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{ MaxMemory: 4 << 30, MinMemory: 4 << 30, MaxParallelism: 1, BaseMinMemory: 1 << 30, }, abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{ MaxMemory: 1 << 30, MinMemory: 1 << 30, MaxParallelism: 1, BaseMinMemory: 1 << 30, }, abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{ MaxMemory: 2 << 10, MinMemory: 2 << 10, MaxParallelism: 1, BaseMinMemory: 2 << 10, }, abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{ MaxMemory: 8 << 20, MinMemory: 8 << 20, MaxParallelism: 1, BaseMinMemory: 8 << 20, }, }, sealtasks.TTPreCommit1: { abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{ MaxMemory: 128 << 30, MinMemory: 112 << 30, MaxParallelism: 1, BaseMinMemory: 10 << 20, }, abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{ MaxMemory: 64 << 30, MinMemory: 56 << 30, MaxParallelism: 1, BaseMinMemory: 10 << 20, }, abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{ MaxMemory: 1 << 30, MinMemory: 768 << 20, MaxParallelism: 1, BaseMinMemory: 1 << 20, }, abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{ MaxMemory: 2 << 10, MinMemory: 2 << 10, MaxParallelism: 1, BaseMinMemory: 2 << 10, }, abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{ MaxMemory: 8 << 20, MinMemory: 8 << 20, MaxParallelism: 1, BaseMinMemory: 8 << 20, }, }, sealtasks.TTPreCommit2: { abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{ MaxMemory: 30 << 30, MinMemory: 30 << 30, MaxParallelism: -1, CanGPU: true, BaseMinMemory: 1 << 30, }, abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{ MaxMemory: 15 << 30, MinMemory: 15 << 30, MaxParallelism: -1, CanGPU: true, BaseMinMemory: 1 << 30, }, abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{ MaxMemory: 3 << 29, MinMemory: 1 << 30, MaxParallelism: -1, BaseMinMemory: 1 << 30, }, abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{ MaxMemory: 2 << 10, MinMemory: 2 << 10, MaxParallelism: -1, BaseMinMemory: 2 << 10, }, abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{ MaxMemory: 8 << 20, MinMemory: 8 << 20, MaxParallelism: -1, BaseMinMemory: 8 << 20, }, }, sealtasks.TTCommit1: { abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{ MaxMemory: 1 << 30, MinMemory: 1 << 30, MaxParallelism: 0, BaseMinMemory: 1 << 30, }, abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{ MaxMemory: 1 << 30, MinMemory: 1 << 30, MaxParallelism: 0, BaseMinMemory: 1 << 30, }, abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{ MaxMemory: 1 << 30, MinMemory: 1 << 30, MaxParallelism: 0, BaseMinMemory: 1 << 30, }, abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{ MaxMemory: 2 << 10, MinMemory: 2 << 10, MaxParallelism: 0, BaseMinMemory: 2 << 10, }, abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{ MaxMemory: 8 << 20, MinMemory: 8 << 20, MaxParallelism: 0, BaseMinMemory: 8 << 20, }, }, sealtasks.TTCommit2: { abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{ MaxMemory: 190 << 30, MinMemory: 60 << 30, MaxParallelism: -1, CanGPU: true, BaseMinMemory: 64 << 30, }, abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{ MaxMemory: 150 << 30, MinMemory: 30 << 30, MaxParallelism: -1, CanGPU: true, BaseMinMemory: 32 << 30, }, abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{ MaxMemory: 3 << 29, MinMemory: 1 << 30, MaxParallelism: 1, CanGPU: true, BaseMinMemory: 10 << 30, }, abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{ MaxMemory: 2 << 10, MinMemory: 2 << 10, MaxParallelism: 1, CanGPU: true, BaseMinMemory: 2 << 10, }, abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{ MaxMemory: 8 << 20, MinMemory: 8 << 20, MaxParallelism: 1, CanGPU: true, BaseMinMemory: 8 << 20, }, }, sealtasks.TTFetch: { abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{ MaxMemory: 1 << 20, MinMemory: 1 << 20, MaxParallelism: 0, CanGPU: false, BaseMinMemory: 0, }, abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{ MaxMemory: 1 << 20, MinMemory: 1 << 20, MaxParallelism: 0, CanGPU: false, BaseMinMemory: 0, }, abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{ MaxMemory: 1 << 20, MinMemory: 1 << 20, MaxParallelism: 0, CanGPU: false, BaseMinMemory: 0, }, abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{ MaxMemory: 1 << 20, MinMemory: 1 << 20, MaxParallelism: 0, CanGPU: false, BaseMinMemory: 0, }, abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{ MaxMemory: 1 << 20, MinMemory: 1 << 20, MaxParallelism: 0, CanGPU: false, BaseMinMemory: 0, }, }, }
View Source
var SchedPriorityKey schedPrioCtxKey
View Source
var (
SchedWindows = 2
)
View Source
var SelectorTimeout = 5 * time.Second
Functions ¶
Types ¶
type FaultTracker ¶
type FaultTracker interface {
CheckProvable(ctx context.Context, spt abi.RegisteredSealProof, sectors []abi.SectorID) ([]abi.SectorID, error)
}
FaultTracker TODO: Track things more actively
type LocalWorker ¶
type LocalWorker struct {
// contains filtered or unexported fields
}
func NewLocalWorker ¶
func NewLocalWorker(wcfg WorkerConfig, store stores.Store, local *stores.Local, sindex stores.SectorIndex) *LocalWorker
func (*LocalWorker) AddPiece ¶
func (l *LocalWorker) AddPiece(ctx context.Context, sector abi.SectorID, epcs []abi.UnpaddedPieceSize, sz abi.UnpaddedPieceSize, r io.Reader) (abi.PieceInfo, error)
func (*LocalWorker) Close ¶
func (l *LocalWorker) Close() error
func (*LocalWorker) Closing ¶
func (l *LocalWorker) Closing(ctx context.Context) (<-chan struct{}, error)
func (*LocalWorker) Fetch ¶
func (l *LocalWorker) Fetch(ctx context.Context, sector abi.SectorID, fileType stores.SectorFileType, ptype stores.PathType, am stores.AcquireMode) error
func (*LocalWorker) FinalizeSector ¶
func (*LocalWorker) Info ¶
func (l *LocalWorker) Info(context.Context) (storiface.WorkerInfo, error)
func (*LocalWorker) MoveStorage ¶
func (l *LocalWorker) MoveStorage(ctx context.Context, sector abi.SectorID, types stores.SectorFileType) error
func (*LocalWorker) Paths ¶
func (l *LocalWorker) Paths(ctx context.Context) ([]stores.StoragePath, error)
func (*LocalWorker) ReadPiece ¶
func (l *LocalWorker) ReadPiece(ctx context.Context, writer io.Writer, sector abi.SectorID, index storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error)
func (*LocalWorker) ReleaseUnsealed ¶
func (*LocalWorker) SealCommit1 ¶
func (l *LocalWorker) SealCommit1(ctx context.Context, sector abi.SectorID, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage2.SectorCids) (output storage2.Commit1Out, err error)
func (*LocalWorker) SealCommit2 ¶
func (l *LocalWorker) SealCommit2(ctx context.Context, sector abi.SectorID, phase1Out storage2.Commit1Out) (proof storage2.Proof, err error)
func (*LocalWorker) SealPreCommit1 ¶
func (l *LocalWorker) SealPreCommit1(ctx context.Context, sector abi.SectorID, ticket abi.SealRandomness, pieces []abi.PieceInfo) (out storage2.PreCommit1Out, err error)
func (*LocalWorker) SealPreCommit2 ¶
func (l *LocalWorker) SealPreCommit2(ctx context.Context, sector abi.SectorID, phase1Out storage2.PreCommit1Out) (cids storage2.SectorCids, err error)
func (*LocalWorker) UnsealPiece ¶
func (l *LocalWorker) UnsealPiece(ctx context.Context, sector abi.SectorID, index storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, cid cid.Cid) error
type Manager ¶
func New ¶
func New(ctx context.Context, ls stores.LocalStorage, si stores.SectorIndex, cfg *ffiwrapper.Config, sc SealerConfig, urls URLs, sa StorageAuth) (*Manager, error)
func (*Manager) AddLocalStorage ¶
func (*Manager) CheckProvable ¶
func (m *Manager) CheckProvable(ctx context.Context, spt abi.RegisteredSealProof, sectors []abi.SectorID) ([]abi.SectorID, error)
CheckProvable returns unprovable sectors
func (*Manager) FinalizeSector ¶
func (*Manager) ReadPiece ¶
func (m *Manager) ReadPiece(ctx context.Context, sink io.Writer, sector abi.SectorID, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) error
func (*Manager) ReleaseUnsealed ¶
func (*Manager) SealCommit1 ¶
func (m *Manager) SealCommit1(ctx context.Context, sector abi.SectorID, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (out storage.Commit1Out, err error)
func (*Manager) SealCommit2 ¶
func (*Manager) SealPreCommit1 ¶
func (*Manager) SealPreCommit2 ¶
func (m *Manager) SealPreCommit2(ctx context.Context, sector abi.SectorID, phase1Out storage.PreCommit1Out) (out storage.SectorCids, err error)
func (*Manager) SectorSize ¶
func (m *Manager) SectorSize() abi.SectorSize
func (*Manager) StorageLocal ¶
func (*Manager) WorkerStats ¶
func (m *Manager) WorkerStats() map[uint64]storiface.WorkerStats
type Resources ¶
type SchedDiagInfo ¶
type SchedDiagInfo struct { Requests []SchedDiagRequestInfo OpenWindows []WorkerID }
type SchedDiagRequestInfo ¶
type SealerConfig ¶
type SectorManager ¶
type SectorManager interface { SectorSize() abi.SectorSize ReadPiece(context.Context, io.Writer, abi.SectorID, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) error ffiwrapper.StorageSealer storage.Prover FaultTracker }
type StorageAuth ¶
type Worker ¶
type Worker interface { ffiwrapper.StorageSealer MoveStorage(ctx context.Context, sector abi.SectorID, types stores.SectorFileType) error Fetch(ctx context.Context, s abi.SectorID, ft stores.SectorFileType, ptype stores.PathType, am stores.AcquireMode) error UnsealPiece(context.Context, abi.SectorID, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) error ReadPiece(context.Context, io.Writer, abi.SectorID, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize) (bool, error) TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error) // Returns paths accessible to the worker Paths(context.Context) ([]stores.StoragePath, error) Info(context.Context) (storiface.WorkerInfo, error) // returns channel signalling worker shutdown Closing(context.Context) (<-chan struct{}, error) Close() error }
type WorkerConfig ¶
type WorkerConfig struct { SealProof abi.RegisteredSealProof TaskTypes []sealtasks.TaskType NoSwap bool }
type WorkerSelector ¶
type WorkerSelector interface { Ok(ctx context.Context, task sealtasks.TaskType, spt abi.RegisteredSealProof, a *workerHandle) (bool, error) // true if worker is acceptable for performing a task Cmp(ctx context.Context, task sealtasks.TaskType, a, b *workerHandle) (bool, error) // true if a is preferred over b }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.