machine

package
v0.0.0-...-7d312d8 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: BSD-3-Clause Imports: 35 Imported by: 0

Documentation

Overview

Package machine is for interacting with the machine state server. See //machine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Machine

type Machine struct {

	// MachineID is the swarming id of the machine.
	MachineID string

	// Version of test_machine_monitor being run.
	Version string
	// contains filtered or unexported fields
}

Machine is the interface to the machine state server. See //machine.

func New

func New(ctx context.Context, local bool, instanceConfig config.InstanceConfig, version string, startSwarming bool, machineServerHost string, triggerInterrogationCh <-chan bool) (*Machine, error)

New return an instance of *Machine.

func (*Machine) DimensionsForSwarming

func (m *Machine) DimensionsForSwarming() machine.SwarmingDimensions

DimensionsForSwarming returns the dimensions that should be reported to swarming.

func (*Machine) IsAvailable

func (m *Machine) IsAvailable() bool

IsAvailable returns whether this Machine is currently willing to accept new tasks.

func (*Machine) IsRunningSwarmingTask

func (m *Machine) IsRunningSwarmingTask() bool

IsRunningSwarmingTask returns true is a swarming task is currently running.

func (*Machine) RebootDevice

func (m *Machine) RebootDevice(ctx context.Context) error

RebootDevice reboots the attached device.

func (*Machine) SetIsRunningSwarmingTask

func (m *Machine) SetIsRunningSwarmingTask(isRunning bool)

SetIsRunningSwarmingTask records if a swarming task is being run.

func (*Machine) Start

func (m *Machine) Start(ctx context.Context) error

Start the background processes that send events to the sink and watch for changes to the Description.

func (*Machine) UpdateDescription

func (m *Machine) UpdateDescription(desc machine.Description)

UpdateDescription applies any change in behavior based on the new given description. This impacts what we tell Swarming, what mode we are in, if we should communicate with a device via SSH, etc.

Jump to

Keyboard shortcuts

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