run

package
v44.23.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadCacheFile

func ReadCacheFile(state *State, filename string) (bool, error)

Read a file written by WriteCacheFile. First return value is true if the file existed and false otherwise.

Types

type State

type State struct {
	sync.RWMutex

	// Information about the Taskcluster deployment where this
	// worker is running
	RootURL string

	// Credentials for the worker, and their expiration time.  Shortly before
	// this expiration, worker-runner will try to gracefully stop the worker
	Credentials        taskcluster.Credentials
	CredentialsExpire  taskcluster.Time `yaml:",omitempty"`
	RegistrationSecret string

	// Information about this worker
	WorkerPoolID string
	WorkerGroup  string
	WorkerID     string
	ProviderID   string

	// metadata from the provider (useful to display to the user for
	// debugging).
	//
	// Docker-worker currently expects the following properties:
	//
	//  * public-hostname
	//  * public-ipv4
	//  * local-ipv4
	//  * instance-type
	//  * instance-id
	//  * region
	//
	// It doesn't, strictly speaking, require these fields,
	// but may fall onto undesirable defaults if these are not provided
	// A bit more info on that here
	// https://github.com/taskcluster/taskcluster-worker-runner/pull/30#pullrequestreview-277378260
	ProviderMetadata map[string]interface{}

	// the accumulated WorkerConfig for this run, including files to create
	WorkerConfig *cfg.WorkerConfig
	Files        []files.File

	// The worker location configuration
	WorkerLocation map[string]string
}

State represents the state of the worker run. Its contents are built up bit-by-bit during the start-worker process. Access to all fields is gated by the mutex.

func (*State) CheckProviderResults

func (state *State) CheckProviderResults() error

Check that the provided provided the information it was supposed to.

func (*State) WriteCacheFile

func (state *State) WriteCacheFile(filename string) error

Write the state to the given cache file, checking permissions along the way

Jump to

Keyboard shortcuts

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