Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use shorter names for default pool and local workers #527

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hack/pipeline-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [ ! -e $stepo ]
then ./lunchpail build --create-namespace -e 'echo "hi from step $LUNCHPAIL_STEP"; sleep 2' -o $stepo
fi

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

echo "Launching pipeline"
$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) \
Expand Down
2 changes: 1 addition & 1 deletion pkg/be/local/shell/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func SpawnJob(ctx context.Context, c llir.ShellComponent, ir llir.LLIR, logdir s

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

Expand Down
2 changes: 1 addition & 1 deletion pkg/fe/builder/overlay/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func evalApp(eval string, opts Options) hlir.HLIR {

return hlir.HLIR{
Applications: []hlir.Application{app},
WorkerPools: []hlir.WorkerPool{hlir.NewPool("default", opts.BuildOptions.Workers)},
WorkerPools: []hlir.WorkerPool{hlir.NewPool("p1", opts.BuildOptions.Workers)},
}
}

Expand Down
8 changes: 6 additions & 2 deletions pkg/ir/llir/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ func (c ShellComponent) SetWorkers(w int) Component {
return c // FIXME
}

func (c ShellComponent) WithInstanceNameSuffix(suffix string) ShellComponent {
c.InstanceName = c.InstanceName + suffix
func (c ShellComponent) WithInstanceName(name string) ShellComponent {
c.InstanceName = name
return c
}

func (c ShellComponent) WithInstanceNameSuffix(suffix string) ShellComponent {
return c.WithInstanceName(c.InstanceName + suffix)
}
2 changes: 1 addition & 1 deletion pkg/runtime/builtins/cat.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ mv $1 $2`},

return hlir.HLIR{
Applications: []hlir.Application{app},
WorkerPools: []hlir.WorkerPool{hlir.NewPool("default", 1)},
WorkerPools: []hlir.WorkerPool{hlir.NewPool("p1", 1)},
}
}
8 changes: 6 additions & 2 deletions pkg/runtime/queue/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package queue

import (
"context"
"regexp"
"strings"

"lunchpail.io/pkg/be"
Expand Down Expand Up @@ -35,9 +36,11 @@ func Ls(ctx context.Context, backend be.Backend, run queue.RunContext, path stri
case "blobs":
prefix = wildcard.AsFile(queue.Blobs)
default:
prefix = wildcard.ListenPrefix()
prefix = wildcard.ListenPrefixForAnyStep(true)
}

nonqueue := regexp.MustCompile("dead|succeeded|dispatcherdone|alive|killfile")

files := make(chan string)
errors := make(chan error)
go func() {
Expand All @@ -49,7 +52,8 @@ func Ls(ctx context.Context, backend be.Backend, run queue.RunContext, path stri
errors <- o.Err
} else {
f := strings.Replace(o.Key, prefix+"/", "", 1)
if f != "" {
if f != "" && path != "" || !nonqueue.MatchString(f) {
// this means: we want the default (path=="") behavior to match only queue-related objects
files <- f
}
}
Expand Down
Loading