submit

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deduplicator

type Deduplicator interface {
	GetOriginalJobIds(ctx *armadacontext.Context, queue string, jobRequests []*api.JobSubmitRequestItem) (map[string]string, error)
	StoreOriginalJobIds(ctx *armadacontext.Context, queue string, mappings map[string]string) error
}

Deduplicator deduplicates jobs submitted ot armada in order to prevent double submission

type PostgresDeduplicator

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

PostgresDeduplicator is an implementation of a Deduplicator that uses a pgkeyvalue.KeyValueStore as its state store

func NewDeduplicator

func NewDeduplicator(db *pgxpool.Pool) *PostgresDeduplicator

func (*PostgresDeduplicator) GetOriginalJobIds

func (s *PostgresDeduplicator) GetOriginalJobIds(ctx *armadacontext.Context, queue string, jobRequests []*api.JobSubmitRequestItem) (map[string]string, error)

func (*PostgresDeduplicator) StoreOriginalJobIds

func (s *PostgresDeduplicator) StoreOriginalJobIds(ctx *armadacontext.Context, queue string, mappings map[string]string) error

type Server

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

Server is a service that accepts API calls according to the original Armada submit API and publishes messages to Pulsar based on those calls.

func NewServer

func NewServer(
	queueService api.QueueServiceServer,
	publisher pulsarutils.Publisher[*armadaevents.EventSequence],
	queueCache armadaqueue.ReadOnlyQueueRepository,
	submissionConfig configuration.SubmissionConfig,
	deduplicator Deduplicator,
	authorizer auth.ActionAuthorizer,
) *Server

func (*Server) CancelJobSet

func (s *Server) CancelJobSet(grpcCtx context.Context, req *api.JobSetCancelRequest) (*types.Empty, error)

func (*Server) CancelJobs

func (s *Server) CancelJobs(grpcCtx context.Context, req *api.JobCancelRequest) (*api.CancellationResult, error)

func (*Server) CreateQueue

func (s *Server) CreateQueue(ctx context.Context, q *api.Queue) (*types.Empty, error)

func (*Server) CreateQueues

func (s *Server) CreateQueues(ctx context.Context, list *api.QueueList) (*api.BatchQueueCreateResponse, error)

func (*Server) DeleteQueue

func (s *Server) DeleteQueue(ctx context.Context, request *api.QueueDeleteRequest) (*types.Empty, error)

func (*Server) GetQueue

func (s *Server) GetQueue(ctx context.Context, request *api.QueueGetRequest) (*api.Queue, error)

func (*Server) GetQueues

func (s *Server) GetQueues(request *api.StreamingQueueGetRequest, server api.Submit_GetQueuesServer) error

func (*Server) GetUser

func (s *Server) GetUser(ctx *armadacontext.Context) string

func (*Server) Health

func (*Server) PreemptJobs

func (s *Server) PreemptJobs(grpcCtx context.Context, req *api.JobPreemptRequest) (*types.Empty, error)

func (*Server) ReprioritizeJobs

func (s *Server) ReprioritizeJobs(grpcCtx context.Context, req *api.JobReprioritizeRequest) (*api.JobReprioritizeResponse, error)

func (*Server) SubmitJobs

func (s *Server) SubmitJobs(grpcCtx context.Context, req *api.JobSubmitRequest) (*api.JobSubmitResponse, error)

SubmitJobs allows users to submit jobs to Armada. On receipt of a request, the following actions are performed:

  • The request is validated to make sure it is well formed. If this fails then an error is returned
  • Each JobRequestItem inside the request is checked to see if it is a duplicate
  • Each non-duplicate is converted into an armadaevents.SubmitMessage
  • All SubmitMessages are checked to see if the job they define can be scheduled (an example of a job that cannot be scheduled would be a job that requires more resources than exists on any node). If any message fails this check then an error is returned.
  • The SubmitMessages are published to Pulsar.

func (*Server) UpdateQueue

func (s *Server) UpdateQueue(ctx context.Context, q *api.Queue) (*types.Empty, error)

func (*Server) UpdateQueues

func (s *Server) UpdateQueues(ctx context.Context, list *api.QueueList) (*api.BatchQueueUpdateResponse, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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