service

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const TaskTTL = 750 // ~2 hour

TaskTTL is the minimum number of ticks (every ~10sec) within which a given task must be completed before being rescheduled again.

Variables

View Source
var (
	TasksScheduled = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "claudie_input_manifests_tasks_scheduled",
		Help: "Total number of tasks scheduled for builder service to work on",
	})

	TasksFinishedOk = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "claudie_input_manifests_tasks_completed",
		Help: "Total number of tasks completed by the builder service",
	})

	TasksFinishedErr = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "claudie_input_manifests_tasks_errored",
		Help: "Total number of tasks errored while processing by the builder service",
	})
)

Functions

func Diff

func Diff(current, desired *spec.K8Scluster, currentLbs, desiredLbs []*spec.LBcluster) []*spec.TaskEvent

Diff takes the desired and current state to determine the difference and returns a number of tasks to be performed in specific order. It is expected that the current state actually represents the actual current state of the cluster and the desired state contains relevant data from the current state with the requested changes (i.e. deletion, addition of nodes) from the new config changes, (relevant data was transferred to desired state).

func LbsNodePoolNodes

func LbsNodePoolNodes(clusters []*spec.LBcluster) (map[string]map[string][]string, map[string]map[string][]string)

func MustRegisterCounters

func MustRegisterCounters()

func NodePoolNodes

func NodePoolNodes(cluster *spec.K8Scluster) (map[string][]string, map[string][]string)

NodePoolNodes returns the current nodes for the dynamic and static nodepools.

Types

type GRPC

type GRPC struct {
	pb.UnimplementedManagerServiceServer

	HealthCheckServer *health.Server

	Store store.Store
	// contains filtered or unexported fields
}

func NewGRPC

func NewGRPC(ctx context.Context, opts ...grpc.ServerOption) (*GRPC, error)

func (*GRPC) GetConfig

func (g *GRPC) GetConfig(ctx context.Context, request *pb.GetConfigRequest) (*pb.GetConfigResponse, error)

func (*GRPC) ListConfigs

func (g *GRPC) ListConfigs(ctx context.Context, _ *pb.ListConfigRequest) (*pb.ListConfigResponse, error)

func (*GRPC) MarkForDeletion

func (g *GRPC) MarkForDeletion(ctx context.Context, request *pb.MarkForDeletionRequest) (*pb.MarkForDeletionResponse, error)

func (*GRPC) NextTask

func (g *GRPC) NextTask(ctx context.Context, _ *pb.NextTaskRequest) (*pb.NextTaskResponse, error)

func (*GRPC) Serve

func (g *GRPC) Serve() error

Serve will create a service goroutine for each connection

func (*GRPC) Stop

func (g *GRPC) Stop() error

Stop will gracefully shutdown the gRPC server and the healthcheck server

func (*GRPC) TaskComplete

func (g *GRPC) TaskComplete(ctx context.Context, req *pb.TaskCompleteRequest) (*pb.TaskCompleteResponse, error)

func (*GRPC) TaskUpdate

func (g *GRPC) TaskUpdate(ctx context.Context, req *pb.TaskUpdateRequest) (*pb.TaskUpdateResponse, error)

func (*GRPC) UpdateNodePool

func (g *GRPC) UpdateNodePool(ctx context.Context, request *pb.UpdateNodePoolRequest) (*pb.UpdateNodePoolResponse, error)

func (*GRPC) UpsertManifest

func (g *GRPC) UpsertManifest(ctx context.Context, request *pb.UpsertManifestRequest) (*pb.UpsertManifestResponse, error)

func (*GRPC) WatchForDoneOrErrorDocuments

func (g *GRPC) WatchForDoneOrErrorDocuments(ctx context.Context) error

func (*GRPC) WatchForPendingDocuments

func (g *GRPC) WatchForPendingDocuments(ctx context.Context) error

func (*GRPC) WatchForScheduledDocuments

func (g *GRPC) WatchForScheduledDocuments(ctx context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL