Documentation ¶
Index ¶
- type ActionAuthorizer
- type Authorizer
- type EventServer
- type EventsPrinter
- type PulsarJobExpirer
- type PulsarSubmitServer
- func (srv *PulsarSubmitServer) Authorize(ctx *armadacontext.Context, queueName string, anyPerm permission.Permission, ...) (string, []string, error)
- func (srv *PulsarSubmitServer) CancelJobSet(grpcCtx context.Context, req *api.JobSetCancelRequest) (*types.Empty, error)
- func (srv *PulsarSubmitServer) CancelJobs(grpcCtx context.Context, req *api.JobCancelRequest) (*api.CancellationResult, error)
- func (srv *PulsarSubmitServer) CreateQueue(grpcCtx context.Context, req *api.Queue) (*types.Empty, error)
- func (srv *PulsarSubmitServer) CreateQueues(grpcCtx context.Context, req *api.QueueList) (*api.BatchQueueCreateResponse, error)
- func (srv *PulsarSubmitServer) DeleteQueue(grpcCtx context.Context, req *api.QueueDeleteRequest) (*types.Empty, error)
- func (srv *PulsarSubmitServer) GetQueue(ctx context.Context, req *api.QueueGetRequest) (*api.Queue, error)
- func (srv *PulsarSubmitServer) GetQueues(req *api.StreamingQueueGetRequest, stream api.Submit_GetQueuesServer) error
- func (srv *PulsarSubmitServer) GetUser(ctx *armadacontext.Context) string
- func (srv *PulsarSubmitServer) Health(ctx context.Context, _ *types.Empty) (*api.HealthCheckResponse, error)
- func (srv *PulsarSubmitServer) ReprioritizeJobs(grpcCtx context.Context, req *api.JobReprioritizeRequest) (*api.JobReprioritizeResponse, error)
- func (srv *PulsarSubmitServer) SubmitJobs(grpcCtx context.Context, req *api.JobSubmitRequest) (*api.JobSubmitResponse, error)
- func (srv *PulsarSubmitServer) UpdateQueue(grpcCtx context.Context, req *api.Queue) (*types.Empty, error)
- func (srv *PulsarSubmitServer) UpdateQueues(grpcCtx context.Context, req *api.QueueList) (*api.BatchQueueUpdateResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionAuthorizer ¶ added in v0.4.5
type ActionAuthorizer interface { AuthorizeAction(ctx *armadacontext.Context, perm permission.Permission) error AuthorizeQueueAction(ctx *armadacontext.Context, queue queue.Queue, anyPerm permission.Permission, perm queue.PermissionVerb) error }
type Authorizer ¶ added in v0.4.5
type Authorizer struct {
// contains filtered or unexported fields
}
func NewAuthorizer ¶ added in v0.4.5
func NewAuthorizer(permissionChecker authorization.PermissionChecker) *Authorizer
func (*Authorizer) AuthorizeAction ¶ added in v0.4.5
func (b *Authorizer) AuthorizeAction(ctx *armadacontext.Context, perm permission.Permission) error
func (*Authorizer) AuthorizeQueueAction ¶ added in v0.4.5
func (b *Authorizer) AuthorizeQueueAction( ctx *armadacontext.Context, queue queue.Queue, anyPerm permission.Permission, perm queue.PermissionVerb, ) error
type EventServer ¶
type EventServer struct {
// contains filtered or unexported fields
}
func NewEventServer ¶
func NewEventServer( authorizer ActionAuthorizer, eventRepository repository.EventRepository, queueRepository repository.QueueRepository, jobRepository repository.JobRepository, ) *EventServer
func (*EventServer) GetJobSetEvents ¶
func (s *EventServer) GetJobSetEvents(request *api.JobSetRequest, stream api.Event_GetJobSetEventsServer) error
GetJobSetEvents streams back all events associated with a particular job set.
func (*EventServer) Health ¶
func (s *EventServer) Health(_ context.Context, _ *types.Empty) (*api.HealthCheckResponse, error)
func (*EventServer) Watch ¶
func (s *EventServer) Watch(req *api.WatchRequest, stream api.Event_WatchServer) error
type EventsPrinter ¶
type EventsPrinter struct { Client pulsar.Client Topic string SubscriptionName string // Logger from which the loggers used by this service are derived // (e.g., using srv.Logger.WithField), or nil, in which case the global logrus logger is used. Logger *logrus.Entry }
EventsPrinter is a service that prints all events passing through pulsar to a logger. This service is only meant for use during development; it will be slow when the number of events is large.
func (*EventsPrinter) Run ¶
func (srv *EventsPrinter) Run(ctx *armadacontext.Context) error
Run the service that reads from Pulsar and updates Armada until the provided context is cancelled.
type PulsarJobExpirer ¶ added in v0.4.20
type PulsarJobExpirer struct { Consumer pulsar.Consumer JobRepository repository.JobRepository }
func (*PulsarJobExpirer) Run ¶ added in v0.4.20
func (srv *PulsarJobExpirer) Run(ctx *armadacontext.Context) error
type PulsarSubmitServer ¶
type PulsarSubmitServer struct { Producer pulsar.Producer QueueRepository repository.QueueRepository JobRepository repository.JobRepository SchedulingConfig configuration.SchedulingConfig // Maximum size of Pulsar messages MaxAllowedMessageSize uint // Used for job submission deduplication. KVStore *pgkeyvalue.PGKeyValueStore // Used to check at job submit time if the job could ever be scheduled on either legacy or pulsar schedulers SubmitChecker *scheduler.SubmitChecker // Gang id annotation. Needed because we cannot split a gang across schedulers. GangIdAnnotation string Authorizer ActionAuthorizer CompressorPool *pool.ObjectPool }
PulsarSubmitServer is a service that accepts API calls according to the original Armada submit API and publishes messages to Pulsar based on those calls. TODO: Consider returning a list of message ids of the messages generated TODO: Include job set as the message key for each message
func (*PulsarSubmitServer) Authorize ¶
func (srv *PulsarSubmitServer) Authorize( ctx *armadacontext.Context, queueName string, anyPerm permission.Permission, perm queue.PermissionVerb, ) (string, []string, error)
Authorize authorises a user request to submit a state transition message to the log. User information used for authorization is extracted from the provided context. Checks that the user has either anyPerm (e.g., permissions.SubmitAnyJobs) or perm (e.g., PermissionVerbSubmit) for this queue. Returns the userId and groups extracted from the context.
func (*PulsarSubmitServer) CancelJobSet ¶
func (srv *PulsarSubmitServer) CancelJobSet(grpcCtx context.Context, req *api.JobSetCancelRequest) (*types.Empty, error)
func (*PulsarSubmitServer) CancelJobs ¶
func (srv *PulsarSubmitServer) CancelJobs(grpcCtx context.Context, req *api.JobCancelRequest) (*api.CancellationResult, error)
func (*PulsarSubmitServer) CreateQueue ¶
func (*PulsarSubmitServer) CreateQueues ¶
func (srv *PulsarSubmitServer) CreateQueues(grpcCtx context.Context, req *api.QueueList) (*api.BatchQueueCreateResponse, error)
func (*PulsarSubmitServer) DeleteQueue ¶
func (srv *PulsarSubmitServer) DeleteQueue(grpcCtx context.Context, req *api.QueueDeleteRequest) (*types.Empty, error)
func (*PulsarSubmitServer) GetQueue ¶
func (srv *PulsarSubmitServer) GetQueue(ctx context.Context, req *api.QueueGetRequest) (*api.Queue, error)
func (*PulsarSubmitServer) GetQueues ¶ added in v0.3.103
func (srv *PulsarSubmitServer) GetQueues(req *api.StreamingQueueGetRequest, stream api.Submit_GetQueuesServer) error
func (*PulsarSubmitServer) GetUser ¶ added in v0.4.10
func (srv *PulsarSubmitServer) GetUser(ctx *armadacontext.Context) string
func (*PulsarSubmitServer) Health ¶ added in v0.4.20
func (srv *PulsarSubmitServer) Health(ctx context.Context, _ *types.Empty) (*api.HealthCheckResponse, error)
func (*PulsarSubmitServer) ReprioritizeJobs ¶
func (srv *PulsarSubmitServer) ReprioritizeJobs(grpcCtx context.Context, req *api.JobReprioritizeRequest) (*api.JobReprioritizeResponse, error)
func (*PulsarSubmitServer) SubmitJobs ¶
func (srv *PulsarSubmitServer) SubmitJobs(grpcCtx context.Context, req *api.JobSubmitRequest) (*api.JobSubmitResponse, error)
func (*PulsarSubmitServer) UpdateQueue ¶
func (*PulsarSubmitServer) UpdateQueues ¶
func (srv *PulsarSubmitServer) UpdateQueues(grpcCtx context.Context, req *api.QueueList) (*api.BatchQueueUpdateResponse, error)