executor

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SupportFeatures

func SupportFeatures() network.Features

Types

type Build

type Build struct {
	// contains filtered or unexported fields
}

Build handles CI build script generation.

func NewBuild

func NewBuild(opt BuildOpt) (b *Build, err error)

func (*Build) BuildScript

func (b *Build) BuildScript(w io.Writer) (err error)

func (*Build) PrepareScript

func (b *Build) PrepareScript(w io.Writer) (err error)

func (*Build) Timeout

func (b *Build) Timeout() time.Duration

type BuildOpt

type BuildOpt struct {
	Job        network.RequestJobResp
	WorkingDir string
}

type BuildResult

type BuildResult struct {
	Err           error
	ExitCode      int
	FailureReason network.FailureReason
}

type Config

type Config struct {
	// path to linux kernel file
	KernelPath string `comment:"path to linux kernel file"`
	// path to RootFS file
	RootFSPath string `comment:"path to RootFS file"`

	// IP address of Firecracker microVM
	IP string `comment:"IP address of Firecracker microVM"`
	// Gateway IP address, normally is the tap address
	GatewayIP string `comment:"Gateway IP address, normally is the tap address"`
	// Netmask like 255.255.255.0
	Netmask string `comment:"Netmask like 255.255.255.0"`

	// Tap device name like tap0
	TapDevice string `comment:"Tap device name like tap0"`
	// microVM tap MAC address
	TapMac string `comment:"microVM tap MAC address"`
}

func (Config) Validate

func (c Config) Validate() (err error)

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

func NewExecutor

func NewExecutor(opt Option) (e *Executor, err error)

func (*Executor) Build

func (e *Executor) Build() (result BuildResult)

Build runs the build and returns encountered error.

func (*Executor) Close

func (e *Executor) Close(ctx context.Context) (err error)

func (*Executor) Prepare

func (e *Executor) Prepare(ctx context.Context) (err error)

Prepare start the VM, clones the repo.

type Option

type Option struct {
	Logger *zap.Logger
	// The context must not be cancelled while the microVM is running.
	Ctx      context.Context
	Build    *Build
	JobTrace *network.JobTrace

	Config
}

Jump to

Keyboard shortcuts

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