Skip to content

Commit 10f331c

Browse files
committed
fix: use shorter names for default pool and local workers
Also - updates `queue ls` to show only main queue items by default. Now `queue ls all` will show everything. - fixes `queue ls` as it was only showing items from first step Signed-off-by: Nick Mitchell <[email protected]>
1 parent bf1c2e3 commit 10f331c

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

hack/pipeline-demo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if [ ! -e $stepo ]
2222
then ./lunchpail build --create-namespace -e 'echo "hi from step $LUNCHPAIL_STEP"; sleep 2' -o $stepo
2323
fi
2424

25-
step="$stepo up --verbose=${VERBOSE:-false} --workers 3"
25+
step="$stepo up --verbose=${VERBOSE:-false} --workers 3 --queue rclone://cfp/lunchpail"
2626

2727
echo "Launching pipeline"
2828
$step <(echo in1) <(echo in2) <(echo in3) <(echo in4) <(echo in5) <(echo in6) <(echo in7) <(echo in8) <(echo in9) <(echo in10) <(echo in11) <(echo in12) <(echo in13) <(echo in14) <(echo in15) <(echo in16) \

pkg/be/local/shell/job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func SpawnJob(ctx context.Context, c llir.ShellComponent, ir llir.LLIR, logdir s
2020

2121
for workerIdx := range c.Sizing.Workers {
2222
group.Go(func() error {
23-
return Spawn(jobCtx, c.WithInstanceNameSuffix(fmt.Sprintf("-w%d", workerIdx)), ir, logdir, opts)
23+
return Spawn(jobCtx, c.WithInstanceName(fmt.Sprintf("w%d", workerIdx)), ir, logdir, opts)
2424
})
2525
}
2626

pkg/fe/builder/overlay/eval.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func evalApp(eval string, opts Options) hlir.HLIR {
4646

4747
return hlir.HLIR{
4848
Applications: []hlir.Application{app},
49-
WorkerPools: []hlir.WorkerPool{hlir.NewPool("default", opts.BuildOptions.Workers)},
49+
WorkerPools: []hlir.WorkerPool{hlir.NewPool("p1", opts.BuildOptions.Workers)},
5050
}
5151
}
5252

pkg/ir/llir/shell.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ func (c ShellComponent) SetWorkers(w int) Component {
3939
return c // FIXME
4040
}
4141

42-
func (c ShellComponent) WithInstanceNameSuffix(suffix string) ShellComponent {
43-
c.InstanceName = c.InstanceName + suffix
42+
func (c ShellComponent) WithInstanceName(name string) ShellComponent {
43+
c.InstanceName = name
4444
return c
4545
}
46+
47+
func (c ShellComponent) WithInstanceNameSuffix(suffix string) ShellComponent {
48+
return c.WithInstanceName(c.InstanceName + suffix)
49+
}

pkg/runtime/builtins/cat.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ mv $1 $2`},
4848

4949
return hlir.HLIR{
5050
Applications: []hlir.Application{app},
51-
WorkerPools: []hlir.WorkerPool{hlir.NewPool("default", 1)},
51+
WorkerPools: []hlir.WorkerPool{hlir.NewPool("p1", 1)},
5252
}
5353
}

pkg/runtime/queue/ls.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package queue
22

33
import (
44
"context"
5+
"regexp"
56
"strings"
67

78
"lunchpail.io/pkg/be"
@@ -35,9 +36,11 @@ func Ls(ctx context.Context, backend be.Backend, run queue.RunContext, path stri
3536
case "blobs":
3637
prefix = wildcard.AsFile(queue.Blobs)
3738
default:
38-
prefix = wildcard.ListenPrefix()
39+
prefix = wildcard.ListenPrefixForAnyStep(true)
3940
}
4041

42+
nonqueue := regexp.MustCompile("dead|succeeded|dispatcherdone|alive|killfile")
43+
4144
files := make(chan string)
4245
errors := make(chan error)
4346
go func() {
@@ -49,7 +52,8 @@ func Ls(ctx context.Context, backend be.Backend, run queue.RunContext, path stri
4952
errors <- o.Err
5053
} else {
5154
f := strings.Replace(o.Key, prefix+"/", "", 1)
52-
if f != "" {
55+
if f != "" && path != "" || !nonqueue.MatchString(f) {
56+
// this means: we want the default (path=="") behavior to match only queue-related objects
5357
files <- f
5458
}
5559
}

0 commit comments

Comments
 (0)