provisioner

package
v0.0.0-...-02cb986 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

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

	// UseScratchDisk indicates whether a scratch disk should be used.
	UseScratchDisk bool
}

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
	// DockerCredentialGCR is a path to a docker-credential-gcr program to use as a Docker
	// credential helper.
	DockerCredentialGCR string
	// VeritySetupImage is a path to a file system tarball (which can be imported
	// as a Docker image) that contains the "veritysetup" tool.
	VeritySetupImage string
	// HandleDiskLayoutBin is a path to a program for reformatting a COS disk
	// image.
	HandleDiskLayoutBin 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
	TopWorkDir                   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