taskresource

package
v1.36.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceFields

type ResourceFields struct {
	Control cgroup.Control
	*ResourceFieldsCommon
	Ctx              context.Context
	DockerClient     dockerapi.DockerClient
	NvidiaGPUManager gpu.GPUManager
}

ResourceFields is the list of fields required for creation of task resources obtained from engine

type ResourceFieldsCommon

type ResourceFieldsCommon struct {
	IOUtil             ioutilwrapper.IOUtil
	ASMClientCreator   asmfactory.ClientCreator
	SSMClientCreator   ssmfactory.SSMClientCreator
	CredentialsManager credentials.Manager
	EC2InstanceID      string
}

type TaskResource

type TaskResource interface {
	// SetDesiredStatus sets the desired status of the resource
	SetDesiredStatus(resourcestatus.ResourceStatus)
	// GetDesiredStatus gets the desired status of the resource
	GetDesiredStatus() resourcestatus.ResourceStatus
	// SetKnownStatus sets the desired status of the resource
	SetKnownStatus(resourcestatus.ResourceStatus)
	// GetKnownStatus gets the desired status of the resource
	GetKnownStatus() resourcestatus.ResourceStatus
	// SetCreatedAt sets the timestamp for resource's creation time
	SetCreatedAt(time.Time)
	// GetCreatedAt sets the timestamp for resource's creation time
	GetCreatedAt() time.Time
	// Create performs resource creation
	Create() error
	// Cleanup performs resource cleanup
	Cleanup() error
	// GetName returns the unique name of the resource
	GetName() string
	// DesiredTeminal returns true if remove is in terminal state
	DesiredTerminal() bool
	// KnownCreated returns true if resource state is CREATED
	KnownCreated() bool
	// TerminalStatus returns the last transition state of the resource
	TerminalStatus() resourcestatus.ResourceStatus
	// NextKnownState returns resource's next state
	NextKnownState() resourcestatus.ResourceStatus
	// ApplyTransition calls the function required to move to the specified status
	ApplyTransition(resourcestatus.ResourceStatus) error
	// SteadyState returns the transition state of the resource defined as "ready"
	SteadyState() resourcestatus.ResourceStatus
	// SetAppliedStatus sets the applied status of resource and returns whether
	// the resource is already in a transition
	SetAppliedStatus(status resourcestatus.ResourceStatus) bool
	// StatusString returns the string of the resource status
	StatusString(status resourcestatus.ResourceStatus) string
	// GetTerminalReason returns string describing why the resource failed to
	// provision
	GetTerminalReason() string
	// Initialize will initialze the resource fields of the resource
	Initialize(res *ResourceFields,
		taskKnownStatus apitaskstatus.TaskStatus, taskDesiredStatus apitaskstatus.TaskStatus)

	json.Marshaler
	json.Unmarshaler
}

TaskResource is a wrapper for task level resource methods we need

Directories

Path Synopsis
control/factory/mock
Package mock_cgroups is a generated GoMock package.
Package mock_cgroups is a generated GoMock package.
control/factory/mock_factory
Package mock_factory is a generated GoMock package.
Package mock_factory is a generated GoMock package.
control/mock_control
Package mock_control is a generated GoMock package.
Package mock_control is a generated GoMock package.
Package mock_taskresource is a generated GoMock package.
Package mock_taskresource is a generated GoMock package.

Jump to

Keyboard shortcuts

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