-
Notifications
You must be signed in to change notification settings - Fork 3.7k
remove logs from platforms #8072
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
Conversation
|
Hi @akhilerm. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/cc @cpuguy83 |
|
@akhilerm What's the plan for re-placing the Platforms package? |
platforms/cpuinfo.go
Outdated
| cpuVariantValue, err = getCPUVariant() | ||
| if err != nil { | ||
| log.L.Errorf("Error getCPUVariant for OS %s: %v", runtime.GOOS, err) | ||
| panic(fmt.Sprintf("Error getCPUVariant for OS %s: %v", runtime.GOOS, err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
panic seems too harsh here. Maybe just use stdlib log? (If we are really going to remove containerd/log here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are not able to reliably get the CPU variant, does containerd features like fetch, run etc work as expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely not. I think it would be very strange for this to fail ever unless it's running in qemu-user or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AkihiroSuda Changed to standard log package. PTAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this initialization be made part of all the binaries which are in cmd/ directory? Not able to get one location that serves all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about changing this to return an error rather than print a log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samuelkarp , changing the function to return an error also involves refactoring it in quite a number of places where the cpuVariant() function is used. Thats why i was thinking, if the other solution suggested above of using the interface is much better.
|
Could you pls rebase against |
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
5d9b806 to
cebcc9e
Compare
Its not about replacing platforms package. It will be available inside the containerd/container repo itself. But we can have it published into a repository like containerd/api or something else. So anyone who wants to use platforms outside the containerd organisation can refer to that. This is something that is already done in kubernetes repository. We are trying to do the similar for containerd/containerd and a new repo containerd/api. |
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
|
/ok-to-test |
|
@dims: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/ok-to-test |
|
This PR is stale because it has been open 90 days with no activity. This PR will be closed in 7 days unless new comments are made or the stale label is removed. |
|
looks like still relevant |
|
Closing as the changes in this PR has been achieved via #9086, so platforms is no more dependent on the containerd/containerd repo for logging. |
I definitely think that the |
|
@thaJeztah In that case, should we still decouple platforms from |
|
The containerd's "context-logger" is an elegant solution for that, but due to the context-key being strong-typed, still means that it's coupled to the containerd (log) codebase. My hope was that the Golang maintainers would officially endorse this approach (and for a while it looked like they did; the So.. looking at options here to see if we can surface the information that's logged to callers (instead of logging);
As mentioned above; passing the logger through the Which could be, just an var DebugLogger io.Writer(and used to print to) Or some ad-hoc minimum interface that must be satisfied (not sure if that should be a var DebugLogger interface {
Printf(format string, v ...any)
} |
|
LOL, that was a bit more lengthy than anticipated; input / suggestions from others more than welcome 😃 |
|
That was a rather elaborate description of what we want to have. If passing the logger is an option, then what about the approach described by @mxpv here #8072 (comment) |
|
LOL, looks like I didn't read that earlier comment properly, it's indeed quite similar. I'd be ok with a |

remove
github.com/containerd/containerd/logpackage from the platforms package ;so the platforms package is not dependent on the containerd repository.This will also help with the containerd API extraction that is planned.
Ref :[1]
Signed-off-by: Akhil Mohan akhilerm@gmail.com