-
Notifications
You must be signed in to change notification settings - Fork 197
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
[kwok] Provided service for logs #417
[kwok] Provided service for logs #417
Conversation
✅ Deploy Preview for k8s-kwok canceled.
|
Hi @nikola-jokic. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. |
/ok-to-test |
4ff104a
to
533d3ce
Compare
5f18fd8
to
b7607fb
Compare
/retest |
e045c22
to
8baa9b5
Compare
I am not sure why Mac does not allow |
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.
I think it's a permissions issue, we don't have access to /tmp/
on the Mac in CI
Trying tests again If they fail, I'll investigate it to see if there is a problem on the runner side... I executed logs tests on Mac, and they worked... It might be something similar to the hosted machine from the last time 😕 |
Co-authored-by: Shiming Zhang <wzshiming@foxmail.com>
Co-authored-by: Shiming Zhang <wzshiming@foxmail.com>
Co-authored-by: Shiming Zhang <wzshiming@foxmail.com>
… 0o, use path instead of filepath
8e157d9
to
3cb49b8
Compare
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.
I've tried kubectl logs
which works fine, kubectl logs -f
which doesn't seem to work
pkg/kwok/server/debugging_logs.go
Outdated
func readLogs(ctx context.Context, logInfo *internalversion.Log, opts *logOptions, stdout, stderr io.Writer) error { | ||
logger := log.FromContext(ctx) | ||
|
||
logsFilePath := path.Join("/var/components/controller", logInfo.LogsFile) |
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.
I think this part of the logic should be handled in kwokctl, not in the kwok server.
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.
Working on it
Thank you for reviews a lot! I wanted to push this to ask for an opinion
I'll have it ready now that I know everything how to structure it, and I'll test all scenarios
Thank you again!
volumes := make([]internalversion.Volume, 0, len(mountDirs)) | ||
i := 0 | ||
for dir := range mountDirs { | ||
dirPath := strings.TrimPrefix(dir, "/var/components/controller") |
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.
This is the part I am unsure of. We can probably add strip prefix only in case when runtime is kind because we know that the prefix is going to be added, and it is going to be used in template.
The issue is that to use extra volume mounts, we add /var/components/controller
to all paths.
Since we need correct configuration for logs, we expand the path. I agree that the server should not inspect the runtime from configuration, so that is why this change was necessary. Ideally it should not interfere with the binary runtime unless the actual path there is this constant. Because of that, It might be wise to use check for the runtime but I wanted to check first, since this approach might be flawed in a way I don't know 😄
Thank you for pointing out the follow. I included tests for tail, since and follow in e2e tests 😄 |
/approve I've tested it locally and it's all working as expected, great! Also, add the same logic to Attach, do you think it's appropriate? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nikola-jokic, wzshiming The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/unhold Oh sure! Taking that one 😄 |
What type of PR is this?
/kind feature
Which issue(s) this PR fixes:
Fixes #217
Does this PR introduce a user-facing change?