Skip to content

[Flyte 7198] Enabling flyte plugins#7259

Open
0yukali0 wants to merge 6 commits intoflyteorg:v2from
0yukali0:flyte-7198
Open

[Flyte 7198] Enabling flyte plugins#7259
0yukali0 wants to merge 6 commits intoflyteorg:v2from
0yukali0:flyte-7198

Conversation

@0yukali0
Copy link
Copy Markdown
Contributor

@0yukali0 0yukali0 commented Apr 23, 2026

Tracking issue

Close #7198

Why are the changes needed?

Flyte v2 OSS won't trigger ray, dask, spark, torch, tensorflow and mpi plugins

What changes were proposed in this pull request?

  1. Register CRD
  2. Initialize informer and client for operate CRD
  3. Filtering unset plugins

How was this patch tested?

  1. make sandbox-build && make sandbox-run FLYTE_DEV=True
  2. Installing crd opreators image
  3. make -C manager run

Labels

  • added: For new features.

This is important to improve the readability of release notes.

Setup process

  1. Update complete.yaml
enabled_plugins:
  tasks:
    task-plugins:
        enabled-plugins:
          - container
          - sidecar
          - connector-service
          - echo
          - ray
          - spark
          - dask
          - pytorch
          - tensorflow
          - mpi
        default-for-task-types:
          container: container
          sidecar: sidecar
          container_array: k8s-array
  1. make devbox-start
  2. Installing crd opreators image

spark_role.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
  name: spark
  namespace: flyte
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: spark-testproject-development
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: edit
subjects:
  - kind: ServiceAccount
    name: spark
    namespace: flyte

Screenshots

  1. spark image
  2. ray image
  3. dask image
  4. torch image

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

@pingsutw
Copy link
Copy Markdown
Member

@0yukali0 is it ready to be reviewed?

@0yukali0
Copy link
Copy Markdown
Contributor Author

Hi @pingsutw
No, lack a filtering implementation when setting yaml of enabling plugins.
Current implementation registers all plugins by default, some plugins are not listed in enabled plugins should be skipped.
i will complete this function later, this PR will be reviewable tomorrow.

@0yukali0 0yukali0 marked this pull request as ready for review April 24, 2026 17:13
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: yuteng chen <a08h0283@gmail.com>
Signed-off-by: yuteng chen <a08h0283@gmail.com>
Signed-off-by: yuteng chen <a08h0283@gmail.com>
@0yukali0
Copy link
Copy Markdown
Contributor Author

Hi @pingsutw , this PR is ready.
If there are new suggestions, pls tag me and let me know.
thx.

Comment thread charts/flyte-binary/values.yaml Outdated
- echo
default-for-task-types:
# -- Executor-specific plugin configuration (read by the executor binary, not propeller)
executor:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we keep the same (tasks/task-plugins)? will make people easy to migrate to v2

Comment thread executor/setup.go
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(flyteorgv1.AddToScheme(scheme))
utilruntime.Must(rayv1.AddToScheme(scheme))
utilruntime.Must(sparkOp.AddToScheme(scheme))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if err := daskAPI.AddToScheme(scheme.Scheme); err != nil {

do we still need to add schema here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pingsutw.
I encountered into a problem that scheme not found when i removed these.
i think is that controller-runtime manager won't recognize schemes if initialization in setup.go doesn't register them.

Comment thread executor/setup.go
_ "github.com/flyteorg/flyte/v2/flyteplugins/go/tasks/plugins/k8s/kfoperators/pytorch"
_ "github.com/flyteorg/flyte/v2/flyteplugins/go/tasks/plugins/k8s/kfoperators/tensorflow"
_ "github.com/flyteorg/flyte/v2/flyteplugins/go/tasks/plugins/k8s/pod"
_ "github.com/flyteorg/flyte/v2/flyteplugins/go/tasks/plugins/k8s/ray"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread executor/pkg/plugin/registry.go Outdated
Comment on lines +55 to +60
allowed := executorConfig.GetConfig().EnabledPlugins
isAllowed := func(id string) bool {
if len(allowed) == 0 {
return true
}
return slices.Contains(allowed, id)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add a helper function and return a PluginConfigMeta

func (p TaskPluginConfig) GetEnabledPlugins() (PluginsConfigMeta, error) {
enabledPluginsNames := sets.NewString()
for _, pluginName := range p.EnabledPlugins {
cleanedPluginName := cleanString(pluginName)
enabledPluginsNames.Insert(cleanedPluginName)
}
pluginDefaultForTaskType := make(map[PluginID][]TaskType)
// Reverse the DefaultForTaskTypes map. Having the config use task type as a key guarantees only one default plugin can be specified per
// task type but now we need to sort for which tasks a plugin needs to be the default.

0yukali0 added 2 commits May 2, 2026 06:18
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants