Skip to content

Commit

Permalink
Register gRPC plugin after reading configmap (flyteorg#564)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw authored Jun 7, 2023
1 parent c61fa47 commit 2086bb9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ require (
github.com/DiSiqueira/GoTree v1.0.1-0.20180907134536-53a8e837f295
github.com/benlaurie/objecthash v0.0.0-20180202135721-d1e3d6079fc1
github.com/fatih/color v1.13.0
github.com/flyteorg/flyteidl v1.5.2
github.com/flyteorg/flyteplugins v1.0.63
github.com/flyteorg/flyteidl v1.5.10
github.com/flyteorg/flyteplugins v1.0.64
github.com/flyteorg/flytestdlib v1.0.15
github.com/ghodss/yaml v1.0.0
github.com/go-redis/redis v6.15.7+incompatible
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flyteorg/flyteidl v1.5.2 h1:DZPzYkTg92qA4e17fd0ZW1M+gh1gJKh/VOK+F4bYgM8=
github.com/flyteorg/flyteidl v1.5.2/go.mod h1:ckLjB51moX4L0oQml+WTCrPK50zrJf6IZJ6LPC0RB4I=
github.com/flyteorg/flyteplugins v1.0.63 h1:9qLUWQz+ReDmXpkWRd0F72jRE7wh5U/L4Iu/hsH9iNw=
github.com/flyteorg/flyteplugins v1.0.63/go.mod h1:RUQgydOtY+8dkOdV0orxDdAyAyQT6EIz4qdvHO5h6R8=
github.com/flyteorg/flyteidl v1.5.10 h1:SHeiaWRt8EAVuFsat+BJswtc07HTZ4DqhfTEYSm621k=
github.com/flyteorg/flyteidl v1.5.10/go.mod h1:EtE/muM2lHHgBabjYcxqe9TWeJSL0kXwbI0RgVwI4Og=
github.com/flyteorg/flyteplugins v1.0.64 h1:t9S59C0s2nXsUEqKbQZJYHQzSfkhjJh1dcXlBlxhEUk=
github.com/flyteorg/flyteplugins v1.0.64/go.mod h1:HHt4nKDKVwrZPKDsj99dNtDSIJL378xNotYMA3a/TFA=
github.com/flyteorg/flytestdlib v1.0.15 h1:kv9jDQmytbE84caY+pkZN8trJU2ouSAmESzpTEhfTt0=
github.com/flyteorg/flytestdlib v1.0.15/go.mod h1:ghw/cjY0sEWIIbyCtcJnL/Gt7ZS7gf9SUi0CCPhbz3s=
github.com/flyteorg/stow v0.3.6 h1:jt50ciM14qhKBaIrB+ppXXY+SXB59FNREFgTJqCyqIk=
Expand Down
6 changes: 6 additions & 0 deletions pkg/controller/nodes/task/plugin_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,27 @@ import (
"context"
"fmt"
"strings"
"sync"

"github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/backoff"

"github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/core"
"github.com/flyteorg/flytestdlib/logger"

"github.com/flyteorg/flyteplugins/go/tasks/plugins/webapi/agent"
"github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/config"
"github.com/flyteorg/flytepropeller/pkg/controller/nodes/task/k8s"
)

var once sync.Once

func WranglePluginsAndGenerateFinalList(ctx context.Context, cfg *config.TaskPluginConfig, pr PluginRegistryIface) (enabledPlugins []core.PluginEntry, defaultForTaskTypes map[pluginID][]taskType, err error) {
if cfg == nil {
return nil, nil, fmt.Errorf("unable to initialize plugin list, cfg is a required argument")
}

// Register the GRPC plugin after the config is loaded
once.Do(func() { agent.RegisterAgentPlugin() })
pluginsConfigMeta, err := cfg.GetEnabledPlugins()
if err != nil {
return nil, nil, err
Expand Down
1 change: 0 additions & 1 deletion plugins/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ import (
_ "github.com/flyteorg/flyteplugins/go/tasks/plugins/webapi/athena"
_ "github.com/flyteorg/flyteplugins/go/tasks/plugins/webapi/bigquery"
_ "github.com/flyteorg/flyteplugins/go/tasks/plugins/webapi/databricks"
_ "github.com/flyteorg/flyteplugins/go/tasks/plugins/webapi/grpc"
_ "github.com/flyteorg/flyteplugins/go/tasks/plugins/webapi/snowflake"
)

0 comments on commit 2086bb9

Please sign in to comment.