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

[BUG] Plugin Collector does not include group #5429

Closed
2 tasks done
trevormcguire opened this issue May 29, 2024 · 4 comments · Fixed by #5457
Closed
2 tasks done

[BUG] Plugin Collector does not include group #5429

trevormcguire opened this issue May 29, 2024 · 4 comments · Fixed by #5457
Assignees
Labels
bug Something isn't working

Comments

@trevormcguire
Copy link
Contributor

trevormcguire commented May 29, 2024

Describe the bug

Flytepropeller tracks how many objects there for each resource type (such as TfJob, PyTorchjob, etc). However, the plugin collector go client does not include group names in the apiVerison when searching for these resources (such as kubeflow/v1), so a warning is raised failed to list objects for when attempting to list them.

list := metav1.PartialObjectMetadataList{
TypeMeta: metav1.TypeMeta{
Kind: r.gvk.Kind,
APIVersion: r.gvk.Version,
},
}
if err := r.cache.List(ctx, &list); err != nil {
logger.Warnf(ctx, "failed to list objects for %s.%s: %v", r.gvk.Kind, r.gvk.Version, err)
return
}

This seems to have been introduced when we were testing out 1.12 and can be traced back to #5238

Here is an example for SparkApplication.v1beta2

{"json":{"routine":"k8s-resource-level-monitor"},"level":"warning","msg":"failed to list objects for SparkApplication.v1beta2: failed to get API group resources: unable to retrieve the complete list of server APIs: v1beta2: the server could not find the requested resource","ts":"2024-05-29T19:25:22Z"}

Expected behavior

Resource Manager is able to correctly list custom resources

Additional context to reproduce

No response

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@trevormcguire trevormcguire added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels May 29, 2024
Copy link

welcome bot commented May 29, 2024

Thank you for opening your first issue here! 🛠

Copy link

runllm bot commented May 29, 2024

To address the issue where Flytepropeller's plugin collector fails to list objects due to missing group names in the apiVersion, you can modify the ResourceLevelMonitor to include the group names when searching for resources. This can be done by updating the collect function in the plugin collector code.

Here's an example of how you can modify the collect function to include the group names:

func (r *ResourceLevelMonitor) collect(ctx context.Context) {
    list := metav1.PartialObjectMetadataList{
        TypeMeta: metav1.TypeMeta{
            Kind:       r.gvk.Kind,
            APIVersion: fmt.Sprintf("%s/%s", r.gvk.Group, r.gvk.Version),
        },
    }
    if err := r.cache.List(ctx, &list); err != nil {
        logger.Warnf(ctx, "failed to list objects for %s.%s: %v", r.gvk.Kind, r.gvk.Version, err)
        return
    }
    // ... rest of the function
}

Would you like more details on how to implement this fix?

Sources:


This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.

Mention @RunLLM to ask follow-up questions. See runllm.com for more!

@trevormcguire trevormcguire changed the title [BUG] [BUG] Plugin Collector does not include group May 29, 2024
@eapolinario eapolinario removed the untriaged This issues has not yet been looked at by the Maintainers label May 30, 2024
@hamersaw
Copy link
Contributor

@trevormcguire would you be willing to submit a PR to correctly set the API version?

@trevormcguire
Copy link
Contributor Author

@trevormcguire would you be willing to submit a PR to correctly set the API version?

@hamersaw sure, will work on that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants