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

Search by name for WorkflowTemplates in UI #11004

Closed
nice-pink opened this issue Apr 28, 2023 · 5 comments · Fixed by #11684
Closed

Search by name for WorkflowTemplates in UI #11004

nice-pink opened this issue Apr 28, 2023 · 5 comments · Fixed by #11684

Comments

@nice-pink
Copy link
Contributor

Summary

Add search bar in UI to search for WorkflowTemplates, ClusterWorkflowTemplates, CronWorkflows by name.

Use Cases

Searching by name makes sense if there is a large number of templates in a cluster. Some devs in our team submit WorkflowTemplates manually regularly. It's always a pain to scroll through all the templates.


Message from the maintainers:

Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.

@mozarik
Copy link

mozarik commented Jun 6, 2023

Maybe using Elasticsearch can be usefull when also searching for Log. Because i like to find some flow that have same error log

@sunyeongchoi
Copy link
Member

@terrytangyuan
Hello. I would like to be in charge of improving the filtering function by name.

@terrytangyuan
Copy link
Member

@terrytangyuan

Hello. I would like to be in charge of improving the filtering function by name.

Feel free to submit a PR

@sunyeongchoi
Copy link
Member

@terrytangyuan

Hello, I am working on implementing the "name contains" filter functionality in the ArgoWorkflows UI to resolve this issue.

As a result, I have implemented the list code as follows:

func (wts *WorkflowTemplateServer) ListWorkflowTemplates(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateListRequest) (*v1alpha1.WorkflowTemplateList, error) {
	wfClient := auth.GetWfClient(ctx)
	options := &v1.ListOptions{}
	if req.ListOptions != nil {
		options = req.ListOptions
	}
	wts.instanceIDService.With(options)
	wfList, err := wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace).List(ctx, *options)
	if err != nil {
		return nil, sutils.ToStatusError(err, codes.Internal)
	}

        // My Code Start
	if req.NamePattern != "" {
		var items []v1alpha1.WorkflowTemplate
		for _, item := range wfList.Items {
			if strings.Contains(item.ObjectMeta.Name, req.NamePattern) {
				items = append(items, item)
			}
		}
		wfList.Items = items
	}
        // My Code End

	sort.Sort(wfList.Items)
	return wfList, nil
}

I am contemplating how to proceed with pagination after applying the filtering.
In ArgoWorkflows, we are currently using the continue field from Kubernetes for pagination.

However, since continue is Kubernetes-specific, there could be challenges in implementing pagination when customizing Kubernetes results like I do.

I am currently facing a lot of considerations and seeking advice:

  1. Would it be better to implement the "name contains" filter functionality on the frontend and handle pagination there? In this case, data might not be refreshed when using the filtering feature.
  2. Is it preferable to create a new pagination logic on the server-side? With this approach, data would be refreshed with every filtering action, but I'm concerned about the potential load due to fetching the entire list each time.
  3. Is implementing server-side caching a viable option? If so, are there any suitable options for storing the data?
  4. If none of the above, would it be a good idea to use Kubernetes field selectors for filtering only when the names match?

Since this feature is dependent on Kubernetes, making a decision on my own seems challenging, so I'm seeking advice.

Thank you.

@shmruin
Copy link
Contributor

shmruin commented Aug 23, 2023

As kubernetes api doesn't support pattern searching, so far I also think 'searching whole on every page move' OR 'some caching' is inevitable to make name pattern search UI.
But the former can make a performance issue, and the latter requires some storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

6 participants