Documentation ¶
Overview ¶
Package armadactl contains all the business logic for armadactl. It has no dependency on either viper or cobra libraries, and can be unit tested.
Output writer for the App is configurable so that tests can easily capture and perform assertions on it. Params are initialised in the param package, so that this package can be clear of viper dependency.
TODO there should be a type that uniquely represents a job, instead of having to pass around several parameters ¶
TODO add methods for querying more detailed info about queues and jobs (current priority and so on)
Index ¶
- type App
- func (a *App) CancelJob(queue string, jobSetId string, jobId string) (outerErr error)
- func (a *App) CancelJobSet(queue string, jobSetId string) (outerErr error)
- func (a *App) CreateQueue(queue queue.Queue) error
- func (a *App) CreateResource(fileName string, dryRun bool) error
- func (a *App) DeleteQueue(name string) error
- func (a *App) GetJobSchedulingReport(jobId string) error
- func (a *App) GetQueue(name string) error
- func (a *App) GetQueueSchedulingReport(queueName string, verbosity int32) error
- func (a *App) GetSchedulingReport(verbosity int32) error
- func (a *App) GetSchedulingReportForJob(jobId string, verbosity int32) error
- func (a *App) GetSchedulingReportForQueue(queueName string, verbosity int32) error
- func (a *App) Preempt(queue string, jobSetId string, jobId string) (outerErr error)
- func (a *App) ReprioritizeJob(jobId string, priorityFactor float64) error
- func (a *App) ReprioritizeJobSet(queueName string, jobSet string, priorityFactor float64) error
- func (a *App) Submit(path string, dryRun bool) error
- func (a *App) UpdateQueue(queue queue.Queue) error
- func (a *App) Version() error
- func (a *App) Watch(queue string, jobSetId string, raw bool, exitOnInactive bool, ...) error
- type Params
- type QueueAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { // Parameters passed to the CLI by the user. Params *Params // Out is used to write the output. Default to standard out, // but can be overridden in tests to make assertions on the applications's output. Out io.Writer // Source of randomness. Tests can use a mocked random source in order to provide // deterministic testing behaviour. Random io.Reader }
func New ¶
func New() *App
New instantiates an App with default parameters, including standard output and cryptographically secure random source.
func (*App) CancelJobSet ¶ added in v0.5.0
func (*App) CreateQueue ¶
CreateQueue calls app.QueueAPI.Create with the provided parameters.
func (*App) DeleteQueue ¶
DeleteQueue calls app.QueueAPI.Delete with the provided parameters.
func (*App) GetJobSchedulingReport ¶
func (*App) GetQueue ¶ added in v0.3.100
GetQueue calls app.QueueAPI.Get with the provided parameters.
func (*App) GetQueueSchedulingReport ¶
func (*App) GetSchedulingReport ¶ added in v0.3.62
func (*App) GetSchedulingReportForJob ¶ added in v0.3.71
func (*App) GetSchedulingReportForQueue ¶ added in v0.3.71
func (*App) ReprioritizeJob ¶ added in v0.5.0
Reprioritize sets the priority of the job identified by (jobId) to priorityFactor
func (*App) ReprioritizeJobSet ¶ added in v0.5.0
ReprioritizeJobSet sets the priority of the jobSet identified by (queueName, jobSet) to priorityFactor
func (*App) Submit ¶
Submit a job, represented by a file, to the Armada server. If dry-run is true, the job file is validated but not submitted.
func (*App) UpdateQueue ¶
UpdateQueue calls app.QueueAPI.Update with the provided parameters.
type Params ¶
type Params struct { ApiConnectionDetails *client.ApiConnectionDetails QueueAPI *QueueAPI }
Params struct holds all user-customizable parameters. Using a single struct for all CLI commands ensures that all flags are distinct and that they can be provided either dynamically on a command line, or statically in a config file that's reused between command runs.
type QueueAPI ¶
type QueueAPI struct { Create queue.CreateAPI Delete queue.DeleteAPI Get queue.GetAPI Update queue.UpdateAPI }
QueueAPI struct holds pointers to functions that are called by armadactl. The function types are defined in in /pkg/client/queue. By default, they point to functions defined in /pkg/client/queue, which call the Armada server gRPC API. However, they are user-replaceable to facilitate testing. TODO Consider replacing with an interface