provisioner

package
v0.0.0-...-55c649e Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 22 Imported by: 3

Documentation

Overview

Package provisioner exports behaviors for provisioning COS systems end-to-end. These behaviors are intended to run on a COS system.

Index

Constants

This section is empty.

Variables

View Source
var ErrRebootRequired = errors.New("reboot required to continue provisioning")

ErrRebootRequired indicates that a reboot is necessary for provisioning to continue.

Functions

func Resume

func Resume(ctx context.Context, deps Deps, stateDir string) (err error)

Resume resumes provisioning from the state provided at stateDir.

func Run

func Run(ctx context.Context, deps Deps, stateDir string, c Config) error

Run runs a full provisioning flow based on the provided config. The stateDir is used for persisting data used as part of provisioning. The stateDir allows the provisioning flow to be interrupted (e.g. by a reboot) and resumed.

Types

type BootDiskConfig

type BootDiskConfig struct {
	OEMSize           string
	OEMFSSize4K       uint64
	ReclaimSDA3       bool
	WaitForDiskResize bool
}

type Config

type Config struct {
	// BuildContexts identifies the build contexts that should be used during
	// provisioning. A build context means the same thing here as it does
	// elsewhere in cos-customizer. The keys are build context identifiers, and
	// the values are addresses to fetch the build contexts from. Currently, only
	// gs:// addresses are supported.
	BuildContexts map[string]string
	// BootDisk defines how the boot disk should be configured.
	BootDisk BootDiskConfig

	Steps []StepConfig
}

Config defines a provisioning flow.

type Deps

type Deps struct {
	// GCSClient is used to access Google Cloud Storage.
	GCSClient *storage.Client
	// TarCmd is used for tar.
	TarCmd string
	// SystemctlCmd is used to access systemd.
	SystemctlCmd string
	// RootdevCmd is the path to the rootdev binary.
	RootdevCmd string
	// CgptCmd is the path to the cgpt binary.
	CgptCmd string
	// Resize2fsCmd is the path to the resize2fs binary.
	Resize2fsCmd string
	// E2fsckCmd is the path to the e2fsck binary.
	E2fsckCmd string
	// RootDir is the path to the root file system. Should be "/" in all real
	// runtime situations.
	RootDir string
}

Deps contains provisioner service dependencies.

type DisableAutoUpdateStep

type DisableAutoUpdateStep struct{}

type InstallGPUStep

type InstallGPUStep struct {
	NvidiaDriverVersion      string
	NvidiaDriverMD5Sum       string
	NvidiaInstallDirHost     string
	NvidiaInstallerContainer string
	GCSDepsPrefix            string
}

type InstallPackagesStep

type InstallPackagesStep struct {
	BuildContext                 string
	PkgSpecURL                   string
	AnthosInstallerDir           string
	AnthosInstallerVersion       string
	AnthosInstallerReleaseBucket string
}

type RunScriptStep

type RunScriptStep struct {
	BuildContext string
	Path         string
	Env          string
}

type SealOEMStep

type SealOEMStep struct{}

type StepConfig

type StepConfig struct {
	Type string
	Args json.RawMessage
}

Jump to

Keyboard shortcuts

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