starter

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 31 Imported by: 0

README

starter

starter is a dispatcher for running job

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AddInstanceBackoffDuration is histogram of exponential backoff duration for adding instance
	AddInstanceBackoffDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: "myshoes",
		Subsystem: "starter",
		Name:      "add_instance_backoff_duration_seconds",
		Help:      "Histogram of exponential backoff duration in seconds for adding instance",
		Buckets:   prometheus.ExponentialBuckets(1, 2, 10),
	}, []string{"job_uuid"})

	// AddInstanceRetryTotal is counter of total retries for adding instance
	AddInstanceRetryTotal = promauto.NewCounterVec(prometheus.CounterOpts{
		Namespace: "myshoes",
		Subsystem: "starter",
		Name:      "add_instance_retry_total",
		Help:      "Total number of retries for adding instance",
	}, []string{"job_uuid"})
)
View Source
var (
	// CountRunning is count of running semaphore
	CountRunning atomic.Int64
	// CountWaiting is count of waiting job
	CountWaiting atomic.Int64

	// CountRescued is count of rescued job per target
	CountRescued = sync.Map{}

	// AddInstanceRetryCount is count of retry to add instance
	AddInstanceRetryCount = sync.Map{}
)
View Source
var (
	// DeletedJobMap is map for deleted jobs. key: runs_on, value: number of deleted jobs
	DeletedJobMap = sync.Map{}
)
View Source
var (
	ErrInvalidLabel = Error{/* contains filtered or unexported fields */}
)

Functions

func NewInvalidLabel added in v1.16.5

func NewInvalidLabel(err error) error

Types

type Error added in v1.16.5

type Error struct {
	// contains filtered or unexported fields
}

func (Error) Error added in v1.16.5

func (e Error) Error() string

func (Error) Is added in v1.16.5

func (e Error) Is(target error) bool

func (Error) Unwrap added in v1.16.5

func (e Error) Unwrap() error

type Starter

type Starter struct {
	// contains filtered or unexported fields
}

Starter is dispatcher for running job

func New

func New(ds datastore.Datastore, s safety.Safety, runnerVersion string, notifyEnqueueCh <-chan struct{}) *Starter

New create starter instance

func (*Starter) Loop

func (s *Starter) Loop(ctx context.Context) error

Loop is main loop for starter

func (*Starter) ProcessJob added in v1.15.11

func (s *Starter) ProcessJob(ctx context.Context, job datastore.Job) error

ProcessJob is process job

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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