nvidiatoolkit

package
v0.4.152 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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"
)
View Source
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

View Source
const (
	PhasePreparing   = "preparing"
	PhaseRepository  = "repository"
	PhaseInstalling  = "installing"
	PhaseConfiguring = "configuring"
)

Run.Phase

View Source
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

View Source
const OutcomeSuccess = "success"

Run.Outcome

Variables

This section is empty.

Functions

func NewNonce

func NewNonce() (string, error)

NewNonce is the Docker update's: 16 random bytes in lower case hex.

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

func ParseRun(log string, active bool) Run

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.

Jump to

Keyboard shortcuts

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