orchestrator

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 59 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthCheckReport

type HealthCheckReport struct {
	ClaimsChecked  int `json:"claims_checked"`
	StalledClaims  int `json:"stalled_claims"`
	AgentsReleased int `json:"agents_released"`
}

HealthCheckReport summarizes the orchestrator health snapshot.

type HealthChecker

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

HealthChecker inspects orchestrator state and reports unhealthy agents or tickets.

func NewHealthChecker

func NewHealthChecker(client *ent.Client, logger *slog.Logger) *HealthChecker

NewHealthChecker constructs a health checker for the orchestrator runtime.

func (*HealthChecker) ConfigureEvents

func (h *HealthChecker) ConfigureEvents(events provider.EventProvider)

func (*HealthChecker) ConfigureRuntimeState

func (h *HealthChecker) ConfigureRuntimeState(store *RuntimeStateStore)

func (*HealthChecker) Run

Run evaluates the current orchestrator health.

type MachineMonitor

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

func NewMachineMonitor

func NewMachineMonitor(client *ent.Client, logger *slog.Logger, collector MachineMonitorCollector) *MachineMonitor

func (*MachineMonitor) ConfigureEvents

func (m *MachineMonitor) ConfigureEvents(events provider.EventProvider)

func (*MachineMonitor) RunTick

type MachineMonitorCollector

type MachineMonitorCollector interface {
	CollectReachability(ctx context.Context, machine domain.Machine) (domain.MachineReachability, error)
	CollectSystemResources(ctx context.Context, machine domain.Machine) (domain.MachineSystemResources, error)
	CollectGPUResources(ctx context.Context, machine domain.Machine) (domain.MachineGPUResources, error)
	CollectAgentEnvironment(ctx context.Context, machine domain.Machine) (domain.MachineAgentEnvironment, error)
	CollectFullAudit(ctx context.Context, machine domain.Machine) (domain.MachineFullAudit, error)
}

type MachineMonitorReport

type MachineMonitorReport struct {
	MachinesScanned  int `json:"machines_scanned"`
	MachinesUpdated  int `json:"machines_updated"`
	L1Checks         int `json:"l1_checks"`
	L2Checks         int `json:"l2_checks"`
	L3Checks         int `json:"l3_checks"`
	L4Checks         int `json:"l4_checks"`
	L5Checks         int `json:"l5_checks"`
	OfflineMachines  int `json:"offline_machines"`
	DegradedMachines int `json:"degraded_machines"`
}

type RetryResult

type RetryResult struct {
	TicketID          uuid.UUID             `json:"ticket_id"`
	AttemptCount      int                   `json:"attempt_count"`
	ConsecutiveErrors int                   `json:"consecutive_errors"`
	NextRetryAt       time.Time             `json:"next_retry_at"`
	RetryPaused       bool                  `json:"retry_paused"`
	PauseReason       ticketing.PauseReason `json:"pause_reason"`
	ReleasedAgentID   *uuid.UUID            `json:"released_agent_id,omitempty"`
}

RetryResult reports the state change produced by a retry operation.

type RetryService

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

RetryService manages ticket retry bookkeeping after failed attempts.

func NewRetryService

func NewRetryService(client *ent.Client, logger *slog.Logger) *RetryService

NewRetryService constructs a retry service for orchestrator failures.

func (*RetryService) MarkAttemptFailed

func (s *RetryService) MarkAttemptFailed(ctx context.Context, ticketID uuid.UUID) (RetryResult, error)

MarkAttemptFailed records a failed attempt and computes the next retry state.

type RuntimeLauncher

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

func NewRuntimeLauncher

func NewRuntimeLauncher(
	client *ent.Client,
	logger *slog.Logger,
	events provider.EventProvider,
	processManager provider.AgentCLIProcessManager,
	sshPool *sshinfra.Pool,
	workflow *workflowservice.Service,
) *RuntimeLauncher

func (*RuntimeLauncher) Close

func (l *RuntimeLauncher) Close(ctx context.Context) error

func (*RuntimeLauncher) ConfigureGitHubCredentials

func (l *RuntimeLauncher) ConfigureGitHubCredentials(resolver githubauthservice.TokenResolver)

func (*RuntimeLauncher) ConfigureMetrics

func (l *RuntimeLauncher) ConfigureMetrics(metrics provider.MetricsProvider)

func (*RuntimeLauncher) ConfigurePlatformEnvironment

func (l *RuntimeLauncher) ConfigurePlatformEnvironment(apiURL string, agentPlatform runtimeAgentPlatform)

func (*RuntimeLauncher) ConfigureRuntimeState

func (l *RuntimeLauncher) ConfigureRuntimeState(store *RuntimeStateStore)

func (*RuntimeLauncher) RunTick

func (l *RuntimeLauncher) RunTick(ctx context.Context) error

type RuntimeStateStore

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

func NewRuntimeStateStore

func NewRuntimeStateStore() *RuntimeStateStore

type Scheduler

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

Scheduler claims runnable tickets and advances orchestrator work.

func NewScheduler

func NewScheduler(client *ent.Client, logger *slog.Logger, events provider.EventProvider) *Scheduler

NewScheduler constructs the orchestrator scheduler.

func (*Scheduler) RunTick

func (s *Scheduler) RunTick(ctx context.Context) (TickReport, error)

RunTick executes one scheduling pass.

type TickReport

type TickReport struct {
	ScheduledJobsScanned    int            `json:"scheduled_jobs_scanned"`
	ScheduledTicketsCreated int            `json:"scheduled_tickets_created"`
	WorkflowsScanned        int            `json:"workflows_scanned"`
	CandidatesScanned       int            `json:"candidates_scanned"`
	TicketsDispatched       int            `json:"tickets_dispatched"`
	TicketsSkipped          map[string]int `json:"tickets_skipped"`
}

TickReport summarizes the work done during one scheduler tick.

type TicketWorkspaceResetConflictError

type TicketWorkspaceResetConflictError struct {
	TicketID uuid.UUID
	RunID    uuid.UUID
}

func (TicketWorkspaceResetConflictError) Error

func (TicketWorkspaceResetConflictError) WorkspaceResetConflict

func (TicketWorkspaceResetConflictError) WorkspaceResetConflict() bool

type TicketWorkspaceResetService

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

func NewTicketWorkspaceResetService

func NewTicketWorkspaceResetService(
	client *ent.Client,
	logger *slog.Logger,
	sshPool *sshinfra.Pool,
) *TicketWorkspaceResetService

func (*TicketWorkspaceResetService) ResetTicketWorkspace

func (s *TicketWorkspaceResetService) ResetTicketWorkspace(ctx context.Context, ticketID uuid.UUID) error

Jump to

Keyboard shortcuts

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