From e5b6590088c050e3766eee8686f3804764eb471d Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario Date: Thu, 30 May 2024 17:18:22 -0700 Subject: [PATCH] Add `ConsoleURL` to flyteadmin config and write it to CRD Signed-off-by: Eduardo Apolinario --- flyteadmin/pkg/runtime/application_config_provider.go | 1 + .../pkg/runtime/interfaces/application_configuration.go | 3 +++ flyteadmin/pkg/workflowengine/impl/k8s_executor.go | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/flyteadmin/pkg/runtime/application_config_provider.go b/flyteadmin/pkg/runtime/application_config_provider.go index a16c27e694..4ec48c2056 100644 --- a/flyteadmin/pkg/runtime/application_config_provider.go +++ b/flyteadmin/pkg/runtime/application_config_provider.go @@ -33,6 +33,7 @@ var flyteAdminConfig = config.MustRegisterSection(flyteAdmin, &interfaces.Applic MaxParallelism: 25, K8SServiceAccount: "", UseOffloadedWorkflowClosure: false, + ConsoleUrl: "", }) var schedulerConfig = config.MustRegisterSection(scheduler, &interfaces.SchedulerConfig{ diff --git a/flyteadmin/pkg/runtime/interfaces/application_configuration.go b/flyteadmin/pkg/runtime/interfaces/application_configuration.go index 3a459209f5..fd44f8e4af 100644 --- a/flyteadmin/pkg/runtime/interfaces/application_configuration.go +++ b/flyteadmin/pkg/runtime/interfaces/application_configuration.go @@ -103,6 +103,9 @@ type ApplicationConfig struct { Envs map[string]string `json:"envs,omitempty"` FeatureGates FeatureGates `json:"featureGates" pflag:",Enable experimental features."` + + // A URL pointing to the flyteconsole instance used to hit this flyteadmin instance. + ConsoleURL string `json:"consoleUrl,omitempty"` } func (a *ApplicationConfig) GetRoleNameKey() string { diff --git a/flyteadmin/pkg/workflowengine/impl/k8s_executor.go b/flyteadmin/pkg/workflowengine/impl/k8s_executor.go index f90051fabe..ad6e4a5b96 100644 --- a/flyteadmin/pkg/workflowengine/impl/k8s_executor.go +++ b/flyteadmin/pkg/workflowengine/impl/k8s_executor.go @@ -55,6 +55,10 @@ func (e K8sWorkflowExecutor) Execute(ctx context.Context, data interfaces.Execut flyteWf.Tasks = nil } + if e.config.ApplicationConfiguration().GetTopLevelConfig().ConsoleURL != "" { + flyteWf.ConsoleURL = e.config.ApplicationConfiguration().GetTopLevelConfig().ConsoleURL + } + executionTargetSpec := executioncluster.ExecutionTargetSpec{ Project: data.ExecutionID.Project, Domain: data.ExecutionID.Domain,