Documentation
¶
Index ¶
- Variables
- func IsPanicError(value byte) bool
- func LabelsEqual(a []metaschedulerabi.Label, b []metaschedulerabi.Label) bool
- func MergeLabels(a []metaschedulerabi.Label, b []metaschedulerabi.Label) []metaschedulerabi.Label
- func ParseArrayLengthMismatch(inputs []interface{}) error
- func ParseDoubleEndedQueueError(name string, inputs []interface{}) error
- func ParseError(name string, inputs []interface{}) error
- func ParseInvalidNodesCount(inputs []interface{}) error
- func ParseInvalidTotalCpus(inputs []interface{}) error
- func ParseInvalidTotalMem(inputs []interface{}) error
- func ParseNoJob(inputs []interface{}) error
- func ProcessLabel(l metaschedulerabi.Label) metaschedulerabi.Label
- func ProcessLabels(ll []metaschedulerabi.Label) []metaschedulerabi.Label
- func ProviderHardwareEqual(a metaschedulerabi.ProviderHardware, b metaschedulerabi.ProviderHardware) bool
- func WrapError(originalErr error) (newErr error)
- type AlreadyDone
- type ArrayLengthMismatch
- type Banned
- type Client
- func (c *Client) Claim(ctx context.Context) error
- func (c *Client) ClaimCancelling(ctx context.Context) error
- func (c *Client) ClaimTopUp(ctx context.Context) error
- func (c *Client) GetJob(ctx context.Context, jobID [32]byte) (*Job, error)
- func (c *Client) GetJobStatus(ctx context.Context, jobID [32]byte) (JobStatus, error)
- func (c *Client) GetJobs(ctx context.Context) (*ProviderJobIterator, error)
- func (c *Client) GetOldInfo(ctx context.Context) (*metaschedulerabi.Provider, error)
- func (c *Client) GetProviderAddress() common.Address
- func (c *Client) IsRequestNewJobEnabled(ctx context.Context) (bool, error)
- func (c *Client) RefuseJob(ctx context.Context, jobID [32]byte) error
- func (c *Client) Register(ctx context.Context, hardware metaschedulerabi.ProviderHardware, ...) error
- func (c *Client) SetJobStatus(ctx context.Context, jobID [32]byte, status JobStatus, ...) error
- func (c *Client) WatchEvents(ctx context.Context, ...) (event.Subscription, error)
- type CustomerMetaSchedulerProviderOnly
- type CustomerOnly
- type DoubleEndedQueueEmpty
- type DoubleEndedQueueOutOfBounds
- type InsufficientFunds
- type InvalidJob
- type InvalidJobDefinition
- type InvalidNodesCount
- type InvalidTotalCpus
- type InvalidTotalMem
- type InvalidTransition
- type Job
- type JobHotStatusOnly
- type JobProviderOnly
- type JobStatus
- type MetaScheduledScheduledStatusOnly
- type MetaScheduler
- type NewJobRequestDisabled
- type NoJob
- type NoProvider
- type NoSpendingAuthority
- type PanicError
- type ProviderJobIterator
- type ProviderNotJoined
- type RemainingTimeAboveLimit
- type RunningColdStatusOnly
- type RunningScheduledStatusOnly
- type SameStatusError
- type SetJobStatusOption
- type WaitingApprovalOnly
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MetaschedulerABI *abi.ABI
)
Functions ¶
func IsPanicError ¶
func LabelsEqual ¶
func LabelsEqual( a []metaschedulerabi.Label, b []metaschedulerabi.Label, ) bool
func MergeLabels ¶
func MergeLabels( a []metaschedulerabi.Label, b []metaschedulerabi.Label, ) []metaschedulerabi.Label
MergeLabels b on a.
b has priority over a.
func ParseArrayLengthMismatch ¶
func ParseArrayLengthMismatch(inputs []interface{}) error
func ParseError ¶
func ParseInvalidNodesCount ¶
func ParseInvalidNodesCount(inputs []interface{}) error
func ParseInvalidTotalCpus ¶
func ParseInvalidTotalCpus(inputs []interface{}) error
func ParseInvalidTotalMem ¶
func ParseInvalidTotalMem(inputs []interface{}) error
func ParseNoJob ¶
func ParseNoJob(inputs []interface{}) error
func ProcessLabel ¶
func ProcessLabel(l metaschedulerabi.Label) metaschedulerabi.Label
func ProcessLabels ¶
func ProcessLabels(ll []metaschedulerabi.Label) []metaschedulerabi.Label
func ProviderHardwareEqual ¶
func ProviderHardwareEqual( a metaschedulerabi.ProviderHardware, b metaschedulerabi.ProviderHardware, ) bool
Types ¶
type AlreadyDone ¶
type AlreadyDone struct{}
func ParseAlreadyDone ¶
func ParseAlreadyDone(inputs []interface{}) *AlreadyDone
func (*AlreadyDone) Error ¶
func (e *AlreadyDone) Error() string
type ArrayLengthMismatch ¶
type ArrayLengthMismatch struct{}
func (*ArrayLengthMismatch) Error ¶
func (e *ArrayLengthMismatch) Error() string
type Banned ¶
type Banned struct{}
func ParseBanned ¶
func ParseBanned(inputs []interface{}) *Banned
type Client ¶
type Client struct {
bind.DeployBackend
// contains filtered or unexported fields
}
Client handles communications with the smart contract.
func (*Client) Claim ¶
Claim a job.
If the queue is not empty, it will claim the job and return true. Else, it will return false. Else, it will return false and an error.
func (*Client) ClaimCancelling ¶
ClaimCancelling a cancelling call.
func (*Client) ClaimTopUp ¶
ClaimTopUp a top up call.
func (*Client) GetJobStatus ¶
GetJobStatus fetches the job status.
func (*Client) GetJobs ¶
func (c *Client) GetJobs(ctx context.Context) (*ProviderJobIterator, error)
func (*Client) GetOldInfo ¶
func (*Client) GetProviderAddress ¶
func (*Client) IsRequestNewJobEnabled ¶ added in v0.12.10
func (*Client) Register ¶
func (c *Client) Register( ctx context.Context, hardware metaschedulerabi.ProviderHardware, prices metaschedulerabi.ProviderPrices, labels []metaschedulerabi.Label, ) error
Register a cluster
Will send a transaction to register the cluster.
func (*Client) SetJobStatus ¶
func (c *Client) SetJobStatus( ctx context.Context, jobID [32]byte, status JobStatus, jobDurationMinute uint64, opts ...SetJobStatusOption, ) error
SetJobStatus reports the [State] state to the metascheduler.
func (*Client) WatchEvents ¶
func (c *Client) WatchEvents( ctx context.Context, claimNextTopUpJobEvents chan<- *metaschedulerabi.MetaSchedulerClaimNextTopUpJobEvent, claimNextCancellingJobEvents chan<- *metaschedulerabi.MetaSchedulerClaimNextCancellingJobEvent, claimJobEvents chan<- *metaschedulerabi.MetaSchedulerClaimJobEvent, ) (event.Subscription, error)
WatchEvents observes the incoming ClaimNextTopUpJobEvent, ClaimNextCancellingJobEvent and ClaimJobEvent.
type CustomerMetaSchedulerProviderOnly ¶
type CustomerMetaSchedulerProviderOnly struct{}
func ParseCustomerMetaSchedulerProviderOnly ¶
func ParseCustomerMetaSchedulerProviderOnly(
inputs []interface{},
) *CustomerMetaSchedulerProviderOnly
func (*CustomerMetaSchedulerProviderOnly) Error ¶
func (e *CustomerMetaSchedulerProviderOnly) Error() string
type CustomerOnly ¶
func ParseCustomerOnly ¶
func ParseCustomerOnly(inputs []interface{}) *CustomerOnly
func (*CustomerOnly) Error ¶
func (e *CustomerOnly) Error() string
type DoubleEndedQueueEmpty ¶
type DoubleEndedQueueEmpty struct{}
func ParseDoubleEndedQueueEmpty ¶
func ParseDoubleEndedQueueEmpty(inputs []interface{}) *DoubleEndedQueueEmpty
func (*DoubleEndedQueueEmpty) Error ¶
func (e *DoubleEndedQueueEmpty) Error() string
type DoubleEndedQueueOutOfBounds ¶
type DoubleEndedQueueOutOfBounds struct{}
func ParseDoubleEndedQueueOutOfBounds ¶
func ParseDoubleEndedQueueOutOfBounds(inputs []interface{}) *DoubleEndedQueueOutOfBounds
func (*DoubleEndedQueueOutOfBounds) Error ¶
func (e *DoubleEndedQueueOutOfBounds) Error() string
type InsufficientFunds ¶
func ParseInsufficientFunds ¶
func ParseInsufficientFunds(inputs []interface{}) *InsufficientFunds
func (*InsufficientFunds) Error ¶
func (e *InsufficientFunds) Error() string
type InvalidJob ¶
type InvalidJob struct{}
func ParseInvalidJob ¶
func ParseInvalidJob(inputs []interface{}) *InvalidJob
func (*InvalidJob) Error ¶
func (e *InvalidJob) Error() string
type InvalidJobDefinition ¶
type InvalidJobDefinition struct{}
func ParseInvalidJobDefinition ¶
func ParseInvalidJobDefinition(
inputs []interface{},
) *InvalidJobDefinition
func (*InvalidJobDefinition) Error ¶
func (e *InvalidJobDefinition) Error() string
type InvalidNodesCount ¶
type InvalidNodesCount struct{}
func (*InvalidNodesCount) Error ¶
func (e *InvalidNodesCount) Error() string
type InvalidTotalCpus ¶
type InvalidTotalCpus struct{}
func (*InvalidTotalCpus) Error ¶
func (e *InvalidTotalCpus) Error() string
type InvalidTotalMem ¶
type InvalidTotalMem struct{}
func (*InvalidTotalMem) Error ¶
func (e *InvalidTotalMem) Error() string
type InvalidTransition ¶
func ParseInvalidTransition ¶
func ParseInvalidTransition(inputs []interface{}) *InvalidTransition
func (*InvalidTransition) Error ¶
func (e *InvalidTransition) Error() string
type Job ¶
type Job struct {
JobID [32]byte
Status JobStatus
CustomerAddr common.Address
ProviderAddr common.Address
Definition metaschedulerabi.JobDefinition
Cost metaschedulerabi.JobCost
Time metaschedulerabi.JobTime
JobName [32]byte
HasCancelRequest bool
LastError string
}
func FromStructToJob ¶
func FromStructToJob(s metaschedulerabi.Job) *Job
type JobHotStatusOnly ¶
type JobHotStatusOnly struct {
Current JobStatus
}
func ParseJobHotStatusOnly ¶
func ParseJobHotStatusOnly(inputs []interface{}) *JobHotStatusOnly
func (*JobHotStatusOnly) Error ¶
func (e *JobHotStatusOnly) Error() string
type JobProviderOnly ¶
func ParseJobProviderOnly ¶
func ParseJobProviderOnly(inputs []interface{}) *JobProviderOnly
func (*JobProviderOnly) Error ¶
func (e *JobProviderOnly) Error() string
type JobStatus ¶
type JobStatus uint8
const ( JobStatusPending JobStatus = 0 JobStatusMetaScheduled JobStatus = 1 JobStatusScheduled JobStatus = 2 JobStatusRunning JobStatus = 3 JobStatusCancelled JobStatus = 4 JobStatusFinished JobStatus = 5 JobStatusFailed JobStatus = 6 JobStatusOutOfCredits JobStatus = 7 JobStatusPanicked JobStatus = 8 JobStatusUnknown JobStatus = 255 )
type MetaScheduledScheduledStatusOnly ¶
type MetaScheduledScheduledStatusOnly struct {
Current JobStatus
}
func ParseMetaScheduledScheduledStatusOnly ¶
func ParseMetaScheduledScheduledStatusOnly(
inputs []interface{},
) *MetaScheduledScheduledStatusOnly
func (*MetaScheduledScheduledStatusOnly) Error ¶
func (e *MetaScheduledScheduledStatusOnly) Error() string
type MetaScheduler ¶
type MetaScheduler interface {
IsRequestNewJobEnabled(ctx context.Context) (bool, error)
// Claim a job for scheduling.
Claim(ctx context.Context) error
// Claim cancelling calls.
ClaimCancelling(ctx context.Context) error
// Claim top up calls.
ClaimTopUp(ctx context.Context) error
// Refuse a job for metascheduling.
RefuseJob(ctx context.Context, jobID [32]byte) error
// WatchEvents observes the incoming ClaimNextTopUpJobEvent, ClaimNextCancellingJobEvent and ClaimJobEvent.
WatchEvents(
ctx context.Context,
claimNextTopUpJobEvents chan<- *metaschedulerabi.MetaSchedulerClaimNextTopUpJobEvent,
claimNextCancellingJobEvents chan<- *metaschedulerabi.MetaSchedulerClaimNextCancellingJobEvent,
claimJobEvents chan<- *metaschedulerabi.MetaSchedulerClaimJobEvent,
) (event.Subscription, error)
// GetProviderAddress fetches the provider public address.
GetProviderAddress() common.Address
// GetOldInfo fetches the last registration provider information.
GetOldInfo(ctx context.Context) (*metaschedulerabi.Provider, error)
// GetJobStatus fetches the job status.
GetJobStatus(ctx context.Context, jobID [32]byte) (JobStatus, error)
SetJobStatus(
ctx context.Context,
jobID [32]byte,
status JobStatus,
jobDurationMinute uint64,
opts ...SetJobStatusOption,
) error
Register(
ctx context.Context,
hardware metaschedulerabi.ProviderHardware,
prices metaschedulerabi.ProviderPrices,
labels []metaschedulerabi.Label,
) error
// GetJob fetches a job.
GetJob(ctx context.Context, jobID [32]byte) (*Job, error)
// GetJobs fetches the jobs of the provider.
GetJobs(ctx context.Context) (*ProviderJobIterator, error)
}
func NewClient ¶
func NewClient( chainID *big.Int, metaschedulerAddress common.Address, deployBackend bind.DeployBackend, rpc bind.ContractBackend, ws bind.ContractBackend, pk *ecdsa.PrivateKey, ) MetaScheduler
type NewJobRequestDisabled ¶
type NewJobRequestDisabled struct{}
func ParseNewJobRequestDisabled ¶
func ParseNewJobRequestDisabled(inputs []interface{}) *NewJobRequestDisabled
func (*NewJobRequestDisabled) Error ¶
func (e *NewJobRequestDisabled) Error() string
type NoProvider ¶
type NoProvider struct{}
func ParseNoProvider ¶
func ParseNoProvider(inputs []interface{}) *NoProvider
func (*NoProvider) Error ¶
func (e *NoProvider) Error() string
type NoSpendingAuthority ¶
type NoSpendingAuthority struct{}
func ParseNoSpendingAuthority ¶
func ParseNoSpendingAuthority(inputs []interface{}) *NoSpendingAuthority
func (*NoSpendingAuthority) Error ¶
func (e *NoSpendingAuthority) Error() string
type PanicError ¶
type PanicError byte
const ( PanicErrorAssertionError PanicError = 0x1 PanicErrorArithmeticUnderOrOverflow PanicError = 0x11 PanicErrorDivisionByZero PanicError = 0x12 PanicErrorEnumConversionOutOfBounds PanicError = 0x21 PanicErrorIncorrectlyEncodedStorageByteArray PanicError = 0x22 PanicErrorPopOnEmptyArray PanicError = 0x31 PanicErrorArrayAccessOutOfBounds PanicError = 0x32 PanicErrorTooMuchMemoryAllocated PanicError = 0x41 PanicErrorZeroInitializedVariable PanicError = 0x51 )
func (PanicError) Error ¶
func (e PanicError) Error() string
type ProviderJobIterator ¶
type ProviderJobIterator struct {
Job *Job
*metaschedulerabi.MetaSchedulerClaimJobEventIterator
// contains filtered or unexported fields
}
type ProviderNotJoined ¶
type ProviderNotJoined struct{}
func ParseProviderNotJoined ¶
func ParseProviderNotJoined(inputs []interface{}) *ProviderNotJoined
func (*ProviderNotJoined) Error ¶
func (e *ProviderNotJoined) Error() string
type RemainingTimeAboveLimit ¶
func ParseRemainingTimeAboveLimit ¶
func ParseRemainingTimeAboveLimit(
inputs []interface{},
) *RemainingTimeAboveLimit
func (*RemainingTimeAboveLimit) Error ¶
func (e *RemainingTimeAboveLimit) Error() string
type RunningColdStatusOnly ¶
type RunningColdStatusOnly struct {
Current JobStatus
}
func ParseRunningColdStatusOnly ¶
func ParseRunningColdStatusOnly(
inputs []interface{},
) *RunningColdStatusOnly
func (*RunningColdStatusOnly) Error ¶
func (e *RunningColdStatusOnly) Error() string
type RunningScheduledStatusOnly ¶
type RunningScheduledStatusOnly struct {
Current JobStatus
}
func ParseRunningScheduledStatusOnly ¶
func ParseRunningScheduledStatusOnly(
inputs []interface{},
) *RunningScheduledStatusOnly
func (*RunningScheduledStatusOnly) Error ¶
func (e *RunningScheduledStatusOnly) Error() string
type SameStatusError ¶
type SameStatusError struct{}
func ParseSameStatusError ¶
func ParseSameStatusError(inputs []interface{}) *SameStatusError
func (*SameStatusError) Error ¶
func (e *SameStatusError) Error() string
type SetJobStatusOption ¶
type SetJobStatusOption func(*setJobStatusOptions)
func SetJobStatusWithError ¶
func SetJobStatusWithError(err error) SetJobStatusOption
func SetJobStatusWithExitCode ¶ added in v0.13.0
func SetJobStatusWithExitCode(exitCode int64) SetJobStatusOption
type WaitingApprovalOnly ¶
type WaitingApprovalOnly struct{}
func ParseWaitingApprovalOnly ¶
func ParseWaitingApprovalOnly(inputs []interface{}) *WaitingApprovalOnly
func (*WaitingApprovalOnly) Error ¶
func (e *WaitingApprovalOnly) Error() string
Click to show internal directories.
Click to hide internal directories.