cmd

package
v0.1.1-0...-c982bb6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 121 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FastCloudSyncTimeout bounds startup cloud reconciliation for read-oriented commands.
	FastCloudSyncTimeout = syncorch.FastCloudTimeoutCLI
	// NormalCloudSyncTimeout is used for background/full cloud reconciliation passes.
	NormalCloudSyncTimeout = syncorch.NormalCloudTimeoutCLI
)
View Source
const (
	ExitSuccess  = 0
	ExitFailed   = 1
	ExitNotFound = 3
)

Exit codes

View Source
const (
	// FastSyncTimeout is the per-SSH-call timeout for quick syncs.
	// 5s tolerates slow-but-alive handshakes without making the CLI feel sluggish
	// on healthy paths; the overall per-host budget remains FastSyncHostTimeout.
	FastSyncTimeout = 5 * time.Second
	// FastSyncHostTimeout is the overall timeout per host for quick syncs
	// Must be long enough to sync multiple jobs (each with FastSyncTimeout)
	FastSyncHostTimeout = 30 * time.Second
	// NormalSyncHostTimeout is the overall timeout per host for background full syncs.
	// Full syncs may need to stage code, assert the agent, and fetch missing inputs.
	NormalSyncHostTimeout = 10 * time.Minute
	// DefaultSyncTimeout is used for default syncs in status commands
	DefaultSyncTimeout = 5 * time.Second
	// NormalSyncTimeout is used for explicit sync commands
	NormalSyncTimeout = 30 * time.Second
)

Variables

View Source
var Version = "dev"

Version is set at build time via -ldflags

Functions

func Execute

func Execute() error

Execute runs the root command

func ParseJobIDs

func ParseJobIDs(args []string) ([]int64, error)

ParseJobIDs parses command-line arguments into a deduplicated, sorted list of job IDs. Supports individual IDs (123 / wj123), ranges (123:127 / wj123:127 / wj123:wj127 / 123::127 / 123...127), and comma-separated lists (123,124,125). Prints a warning to stderr if duplicates are found.

Syntax:

  • Single ID: 123 or wj123
  • Range: 123:127, wj123:127, wj123:wj127, 123::127, or 123...127 (inclusive)
  • List: 123,124,125
  • Mixed: 123 wj125:127 130,131 (expands to 123, 125, 126, 127, 130, 131)

func ParseJobIDsForJobCommand

func ParseJobIDsForJobCommand(args []string) ([]int64, error)

ParseJobIDsForJobCommand parses job IDs for a command that operates only on jobs. Bare numerics (3000) and wj-prefixed IDs (wj3000) are both accepted; an explicit instance prefix (wi3000) is rejected with a clear message so an instance ID is never silently treated as a job. Because these commands have no instance counterpart, a bare number is unambiguous and need not carry a "wj" prefix.

func ResolveJobDiagnosis

func ResolveJobDiagnosis(job *db.Job) *remediation.ErrorDiagnosis

ResolveJobDiagnosis falls back to a live log-cache scan when the stored diagnosis is empty so jobs that never invoked the remediation pipeline (benchmark / processed / no-retry failures) still surface a pattern. See specs/job-lifecycle.allium.

Types

type IncidentSummary

type IncidentSummary struct {
	Fingerprint string  `json:"fingerprint"`
	Count       int     `json:"count"`
	SampleJobID int64   `json:"sample_job_id"`
	Message     string  `json:"message,omitempty"`
	JobIDs      []int64 `json:"job_ids"`
}

IncidentSummary captures one distinct upstream error class across multiple unplaced jobs. Exported for `--json` consumers and for the autopilot status surface that also reports active incidents.

type StartJobPreparedInfo

type StartJobPreparedInfo struct {
	JobID       int64
	Host        string
	WorkingDir  string
	Command     string
	Description string
}

StartJobPreparedInfo exposes metadata about the job once it has an ID.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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