Documentation ¶
Index ¶
- Constants
- Variables
- func ParseResourceEnv(lookup func(key, def string) (string, bool)) (map[sealtasks.TaskType]map[abi.RegisteredSealProof]Resources, error)
- func ParseSectorID(baseName string) (abi.SectorID, error)
- func PathByType(sps SectorPaths, fileType SectorFileType) string
- func SectorName(sid abi.SectorID) string
- func SetPathByType(sps *SectorPaths, fileType SectorFileType, p string)
- type AcquireMode
- type CallError
- type CallID
- type Decl
- type ErrorCode
- type FallbackChallenges
- type Group
- type HealthReport
- type ID
- type IDList
- type PaddedByteIndex
- type PathType
- type PostSectorChallenge
- type RGetter
- type Refs
- type Resources
- type SectorFileType
- type SectorLock
- type SectorLocks
- type SectorPaths
- type SectorStorageInfo
- type StorageInfo
- type StoragePath
- type UnpaddedByteIndex
- type WindowPoStResult
- type WorkerCalls
- type WorkerID
- type WorkerInfo
- type WorkerJob
- type WorkerResources
- type WorkerReturn
- type WorkerStats
Constants ¶
View Source
const ( RWPrepared = 1 RWRunning = 0 RWRetWait = -1 RWReturned = -2 RWRetDone = -3 )
View Source
const FSOverheadDen = 10
View Source
const IDSep = "."
Variables ¶
View Source
var ErrSectorNotFound = errors.New("sector not found")
View Source
var FSOverheadSeal = map[SectorFileType]int{ FTUnsealed: FSOverheadDen, FTSealed: FSOverheadDen, FTUpdate: FSOverheadDen, FTUpdateCache: FSOverheadDen*2 + 1, FTCache: 141, }
View Source
var FsOverheadFinalized = map[SectorFileType]int{ FTUnsealed: FSOverheadDen, FTSealed: FSOverheadDen, FTUpdate: FSOverheadDen, FTUpdateCache: 1, FTCache: 1, }
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 PathTypes = []SectorFileType{FTUnsealed, FTSealed, FTCache, FTUpdate, FTUpdateCache}
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, MaxParallelismGPU: 6, GPUUtilization: 1.0, BaseMinMemory: 1 << 30, }, abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{ MaxMemory: 15 << 30, MinMemory: 15 << 30, MaxParallelism: -1, MaxParallelismGPU: 6, GPUUtilization: 1.0, 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, MaxParallelismGPU: 6, GPUUtilization: 1.0, BaseMinMemory: 64 << 30, }, abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{ MaxMemory: 150 << 30, MinMemory: 30 << 30, MaxParallelism: -1, MaxParallelismGPU: 6, GPUUtilization: 1.0, BaseMinMemory: 32 << 30, }, abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{ MaxMemory: 3 << 29, MinMemory: 1 << 30, MaxParallelism: 1, GPUUtilization: 1.0, BaseMinMemory: 10 << 30, }, abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{ MaxMemory: 2 << 10, MinMemory: 2 << 10, MaxParallelism: 1, GPUUtilization: 1.0, BaseMinMemory: 2 << 10, }, abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{ MaxMemory: 8 << 20, MinMemory: 8 << 20, MaxParallelism: 1, GPUUtilization: 1.0, BaseMinMemory: 8 << 20, }, }, sealtasks.TTFetch: { abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{ MaxMemory: 1 << 20, MinMemory: 1 << 20, MaxParallelism: 0, GPUUtilization: 0, BaseMinMemory: 0, }, abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{ MaxMemory: 1 << 20, MinMemory: 1 << 20, MaxParallelism: 0, GPUUtilization: 0, BaseMinMemory: 0, }, abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{ MaxMemory: 1 << 20, MinMemory: 1 << 20, MaxParallelism: 0, GPUUtilization: 0, BaseMinMemory: 0, }, abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{ MaxMemory: 1 << 20, MinMemory: 1 << 20, MaxParallelism: 0, GPUUtilization: 0, BaseMinMemory: 0, }, abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{ MaxMemory: 1 << 20, MinMemory: 1 << 20, MaxParallelism: 0, GPUUtilization: 0, BaseMinMemory: 0, }, }, sealtasks.TTReplicaUpdate: { 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.TTProveReplicaUpdate1: { 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.TTProveReplicaUpdate2: { abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{ MaxMemory: 190 << 30, MinMemory: 60 << 30, MaxParallelism: -1, MaxParallelismGPU: 6, GPUUtilization: 1.0, BaseMinMemory: 64 << 30, }, abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{ MaxMemory: 150 << 30, MinMemory: 30 << 30, MaxParallelism: -1, MaxParallelismGPU: 6, GPUUtilization: 1.0, BaseMinMemory: 32 << 30, }, abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{ MaxMemory: 3 << 29, MinMemory: 1 << 30, MaxParallelism: 1, GPUUtilization: 1.0, BaseMinMemory: 10 << 30, }, abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{ MaxMemory: 2 << 10, MinMemory: 2 << 10, MaxParallelism: 1, GPUUtilization: 1.0, BaseMinMemory: 2 << 10, }, abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{ MaxMemory: 8 << 20, MinMemory: 8 << 20, MaxParallelism: 1, GPUUtilization: 1.0, BaseMinMemory: 8 << 20, }, }, sealtasks.TTGenerateWindowPoSt: { abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{ MaxMemory: 120 << 30, MinMemory: 60 << 30, MaxParallelism: -1, MaxParallelismGPU: 6, GPUUtilization: 1.0, BaseMinMemory: 64 << 30, }, abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{ MaxMemory: 96 << 30, MinMemory: 30 << 30, MaxParallelism: -1, MaxParallelismGPU: 6, GPUUtilization: 1.0, BaseMinMemory: 32 << 30, }, abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{ MaxMemory: 3 << 29, MinMemory: 1 << 30, MaxParallelism: 1, GPUUtilization: 1.0, BaseMinMemory: 10 << 30, }, abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{ MaxMemory: 2 << 10, MinMemory: 2 << 10, MaxParallelism: 1, GPUUtilization: 1.0, BaseMinMemory: 2 << 10, }, abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{ MaxMemory: 8 << 20, MinMemory: 8 << 20, MaxParallelism: 1, GPUUtilization: 1.0, BaseMinMemory: 8 << 20, }, }, sealtasks.TTGenerateWinningPoSt: { abi.RegisteredSealProof_StackedDrg64GiBV1: Resources{ MaxMemory: 1 << 30, MinMemory: 1 << 30, MaxParallelism: -1, MaxParallelismGPU: 6, GPUUtilization: 1.0, BaseMinMemory: 64 << 30, }, abi.RegisteredSealProof_StackedDrg32GiBV1: Resources{ MaxMemory: 1 << 30, MinMemory: 1 << 30, MaxParallelism: -1, MaxParallelismGPU: 6, GPUUtilization: 1.0, BaseMinMemory: 32 << 30, }, abi.RegisteredSealProof_StackedDrg512MiBV1: Resources{ MaxMemory: 2 << 10, MinMemory: 2 << 10, MaxParallelism: 1, GPUUtilization: 1.0, BaseMinMemory: 10 << 30, }, abi.RegisteredSealProof_StackedDrg2KiBV1: Resources{ MaxMemory: 2 << 10, MinMemory: 2 << 10, MaxParallelism: 1, GPUUtilization: 1.0, BaseMinMemory: 2 << 10, }, abi.RegisteredSealProof_StackedDrg8MiBV1: Resources{ MaxMemory: 8 << 20, MinMemory: 8 << 20, MaxParallelism: 1, GPUUtilization: 1.0, BaseMinMemory: 8 << 20, }, }, }
Functions ¶
func ParseResourceEnv ¶
func PathByType ¶
func PathByType(sps SectorPaths, fileType SectorFileType) string
func SectorName ¶
func SetPathByType ¶
func SetPathByType(sps *SectorPaths, fileType SectorFileType, p string)
Types ¶
type AcquireMode ¶
type AcquireMode string
const ( AcquireMove AcquireMode = "move" AcquireCopy AcquireMode = "copy" )
type Decl ¶
type Decl struct { abi.SectorID SectorFileType }
type FallbackChallenges ¶
type FallbackChallenges struct { Sectors []abi.SectorNumber Challenges map[abi.SectorNumber][]uint64 }
type HealthReport ¶
type ID ¶
type ID string
ID identifies sector storage by UUID. One sector storage should map to one
filesystem, local or networked / shared by multiple machines
type PaddedByteIndex ¶
type PaddedByteIndex uint64
type PostSectorChallenge ¶
type PostSectorChallenge struct { SealProof abi.RegisteredSealProof SectorNumber abi.SectorNumber SealedCID cid.Cid Challenge []uint64 Update bool }
type Resources ¶
type Resources struct { MinMemory uint64 `envname:"MIN_MEMORY"` // What Must be in RAM for decent perf MaxMemory uint64 `envname:"MAX_MEMORY"` // Memory required (swap + ram; peak memory usage during task execution) // GPUUtilization specifes the number of GPUs a task can use GPUUtilization float64 `envname:"GPU_UTILIZATION"` // MaxParallelism specifies the number of CPU cores when GPU is NOT in use MaxParallelism int `envname:"MAX_PARALLELISM"` // -1 = multithread // MaxParallelismGPU specifies the number of CPU cores when GPU is in use MaxParallelismGPU int `envname:"MAX_PARALLELISM_GPU"` // when 0, inherits MaxParallelism BaseMinMemory uint64 `envname:"BASE_MIN_MEMORY"` // What Must be in RAM for decent perf (shared between threads) MaxConcurrent int `envname:"MAX_CONCURRENT"` // Maximum number of tasks of this type that can be scheduled on a worker (0=default, no limit) }
type SectorFileType ¶
type SectorFileType int
const ( FTUnsealed SectorFileType = 1 << iota FTSealed FTCache FTUpdate FTUpdateCache FileTypes = iota )
const (
FTNone SectorFileType = 0
)
func (SectorFileType) All ¶
func (t SectorFileType) All() [FileTypes]bool
func (SectorFileType) Has ¶
func (t SectorFileType) Has(singleType SectorFileType) bool
func (SectorFileType) SealSpaceUse ¶
func (t SectorFileType) SealSpaceUse(ssize abi.SectorSize) (uint64, error)
func (SectorFileType) StoreSpaceUse ¶
func (t SectorFileType) StoreSpaceUse(ssize abi.SectorSize) (uint64, error)
func (SectorFileType) String ¶
func (t SectorFileType) String() string
type SectorLock ¶
type SectorLocks ¶
type SectorLocks struct {
Locks []SectorLock
}
type SectorPaths ¶
type SectorStorageInfo ¶
type StorageInfo ¶
type StoragePath ¶
type UnpaddedByteIndex ¶
type UnpaddedByteIndex uint64
func (UnpaddedByteIndex) Padded ¶
func (i UnpaddedByteIndex) Padded() PaddedByteIndex
func (UnpaddedByteIndex) Valid ¶
func (i UnpaddedByteIndex) Valid() error
type WindowPoStResult ¶
type WorkerCalls ¶
type WorkerCalls interface { // async DataCid(ctx context.Context, pieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (CallID, error) AddPiece(ctx context.Context, sector storage.SectorRef, pieceSizes []abi.UnpaddedPieceSize, newPieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (CallID, error) SealPreCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, pieces []abi.PieceInfo) (CallID, error) SealPreCommit2(ctx context.Context, sector storage.SectorRef, pc1o storage.PreCommit1Out) (CallID, error) SealCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (CallID, error) SealCommit2(ctx context.Context, sector storage.SectorRef, c1o storage.Commit1Out) (CallID, error) FinalizeSector(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) (CallID, error) FinalizeReplicaUpdate(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) (CallID, error) ReleaseUnsealed(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) (CallID, error) ReplicaUpdate(ctx context.Context, sector storage.SectorRef, pieces []abi.PieceInfo) (CallID, error) ProveReplicaUpdate1(ctx context.Context, sector storage.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid) (CallID, error) ProveReplicaUpdate2(ctx context.Context, sector storage.SectorRef, sectorKey, newSealed, newUnsealed cid.Cid, vanillaProofs storage.ReplicaVanillaProofs) (CallID, error) GenerateSectorKeyFromData(ctx context.Context, sector storage.SectorRef, commD cid.Cid) (CallID, error) MoveStorage(ctx context.Context, sector storage.SectorRef, types SectorFileType) (CallID, error) UnsealPiece(context.Context, storage.SectorRef, UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) (CallID, error) Fetch(context.Context, storage.SectorRef, SectorFileType, PathType, AcquireMode) (CallID, error) // sync GenerateWinningPoSt(ctx context.Context, ppt abi.RegisteredPoStProof, mid abi.ActorID, sectors []PostSectorChallenge, randomness abi.PoStRandomness) ([]proof.PoStProof, error) GenerateWindowPoSt(ctx context.Context, ppt abi.RegisteredPoStProof, mid abi.ActorID, sectors []PostSectorChallenge, partitionIdx int, randomness abi.PoStRandomness) (WindowPoStResult, error) }
type WorkerInfo ¶
type WorkerInfo struct { Hostname string // IgnoreResources indicates whether the worker's available resources should // be used ignored (true) or used (false) for the purposes of scheduling and // task assignment. Only supported on local workers. Used for testing. // Default should be false (zero value, i.e. resources taken into account). IgnoreResources bool Resources WorkerResources }
type WorkerResources ¶
type WorkerResources struct { MemPhysical uint64 MemUsed uint64 MemSwap uint64 MemSwapUsed uint64 CPUs uint64 // Logical cores GPUs []string // if nil use the default resource table Resources map[sealtasks.TaskType]map[abi.RegisteredSealProof]Resources }
func (WorkerResources) ResourceSpec ¶
func (wr WorkerResources) ResourceSpec(spt abi.RegisteredSealProof, tt sealtasks.TaskType) Resources
type WorkerReturn ¶
type WorkerReturn interface { ReturnDataCid(ctx context.Context, callID CallID, pi abi.PieceInfo, err *CallError) error ReturnAddPiece(ctx context.Context, callID CallID, pi abi.PieceInfo, err *CallError) error ReturnSealPreCommit1(ctx context.Context, callID CallID, p1o storage.PreCommit1Out, err *CallError) error ReturnSealPreCommit2(ctx context.Context, callID CallID, sealed storage.SectorCids, err *CallError) error ReturnSealCommit1(ctx context.Context, callID CallID, out storage.Commit1Out, err *CallError) error ReturnSealCommit2(ctx context.Context, callID CallID, proof storage.Proof, err *CallError) error ReturnFinalizeSector(ctx context.Context, callID CallID, err *CallError) error ReturnReleaseUnsealed(ctx context.Context, callID CallID, err *CallError) error ReturnReplicaUpdate(ctx context.Context, callID CallID, out storage.ReplicaUpdateOut, err *CallError) error ReturnProveReplicaUpdate1(ctx context.Context, callID CallID, proofs storage.ReplicaVanillaProofs, err *CallError) error ReturnProveReplicaUpdate2(ctx context.Context, callID CallID, proof storage.ReplicaUpdateProof, err *CallError) error ReturnGenerateSectorKeyFromData(ctx context.Context, callID CallID, err *CallError) error ReturnFinalizeReplicaUpdate(ctx context.Context, callID CallID, err *CallError) error ReturnMoveStorage(ctx context.Context, callID CallID, err *CallError) error ReturnUnsealPiece(ctx context.Context, callID CallID, err *CallError) error ReturnReadPiece(ctx context.Context, callID CallID, ok bool, err *CallError) error ReturnFetch(ctx context.Context, callID CallID, err *CallError) error }
Click to show internal directories.
Click to hide internal directories.