Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Enable streaming of build logs #459
base: master
Are you sure you want to change the base?
Enable streaming of build logs #459
Changes from 10 commits
ff70a52
6f3cd8f
16481a0
8af97ef
22a574e
d228dd9
a5ba7d9
6cb5e0e
eafcb94
c335997
26fdb65
93491f5
7869323
b287a56
a294b64
94f40e7
db5afde
f6bb71c
e7313e7
1def98a
a43a160
a559584
0c06d3c
153b0df
96afbb9
534da81
4859154
fd9ea32
7dedb5f
aeb386c
0c53ec5
59f25e8
1511ddb
167a9ad
1752d55
e09c9ec
d6b19e5
ed403ee
1c304b1
7b09548
505c303
f92a301
5942bd8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It should be considered to use a streaming approach, see
https://github.com/kubernetes-client/java/blob/master/examples/examples-release-latest/src/main/java/io/kubernetes/client/examples/LogsExample.java#L36-L49
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 did tried it, but streamNamespacedPodLog() waits till the pod execution is completed. I will dig 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.
It happens because podlogs set the follow true and under the hood use readNamespacedPodLog
https://github.com/kubernetes-client/java/blob/f20788272291c0e79a8c831d8d5a7dd94d96d2de/util/src/main/java/io/kubernetes/client/PodLogs.java#L87
kubernetes-client/java#571 (comment)
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 will move the logic to convert string to inputstream to this function so that getLogs return input stream
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 don't know if this is a limitation of java client or a bug, but I'm quite sure it's possible to stream the logs of a running pod.
I've made a simple test running a pod like this
Then I've used the K8s client implemented in Nextflow, that's a bare simple http request over URLConnection.
This snippet just stream the pod logs until the pod completes