Skip to content

Commit

Permalink
Dask dashboard should have a separate log config
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Dye <[email protected]>
  • Loading branch information
EngHabu authored and andrewwdye committed Sep 23, 2024
1 parent 2cb4fbe commit 560e27b
Show file tree
Hide file tree
Showing 4 changed files with 351 additions and 1 deletion.
29 changes: 29 additions & 0 deletions flyteplugins/go/tasks/plugins/k8s/dask/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package dask

import (
pluginsConfig "github.com/flyteorg/flyte/flyteplugins/go/tasks/config"
"github.com/flyteorg/flyte/flyteplugins/go/tasks/logs"
)

//go:generate pflags Config --default-var=defaultConfig

var (
defaultConfig = Config{
Logs: logs.DefaultConfig,
}

configSection = pluginsConfig.MustRegisterSubSection("dask", &defaultConfig)
)

// Config is config for 'dask' plugin
type Config struct {
Logs logs.LogConfig `json:"logs,omitempty"`
}

func GetConfig() *Config {
return configSection.GetConfig().(*Config)
}

func SetConfig(cfg *Config) error {
return configSection.SetConfig(cfg)
}
65 changes: 65 additions & 0 deletions flyteplugins/go/tasks/plugins/k8s/dask/config_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

256 changes: 256 additions & 0 deletions flyteplugins/go/tasks/plugins/k8s/dask/config_flags_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flyteplugins/go/tasks/plugins/k8s/dask/dask.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func createJobSpec(workerSpec daskAPI.WorkerSpec, schedulerSpec daskAPI.Schedule
}

func (p daskResourceHandler) GetTaskPhase(ctx context.Context, pluginContext k8s.PluginContext, r client.Object) (pluginsCore.PhaseInfo, error) {
logPlugin, err := logs.InitializeLogPlugins(logs.GetLogConfig())
logPlugin, err := logs.InitializeLogPlugins(&GetConfig().Logs)
if err != nil {
return pluginsCore.PhaseInfoUndefined, err
}
Expand Down

0 comments on commit 560e27b

Please sign in to comment.