Documentation
¶
Overview ¶
Package runnerinstall owns shared-node installation operations, independently of the runner's process and task locks.
Index ¶
- Constants
- Variables
- func ErrorCode(err error) string
- func ErrorFromCode(code string) error
- type Identity
- type Operation
- type Progress
- type Request
- type Result
- type UninstallManifest
- type UninstallOperation
- type UninstallProgress
- type UninstallRequest
- type UninstallResult
- type UpgradeOperation
- func DecodeUpgradeOperation(document []byte) (UpgradeOperation, error)
- func RecoverUpgrade(ctx context.Context, request UpgradeRequest, progress func(UpgradeProgress)) (UpgradeOperation, error)
- func RetryUpgrade(ctx context.Context, request UpgradeRequest, progress func(UpgradeProgress)) (UpgradeOperation, error)
- func Upgrade(ctx context.Context, request UpgradeRequest, progress func(UpgradeProgress)) (UpgradeOperation, error)
- type UpgradeProgress
- type UpgradeRequest
- type UpgradeResult
Constants ¶
const ( MaxRequestBytes = 4 << 10 MaxRecordBytes = 64 << 10 PairingName = "node-token" ServiceName = "llm-test-runner.service" ProgramPath = "/opt/llm-test-runner" StatePath = "/var/lib/llm-test-runner" InstallPath = "/var/lib/llm-test-runner-install" IdentityPath = InstallPath + "/identity.json" PairingPath = InstallPath + "/" + PairingName )
Variables ¶
var ( ErrInvalid = errors.New("invalid_installation_request") ErrRootRequired = errors.New("installation_root_required") ErrUnsupported = errors.New("unsupported_installation_platform") ErrBusy = errors.New("installation_busy") ErrConflict = errors.New("installation_operation_conflict") ErrUnownedPath = errors.New("installation_path_not_owned") ErrPairingRequired = errors.New("node_pairing_repair_required") ErrUpgradeRequired = errors.New("runner_upgrade_required") ErrService = errors.New("runner_service_unavailable") ErrIntegrity = errors.New("installation_integrity_failed") ErrUninstalled = errors.New("runner_uninstalled") )
Functions ¶
func ErrorFromCode ¶
ErrorFromCode accepts only the installer's fixed public diagnostics. SSH stderr is never returned verbatim to a desktop caller or written into a report.
Types ¶
type Identity ¶
type Identity struct {
Contract int `json:"contract"`
NodeID string `json:"node_id"`
InstallationID string `json:"installation_id"`
ListenPort uint16 `json:"listen_port"`
TokenSHA256 string `json:"token_sha256"`
}
func DecodeIdentity ¶
type Operation ¶
type Operation struct {
Request Request `json:"request"`
Stage string `json:"stage"`
ChangedAt time.Time `json:"changed_at"`
ErrorCode string `json:"error_code"`
Result *Result `json:"result"`
}
func DecodeOperation ¶
type Request ¶
type Result ¶
type Result struct {
Contract int `json:"contract"`
OperationID string `json:"operation_id"`
Runner jobcontract.RunnerInfo `json:"runner"`
ListenPort uint16 `json:"listen_port"`
Reused bool `json:"reused"`
ObservedAt time.Time `json:"observed_at"`
}
type UninstallManifest ¶
type UninstallManifest struct {
BuildIDs []string `json:"build_ids"`
UnitSHA256 string `json:"unit_sha256"`
OwnerSHA256 string `json:"owner_sha256"`
}
UninstallManifest freezes the only program files eligible for removal. State, pairing, content, backups, accounts, and lock inodes are retained.
type UninstallOperation ¶
type UninstallOperation struct {
Request UninstallRequest `json:"request"`
Manifest UninstallManifest `json:"manifest"`
Stage string `json:"stage"`
PauseConfirmed bool `json:"pause_confirmed"`
RestoreService bool `json:"restore_service"`
ChangedAt time.Time `json:"changed_at"`
ErrorCode string `json:"error_code"`
Result *UninstallResult `json:"result"`
}
func DecodeUninstallOperation ¶
func DecodeUninstallOperation(document []byte) (UninstallOperation, error)
func RecoverUninstall ¶
func RecoverUninstall( ctx context.Context, request UninstallRequest, progress func(UninstallProgress), ) (UninstallOperation, error)
RecoverUninstall restores service admission only before file removal begins. Once removal starts, Uninstall is the sole continuation of that operation.
func Uninstall ¶
func Uninstall( ctx context.Context, request UninstallRequest, progress func(UninstallProgress), ) (UninstallOperation, error)
Uninstall continues only the exact durable operation. It preserves all state and pairing information; completed removal blocks automatic reprovisioning.
func (UninstallOperation) Validate ¶
func (operation UninstallOperation) Validate() error
type UninstallProgress ¶
type UninstallProgress struct {
OperationID string `json:"operation_id"`
Stage string `json:"stage"`
}
func (UninstallProgress) Validate ¶
func (progress UninstallProgress) Validate() error
type UninstallRequest ¶
type UninstallRequest struct {
Contract int `json:"contract"`
OperationID string `json:"operation_id"`
NodeID string `json:"node_id"`
InstallationID string `json:"installation_id"`
ExpectedBuildID string `json:"expected_build_id"`
}
func DecodeUninstallRequest ¶
func DecodeUninstallRequest(reader io.Reader) (UninstallRequest, error)
func (UninstallRequest) Validate ¶
func (request UninstallRequest) Validate() error
type UninstallResult ¶
type UpgradeOperation ¶
type UpgradeOperation struct {
Request UpgradeRequest `json:"request"`
Stage string `json:"stage"`
ChangedAt time.Time `json:"changed_at"`
ErrorCode string `json:"error_code"`
ResumeAttempted bool `json:"resume_attempted"`
Restorable bool `json:"restorable"`
Result *UpgradeResult `json:"result"`
}
func DecodeUpgradeOperation ¶
func DecodeUpgradeOperation(document []byte) (UpgradeOperation, error)
func RecoverUpgrade ¶
func RecoverUpgrade(ctx context.Context, request UpgradeRequest, progress func(UpgradeProgress)) (UpgradeOperation, error)
func RetryUpgrade ¶
func RetryUpgrade(ctx context.Context, request UpgradeRequest, progress func(UpgradeProgress)) (UpgradeOperation, error)
func Upgrade ¶
func Upgrade(ctx context.Context, request UpgradeRequest, progress func(UpgradeProgress)) (UpgradeOperation, error)
Upgrade creates a single durable operation. Repeating the exact request reads its journal; RetryUpgrade is the explicit instruction to continue interrupted work.
func (UpgradeOperation) Validate ¶
func (operation UpgradeOperation) Validate() error
type UpgradeProgress ¶
type UpgradeProgress struct {
OperationID string `json:"operation_id"`
Stage string `json:"stage"`
}
func (UpgradeProgress) Validate ¶
func (progress UpgradeProgress) Validate() error
type UpgradeRequest ¶
type UpgradeRequest struct {
Contract int `json:"contract"`
OperationID string `json:"operation_id"`
NodeID string `json:"node_id"`
InstallationID string `json:"installation_id"`
ExpectedBuildID string `json:"expected_build_id"`
ArtifactSHA256 string `json:"artifact_sha256"`
}
func DecodeUpgradeRequest ¶
func DecodeUpgradeRequest(reader io.Reader) (UpgradeRequest, error)
func (UpgradeRequest) Validate ¶
func (request UpgradeRequest) Validate() error
type UpgradeResult ¶
type UpgradeResult struct {
Contract int `json:"contract"`
OperationID string `json:"operation_id"`
Runner jobcontract.RunnerInfo `json:"runner"`
ObservedAt time.Time `json:"observed_at"`
}
func (UpgradeResult) Validate ¶
func (result UpgradeResult) Validate() error
Source Files
¶
- contract.go
- files_linux.go
- installation_credentials_linux.go
- ownership_linux.go
- provision_linux.go
- system_linux.go
- uninstall.go
- uninstall_database_linux.go
- uninstall_files_linux.go
- uninstall_journal_linux.go
- uninstall_linux.go
- uninstall_system_linux.go
- upgrade.go
- upgrade_files_linux.go
- upgrade_linux.go
- upgrade_recovery_linux.go
- upgrade_system_linux.go