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

Add visibility control to dynamic log links #6000

Merged
merged 3 commits into from
Nov 15, 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: 2 additions & 0 deletions flyteplugins/go/tasks/logs/logging_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ func InitializeLogPlugins(cfg *LogConfig) (tasklog.Plugin, error) {
DisplayName: dynamicLogLink.DisplayName,
DynamicTemplateURIs: dynamicLogLink.TemplateURIs,
MessageFormat: core.TaskLog_JSON,
ShowWhilePending: dynamicLogLink.ShowWhilePending,
HideOnceFinished: dynamicLogLink.HideOnceFinished,
})
}

Expand Down
8 changes: 5 additions & 3 deletions flyteplugins/go/tasks/pluginmachinery/tasklog/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,11 @@ func (p TemplateLogPlugin) GetTaskLogs(input Input) (Output, error) {
}
}
taskLogs = append(taskLogs, &core.TaskLog{
Uri: replaceAll(dynamicTemplateURI, templateVars),
Name: p.DisplayName + input.LogName,
MessageFormat: p.MessageFormat,
Uri: replaceAll(dynamicTemplateURI, templateVars),
Name: p.DisplayName + input.LogName,
MessageFormat: p.MessageFormat,
ShowWhilePending: p.ShowWhilePending,
HideOnceFinished: p.HideOnceFinished,
})
}
}
Expand Down
31 changes: 31 additions & 0 deletions flyteplugins/go/tasks/pluginmachinery/tasklog/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,37 @@ func TestTemplateLogPlugin(t *testing.T) {
},
},
},
{
"flyteinteractive",
TemplateLogPlugin{
Name: "vscode",
DynamicTemplateURIs: []TemplateURI{"vscode://flyteinteractive:{{ .taskConfig.port }}/{{ .podName }}"},
MessageFormat: core.TaskLog_JSON,
HideOnceFinished: true,
ShowWhilePending: true,
},
args{
input: Input{
PodName: "my-pod-name",
TaskTemplate: &core.TaskTemplate{
Config: map[string]string{
"link_type": "vscode",
"port": "1234",
},
},
},
},
Output{
TaskLogs: []*core.TaskLog{
{
Uri: "vscode://flyteinteractive:1234/my-pod-name",
MessageFormat: core.TaskLog_JSON,
ShowWhilePending: true,
HideOnceFinished: true,
},
},
},
},
{
"flyteinteractive - no link_type in task template",
TemplateLogPlugin{
Expand Down
Loading