Skip to content

Commit

Permalink
Alter docs to reflect changes made to --queues_avoid (#116)
Browse files Browse the repository at this point in the history
* Alter docs to reflect changes made to --queues_avoid
  • Loading branch information
rk1274 authored Dec 4, 2024
1 parent e162843 commit a2f8f1d
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func init() {
cronCmd.Flags().StringVar(&multiCh, "ch", "", "passed through to 'wrstat walk'")
cronCmd.Flags().StringVar(&forcedQueue, "queue", "", "force a particular queue to be used when scheduling jobs")
cronCmd.Flags().StringVar(&queuesToAvoid, "queues_avoid", "",
"force queues with this substring to be avoided when scheduling jobs")
"force queues that include a substring from this comma-separated list to be avoided when scheduling jobs")
cronCmd.Flags().IntVarP(&maxMem, "max_mem", "m",
defaultMaxRAM, "maximum MBs to reserve for any job")
cronCmd.Flags().StringVarP(&crontab, "crontab", "c",
Expand Down
2 changes: 1 addition & 1 deletion cmd/multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func init() {
multiCmd.Flags().StringVar(&multiCh, "ch", "", "passed through to 'wrstat walk'")
multiCmd.Flags().StringVar(&forcedQueue, "queue", "", "force a particular queue to be used when scheduling jobs")
multiCmd.Flags().StringVar(&queuesToAvoid, "queues_avoid", "",
"force queues with this substring to be avoided when scheduling jobs")
"force queues that include a substring from this comma-separated list to be avoided when scheduling jobs")
multiCmd.Flags().IntVarP(&maxMem, "max_mem", "m", defaultMaxRAM, "maximum MBs to reserve for any job")
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ func die(msg string, a ...interface{}) {
// function you should defer.
//
// If you provide a non-blank queue, that queue will be used when scheduling. If
// you provide a non-black queuesAvoid, queues with that substring will be
// avoided.
// you provide a non-black queuesAvoid, queues including a substring from the
// list will be avoided.
func newScheduler(cwd, queue, queuesAvoid string, sudo bool) (*scheduler.Scheduler, func()) {
if runJobs != "" {
return testScheduler(sudo)
Expand Down
2 changes: 1 addition & 1 deletion cmd/walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func init() {
walkCmd.Flags().StringVar(&walkCh, "ch", "", "passed through to 'wrstat stat'")
walkCmd.Flags().StringVarP(&forcedQueue, "queue", "q", "", "force a particular queue to be used when scheduling jobs")
walkCmd.Flags().StringVar(&queuesToAvoid, "queues_avoid", "",
"force queues with this substring to be avoided when scheduling jobs")
"force queues that include a substring from this comma-separated list to be avoided when scheduling jobs")
}

// checkArgs checks we have required args and returns desired dir.
Expand Down
2 changes: 1 addition & 1 deletion scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type Scheduler struct {
// deployment, timeout and logger. Added jobs will have the given cwd, which
// matters. If cwd is blank, the current working dir is used. If queue is not
// blank, that queue will be used during NewJob(). If queuesAvoid is not blank,
// queues including that substring will be avoided during NewJob().
// queues including a substring from the list will be avoided during NewJob().
func New(deployment, cwd, queue, queuesAvoid string, timeout time.Duration, logger log15.Logger) (*Scheduler, error) {
cwd, err := pickCWD(cwd)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions scheduler/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ func TestStatFile(t *testing.T) {
})

Convey("You can make a Scheduler with queues to avoid", func() {
s, err := New(deployment, "", "", "avoid", timeout, logger)
s, err := New(deployment, "", "", "avoid,queue", timeout, logger)
So(err, ShouldBeNil)
So(s, ShouldNotBeNil)

dreq := DefaultRequirements()
job := s.NewJob("cmd", "rep", "req", "", "", nil)
So(job.Requirements.RAM, ShouldEqual, dreq.RAM)
So(job.Override, ShouldEqual, 0)
So(job.Requirements.Other, ShouldResemble, map[string]string{"scheduler_queues_avoid": "avoid"})
So(job.Requirements.Other, ShouldResemble, map[string]string{"scheduler_queues_avoid": "avoid,queue"})
})
})

Expand Down
2 changes: 1 addition & 1 deletion walk/walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ type flowController struct {
}

func newController() *flowController {
return controllerPool.Get().(*flowController) //nolint:forcetypeassert
return controllerPool.Get().(*flowController) //nolint:forcetypeassert,errcheck
}

func (f *flowController) GetControl() chan<- Dirent {
Expand Down

0 comments on commit a2f8f1d

Please sign in to comment.