Documentation ¶
Index ¶
- Constants
- type Engine
- func (e *Engine) Close()
- func (e *Engine) GetMpcService() *cluster.Service
- func (e *Engine) GetPredictResult(ctx context.Context, in *pbTask.TaskRequest) (*pbTask.PredictResponse, error)
- func (e *Engine) GetTaskById(ctx context.Context, in *pbTask.GetTaskRequest) (*pbTask.FLTask, error)
- func (e *Engine) ListTask(ctx context.Context, in *pbTask.ListTaskRequest) (*pbTask.FLTasks, error)
- func (e *Engine) Start(ctx context.Context) error
- func (e *Engine) StartTask(ctx context.Context, in *pbTask.TaskRequest) (*pbTask.TaskResponse, error)
Constants ¶
View Source
const ( // The number of executing task concurrently DefaultTrainTaskLimit = 100 DefaultPredictTaskLimit = 100 DefaultRpcTimeout = 3 // Task default max execution time DefaultMpcTaskMaxExecTime = time.Hour * 2 // Task loop default interval time DefaultRequestInterval = time.Second * 10 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine task processing engine
chain is the handler for blockchain operation, which includes node, task and file operations node denotes executor node identity, which includes node id, node private key, host address... storage is the handler for results storage, which includes trained model and prediction result storage mpcHandler is the handler for mpc task execution, which includes task preparation, task execution, results storage... monitor is the handler for task monitoring, that is, monitoring tasks to be executed
func NewEngine ¶
func NewEngine(conf *config.ExecutorConf) (e *Engine, err error)
NewEngine initiates Engine by executor node configuration
func (*Engine) GetMpcService ¶
GetMpcService returns mpc service to be registered to grpcServer
func (*Engine) GetPredictResult ¶
func (e *Engine) GetPredictResult(ctx context.Context, in *pbTask.TaskRequest) (*pbTask.PredictResponse, error)
GetPredictResult checks task's initiator and gets prediction result from Xuper db.
in.PubKey must matches task.Requester, only task.Requester can get prediction result.
func (*Engine) GetTaskById ¶
func (e *Engine) GetTaskById(ctx context.Context, in *pbTask.GetTaskRequest) (*pbTask.FLTask, error)
GetTaskById queries task details by taskID
func (*Engine) ListTask ¶
ListTask lists tasks from blockchain by requester or executor's Public Key
func (*Engine) StartTask ¶
func (e *Engine) StartTask(ctx context.Context, in *pbTask.TaskRequest) (*pbTask.TaskResponse, error)
StartTask starts mpc-training or mpc-prediction after received "task starting" message from remote executor
Click to show internal directories.
Click to hide internal directories.