rm

package
v0.0.0-...-3511abf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

AuthZProvider provides ResourceManagerAuthZ implementations.

Functions

This section is empty.

Types

type ResourceManager

type ResourceManager interface {
	// Basic functionality
	GetAllocationSummary(sproto.GetAllocationSummary) (*sproto.AllocationSummary, error)
	GetAllocationSummaries(sproto.GetAllocationSummaries) (map[model.AllocationID]sproto.AllocationSummary, error)
	SetAllocationName(sproto.SetAllocationName)
	Allocate(sproto.AllocateRequest) (*sproto.ResourcesSubscription, error)
	Release(sproto.ResourcesReleased)
	ValidateCommandResources(sproto.ValidateCommandResourcesRequest) (sproto.ValidateCommandResourcesResponse, error)
	ValidateResources(name string, slots int, command bool) error
	DeleteJob(sproto.DeleteJob) (sproto.DeleteJobResponse, error)
	NotifyContainerRunning(sproto.NotifyContainerRunning) error

	// Scheduling related stuff
	SetGroupMaxSlots(sproto.SetGroupMaxSlots)
	SetGroupWeight(sproto.SetGroupWeight) error
	SetGroupPriority(sproto.SetGroupPriority) error
	ExternalPreemptionPending(sproto.PendingPreemption) error
	IsReattachableOnlyAfterStarted() bool

	// Resource pool stuff.
	GetResourcePools(*apiv1.GetResourcePoolsRequest) (*apiv1.GetResourcePoolsResponse, error)
	GetDefaultComputeResourcePool(
		sproto.GetDefaultComputeResourcePoolRequest,
	) (sproto.GetDefaultComputeResourcePoolResponse, error)
	GetDefaultAuxResourcePool(sproto.GetDefaultAuxResourcePoolRequest) (sproto.GetDefaultAuxResourcePoolResponse, error)
	ValidateResourcePool(name string) error
	ResolveResourcePool(name string, workspace, slots int) (string, error)
	ValidateResourcePoolAvailability(name string, slots int) ([]command.LaunchWarning, error)
	TaskContainerDefaults(
		resourcePoolName string,
		fallbackConfig model.TaskContainerDefaultsConfig,
	) (model.TaskContainerDefaultsConfig, error)

	// Job queue
	GetJobQ(sproto.GetJobQ) (map[model.JobID]*sproto.RMJobInfo, error)
	GetJobQueueStatsRequest(*apiv1.GetJobQueueStatsRequest) (*apiv1.GetJobQueueStatsResponse, error)
	MoveJob(sproto.MoveJob) error
	RecoverJobPosition(sproto.RecoverJobPosition)
	GetExternalJobs(sproto.GetExternalJobs) ([]*jobv1.Job, error)

	// Cluster Management APIs
	GetAgents(*apiv1.GetAgentsRequest) (*apiv1.GetAgentsResponse, error)
	GetAgent(*apiv1.GetAgentRequest) (*apiv1.GetAgentResponse, error)
	EnableAgent(*apiv1.EnableAgentRequest) (*apiv1.EnableAgentResponse, error)
	DisableAgent(*apiv1.DisableAgentRequest) (*apiv1.DisableAgentResponse, error)
	GetSlots(*apiv1.GetSlotsRequest) (*apiv1.GetSlotsResponse, error)
	GetSlot(*apiv1.GetSlotRequest) (*apiv1.GetSlotResponse, error)
	EnableSlot(*apiv1.EnableSlotRequest) (*apiv1.EnableSlotResponse, error)
	DisableSlot(*apiv1.DisableSlotRequest) (*apiv1.DisableSlotResponse, error)
}

ResourceManager is an interface for a resource manager, which can allocate and manage resources.

func New

func New(
	system *actor.System,
	db *db.PgDB,
	echo *echo.Echo,
	config *config.ResourceConfig,
	taskContainerDefaults *model.TaskContainerDefaultsConfig,
	opts *aproto.MasterSetAgentOptions,
	cert *tls.Certificate,
) ResourceManager

New sets up the actor and endpoints for resource managers.

type ResourceManagerAuthZ

type ResourceManagerAuthZ interface {
	// GET /api/v1/resource-pools
	FilterResourcePools(
		ctx context.Context, curUser model.User, resourcePools []*resourcepoolv1.ResourcePool,
		accessibleWorkspaces []int32,
	) ([]*resourcepoolv1.ResourcePool, error)
}

ResourceManagerAuthZ is the interface for resource manager authorization.

type ResourceManagerAuthZBasic

type ResourceManagerAuthZBasic struct{}

ResourceManagerAuthZBasic is classic OSS Determined authentication for resource managers.

func (*ResourceManagerAuthZBasic) FilterResourcePools

func (a *ResourceManagerAuthZBasic) FilterResourcePools(
	ctx context.Context, curUser model.User, resourcePools []*resourcepoolv1.ResourcePool,
	_ []int32,
) ([]*resourcepoolv1.ResourcePool, error)

FilterResourcePools always returns provided list and a nil error.

Jump to

Keyboard shortcuts

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