Documentation ¶
Index ¶
- Variables
- type ControlPlane
- func (s *ControlPlane) CheckInWorkerNode(ctx context.Context, ip string, port int32, rawPEMCertificateData []byte) error
- func (s *ControlPlane) GetAllWorkerNodeFromRegistry(ctx context.Context) ([]models.NodeEntry, error)
- func (s *ControlPlane) RegisterWorker(ctx context.Context, ip string, port int32, nodePublicKey cert.KeyData) (certificate cert.TLSCertificate, err error)
- type IControlPlane
- type IWorker
- type Worker
- func (w *Worker) CalculateAverageContainerResourceUsage(usage []models.ContainerResourceUsage) error
- func (w *Worker) CheckInWorkerNodeToControlPlane(ctx context.Context) error
- func (w *Worker) GetAvailableTaskSlot() int
- func (w *Worker) GetQueuedTask() []string
- func (w *Worker) GetRunningTask() []string
- func (w *Worker) GetTask(containerImage string, containerId string) (*proto.Task, error)
- func (w *Worker) ReportFailTask(ctx context.Context, id string, errorMessage string) error
- func (w *Worker) StoreTaskInQueue(containerImage string, taskId string, input []byte) error
- func (w *Worker) SubmitSuccessTask(ctx context.Context, id string, results []byte) error
- func (w *Worker) TaskDistributionDaemonLoop(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNodeAlreadyRegistered = errors.New("there is the other node registered with the inputted key")
)
Functions ¶
This section is empty.
Types ¶
type ControlPlane ¶
type ControlPlane struct {
// contains filtered or unexported fields
}
func (*ControlPlane) CheckInWorkerNode ¶
func (*ControlPlane) GetAllWorkerNodeFromRegistry ¶
func (*ControlPlane) RegisterWorker ¶
func (s *ControlPlane) RegisterWorker(ctx context.Context, ip string, port int32, nodePublicKey cert.KeyData) (certificate cert.TLSCertificate, err error)
type IControlPlane ¶
type IControlPlane interface { RegisterWorker(ctx context.Context, ip string, port int32, nodePublicKey cert.KeyData) (certificate cert.TLSCertificate, err error) GetAllWorkerNodeFromRegistry(ctx context.Context) ([]models.NodeEntry, error) CheckInWorkerNode(ctx context.Context, ip string, port int32, cert []byte) error }
func ProvideControlPlane ¶
func ProvideControlPlane( nodeRegistryRepository repository.INodeRegistry, caCertificate cert.CACertificate, config config.ControlPlaneConfigModel, workerNodePool pool.WorkerNode, ) IControlPlane
type IWorker ¶
type IWorker interface { // ControlPlane related method CheckInWorkerNodeToControlPlane(ctx context.Context) error // Task related method StoreTaskInQueue(containerImage string, taskId string, input []byte) error GetTask(containerImage string, containerId string) (*proto.Task, error) SubmitSuccessTask(ctx context.Context, id string, results []byte) error ReportFailTask(ctx context.Context, id string, errorMessage string) error CalculateAverageContainerResourceUsage(usage []models.ContainerResourceUsage) error GetRunningTask() []string GetAvailableTaskSlot() int GetQueuedTask() []string // TaskDistributionDaemonLoop is a method allowing the daemon to call to accomplish its routine. TaskDistributionDaemonLoop(ctx context.Context) }
func ProvideWorker ¶
func ProvideWorker( controlPlaneGRPCClient proto.ControlPlaneClient, dockerClient *client.Client, workerNodeCertificate cert.TransportCertificate, config config.WorkerConfigModel, taskQueue taskqueue.Queue, workerNodeDistribution workerlogic.WorkerDistributor, containerService service.IContainer, meter metric.Meter, ) (IWorker, error)
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) CalculateAverageContainerResourceUsage ¶ added in v0.0.15
func (w *Worker) CalculateAverageContainerResourceUsage(usage []models.ContainerResourceUsage) error
func (*Worker) CheckInWorkerNodeToControlPlane ¶
func (*Worker) GetAvailableTaskSlot ¶
func (*Worker) GetQueuedTask ¶ added in v0.0.15
func (*Worker) GetRunningTask ¶
func (*Worker) ReportFailTask ¶
func (*Worker) StoreTaskInQueue ¶
func (*Worker) SubmitSuccessTask ¶
func (*Worker) TaskDistributionDaemonLoop ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_handlerservice is a generated GoMock package.
|
Package mock_handlerservice is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.