actorrm

package
v0.0.0-...-b112479 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskAt

func AskAt(sys *actor.System, addr actor.Address, req interface{}, v interface{}) error

AskAt asks an actor and sets the response in v. It returns an error if the actor doesn't respond, respond with an error, or v isn't settable. TODO(Brad): Consolidate occurrences of this code.

func SlotAddr

func SlotAddr(agentID, slotID string) actor.Address

SlotAddr calculates and returns a slot address.

Types

type ResourceManager

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

ResourceManager shims a RM actor to the ResourceManager interface.

func Wrap

func Wrap(ref *actor.Ref) *ResourceManager

Wrap wraps an RM actor as an explicit interface.

func (*ResourceManager) Allocate

Allocate allocates some resources.

func (*ResourceManager) Ask

func (r *ResourceManager) Ask(ctx actor.Messenger, req interface{}, v interface{}) error

Ask asks the underlying actor-based RM the req, setting the response into v.

func (*ResourceManager) DeleteJob

func (r *ResourceManager) DeleteJob(
	ctx actor.Messenger,
	msg sproto.DeleteJob,
) (resp sproto.DeleteJobResponse, err error)

DeleteJob requests we clean up our state related to a given job.

func (ResourceManager) DisableSlot

func (r ResourceManager) DisableSlot(
	m actor.Messenger,
	req *apiv1.DisableSlotRequest,
) (resp *apiv1.DisableSlotResponse, err error)

DisableSlot implements 'det slot disable...' functionality.

func (ResourceManager) EnableSlot

func (r ResourceManager) EnableSlot(
	m actor.Messenger,
	req *apiv1.EnableSlotRequest,
) (resp *apiv1.EnableSlotResponse, err error)

EnableSlot implements 'det slot enable...' functionality.

func (*ResourceManager) ExternalPreemptionPending

func (r *ResourceManager) ExternalPreemptionPending(
	ctx actor.Messenger,
	msg sproto.PendingPreemption,
) error

ExternalPreemptionPending requests we notify some allocation that it was preempted externally.

func (*ResourceManager) GetAgents

func (r *ResourceManager) GetAgents(
	ctx actor.Messenger,
	msg *apiv1.GetAgentsRequest,
) (resp *apiv1.GetAgentsResponse, err error)

GetAgents gets the state of connected agents or reads similar information from the underlying RM.

func (*ResourceManager) GetAllocationHandler

func (r *ResourceManager) GetAllocationHandler(
	ctx actor.Messenger,
	msg sproto.GetAllocationHandler,
) (resp *actor.Ref, err error)

GetAllocationHandler requests the allocation actor for the given allocation.

func (*ResourceManager) GetAllocationSummaries

func (r *ResourceManager) GetAllocationSummaries(
	ctx actor.Messenger,
	msg sproto.GetAllocationSummaries,
) (resp map[model.AllocationID]sproto.AllocationSummary, err error)

GetAllocationSummaries requests a summary of all current allocations.

func (*ResourceManager) GetAllocationSummary

func (r *ResourceManager) GetAllocationSummary(
	ctx actor.Messenger,
	msg sproto.GetAllocationSummary,
) (resp *sproto.AllocationSummary, err error)

GetAllocationSummary requests a summary of the given allocation.

func (*ResourceManager) GetDefaultAuxResourcePool

GetDefaultAuxResourcePool requests the default aux resource pool.

func (*ResourceManager) GetDefaultComputeResourcePool

GetDefaultComputeResourcePool requests the default compute resource pool.

func (*ResourceManager) GetJobQ

func (r *ResourceManager) GetJobQ(
	ctx actor.Messenger,
	msg sproto.GetJobQ,
) (resp map[model.JobID]*sproto.RMJobInfo, err error)

GetJobQ gets the state of the job queue.

func (*ResourceManager) GetJobQStats

func (r *ResourceManager) GetJobQStats(
	ctx actor.Messenger,
	msg sproto.GetJobQStats,
) (resp *jobv1.QueueStats, err error)

GetJobQStats requests stats for a job queue.

func (*ResourceManager) GetJobQueueStatsRequest

func (r *ResourceManager) GetJobQueueStatsRequest(
	ctx actor.Messenger,
	msg *apiv1.GetJobQueueStatsRequest,
) (resp *apiv1.GetJobQueueStatsResponse, err error)

GetJobQueueStatsRequest requests other stats for a job queue.

func (*ResourceManager) GetResourcePoolRef

func (r *ResourceManager) GetResourcePoolRef(
	ctx actor.Messenger,
	name string,
) (*actor.Ref, error)

GetResourcePoolRef is a default implementation to satisfy the interface, mostly for tests.

func (*ResourceManager) GetResourcePools

func (r *ResourceManager) GetResourcePools(
	ctx actor.Messenger,
	msg *apiv1.GetResourcePoolsRequest,
) (resp *apiv1.GetResourcePoolsResponse, err error)

GetResourcePools requests information about the available resource pools.

func (*ResourceManager) IsReattachEnabled

func (r *ResourceManager) IsReattachEnabled(ctx actor.Messenger) bool

IsReattachEnabled is a default implementation (not Reattachable).

func (*ResourceManager) IsReattachEnabledForRP

func (r *ResourceManager) IsReattachEnabledForRP(ctx actor.Messenger, rpName string) bool

IsReattachEnabledForRP is a default implementation for an RP being reattachable (false).

func (*ResourceManager) IsReattachableOnlyAfterStarted

func (r *ResourceManager) IsReattachableOnlyAfterStarted(ctx actor.Messenger) bool

IsReattachableOnlyAfterStarted is a default implementation (true).

func (*ResourceManager) MoveJob

func (r *ResourceManager) MoveJob(ctx actor.Messenger, msg sproto.MoveJob) error

MoveJob moves a job ahead of or behind a peer.

func (*ResourceManager) NotifyContainerRunning

func (r *ResourceManager) NotifyContainerRunning(
	ctx actor.Messenger,
	msg sproto.NotifyContainerRunning,
) error

NotifyContainerRunning receives a notification from the container to let the master know that the container is running.

func (*ResourceManager) RecoverJobPosition

func (r *ResourceManager) RecoverJobPosition(
	ctx actor.Messenger,
	msg sproto.RecoverJobPosition,
)

RecoverJobPosition recovers the position of a job relative to the rest of its priority lane.

func (*ResourceManager) Ref

func (r *ResourceManager) Ref() *actor.Ref

Ref gets the underlying RM actor, for backwards compatibility. This is deprecated.

func (*ResourceManager) Release

Release releases some resources.

func (*ResourceManager) ResolveResourcePool

func (r *ResourceManager) ResolveResourcePool(
	ctx actor.Messenger,
	name string,
	slots int,
) (string, error)

ResolveResourcePool is a default implementation to satisfy the interface, mostly for tests.

func (*ResourceManager) SetAllocationName

func (r *ResourceManager) SetAllocationName(
	ctx actor.Messenger,
	msg sproto.SetAllocationName,
)

SetAllocationName sets a name for a given allocation.

func (*ResourceManager) SetGroupMaxSlots

func (r *ResourceManager) SetGroupMaxSlots(ctx actor.Messenger, msg sproto.SetGroupMaxSlots)

SetGroupMaxSlots sets the max allocatable slots for a group.

func (*ResourceManager) SetGroupPriority

func (r *ResourceManager) SetGroupPriority(
	ctx actor.Messenger,
	msg sproto.SetGroupPriority,
) error

SetGroupPriority sets the group priority.

func (*ResourceManager) SetGroupWeight

func (r *ResourceManager) SetGroupWeight(
	ctx actor.Messenger,
	msg sproto.SetGroupWeight,
) error

SetGroupWeight sets the weight for a group.

func (ResourceManager) TaskContainerDefaults

func (r ResourceManager) TaskContainerDefaults(
	ctx actor.Messenger,
	pool string,
	fallbackConfig model.TaskContainerDefaultsConfig,
) (model.TaskContainerDefaultsConfig, error)

TaskContainerDefaults returns TaskContainerDefaults for the specified pool.

func (*ResourceManager) Tell

func (r *ResourceManager) Tell(ctx actor.Messenger, req interface{})

Tell tells the underlying actor-based RM the req.

func (*ResourceManager) ValidateCommandResources

ValidateCommandResources validates a request for command resources.

func (*ResourceManager) ValidateResourcePool

func (r *ResourceManager) ValidateResourcePool(ctx actor.Messenger, name string) error

ValidateResourcePool is a default implementation to satisfy the interface, mostly for tests.

func (*ResourceManager) ValidateResourcePoolAvailability

func (r *ResourceManager) ValidateResourcePoolAvailability(
	ctx actor.Messenger,
	name string,
	slots int) (
	[]command.LaunchWarning,
	error,
)

ValidateResourcePoolAvailability is a default implementation to satisfy the interface.

func (*ResourceManager) ValidateResources

func (r *ResourceManager) ValidateResources(
	ctx actor.Messenger,
	name string,
	slots int,
	command bool,
) error

ValidateResources is a default implementation to satisfy the interface, mostly for tests.

Jump to

Keyboard shortcuts

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