Documentation
¶
Overview ¶
Package nvidiatoolkit reads back, from its log, the job that installs the NVIDIA Container Toolkit. Like the Docker update, the job reports in a log file that apt and dpkg also write to: a line is the unit's word only if it has the shape of a marker and carries the run's nonce.
Index ¶
Constants ¶
const ( Unit = "casaos-nvidia-toolkit.service" MarkPrefix = "CASAOS_NVIDIA_TOOLKIT_" // KeyFingerprint is the fingerprint the repository key must have before it is installed. KeyFingerprint = "C95B321B61E88C1809C4F759DDCAE044F796ECB0" )
const ( StateIdle = "idle" StateRunning = "running" StateFinalizing = "finalizing" // a terminal marker was seen while the unit is still active (dockerpkg has no such state: this reader's own) StateSucceeded = "succeeded" StateFailed = "failed" )
Run.State
const ( PhasePreparing = "preparing" PhaseRepository = "repository" PhaseInstalling = "installing" PhaseConfiguring = "configuring" )
Run.Phase
const ( FailGuard = "guard" FailKey = "key" FailRepository = "repository" FailInstall = "install" FailConfigure = "configure" // FailStart is a unit systemd could not start: the core writes it, in the log's last line. FailStart = "start" // FailNoResult is the reader's own: a run whose unit ended without a terminal marker. No line says it. FailNoResult = "no_result" )
Run.ErrorCode
const OutcomeSuccess = "success"
Run.Outcome
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Run ¶
type Run struct {
State string `json:"state"` // idle | running | finalizing | succeeded | failed
Phase string `json:"phase"` // preparing | repository | installing | configuring; "" once the run is over
Outcome string `json:"outcome"` // "" | success
ErrorCode string `json:"error_code"` // guard | key | repository | install | configure | start | no_result
Log string `json:"log"` // the log without the marker lines
}
func ParseRun ¶
ParseRun rebuilds a run from its log; active says whether the unit still runs. The nonce is the one on the first line, which must be a QUEUED marker; without one the run is idle. After that a marker counts only with that nonce and a time and nothing more (FAILED: and its code), as dockerpkg reads its own; a phase marker counts once, which a later copy of it does not change, and the last valid terminal wins. A line that is no marker (a second QUEUED among them) is the log shown.