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

Watch and provide startup logs (workspace + broker pods) #16126

Merged
merged 59 commits into from
Feb 27, 2020
Merged
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b539823
collect logs first
sparkoo Feb 11, 2020
d57c5a8
very very rough log watching implementation, does not even work
sparkoo Feb 11, 2020
b51db10
ok this should work
sparkoo Feb 12, 2020
b9adf6a
cleanup
sparkoo Feb 13, 2020
d197701
format
sparkoo Feb 13, 2020
0025ab8
simplify, get rid of custom input stream
sparkoo Feb 13, 2020
2d149ec
format
sparkoo Feb 13, 2020
2b35664
start watching for logs later, when we know the machines we're intere…
sparkoo Feb 14, 2020
158d838
make waiting for containers to get the logs rather time based
sparkoo Feb 14, 2020
6f4f31c
block closing only when workspace failure, reusing kubernetes threadp…
sparkoo Feb 14, 2020
43723ef
just some refactoring and cleanup
sparkoo Feb 14, 2020
12a5584
and format
sparkoo Feb 14, 2020
3b5cd9f
reading log input stream moved to LogWatcher and PodLongHandler is no…
sparkoo Feb 14, 2020
8633ed8
more precise checking for log error
sparkoo Feb 14, 2020
8346d1c
format
sparkoo Feb 14, 2020
1922be4
Merge branch 'master' into logs
sparkoo Feb 17, 2020
c6aa8ff
make it possible to start the workspace in debug mode
sparkoo Feb 17, 2020
25e3478
debug mode in devfile attributes
sparkoo Feb 17, 2020
b506d29
get rid of inconsistent executor in KubernetesDeployments#watchLogs m…
sparkoo Feb 17, 2020
98330b2
log and javadoc fixes
sparkoo Feb 17, 2020
c70d9d3
nullcheckcs for the devfile and fix tests
sparkoo Feb 17, 2020
99d4425
better logs
sparkoo Feb 17, 2020
ee88f7a
add few tests
sparkoo Feb 17, 2020
5cfcabb
LogWatcher tests first batch
sparkoo Feb 17, 2020
07cd7be
remove unused imports
sparkoo Feb 17, 2020
dc00b4b
bit reworked container logwatch
sparkoo Feb 17, 2020
b82ad66
fix missing license headers
sparkoo Feb 17, 2020
d1faf3d
equals, hashCode and toString
sparkoo Feb 17, 2020
88151b0
that's not probably needed
sparkoo Feb 17, 2020
13a404c
review fixes, simplify code, better variable names
sparkoo Feb 18, 2020
106185c
Merge remote-tracking branch 'upstream/master' into logs
sparkoo Feb 18, 2020
e0bcf82
we don't need distinct on Set
sparkoo Feb 18, 2020
7934799
add rest param to watch the workspace pod logs
sparkoo Feb 20, 2020
d936ffe
Merge branch 'master' into logs
sparkoo Feb 20, 2020
7d5423b
fix and add tests
sparkoo Feb 20, 2020
f157536
return when finish with watching logs
sparkoo Feb 20, 2020
0e4b307
test successful ended container log watch
sparkoo Feb 20, 2020
5b2e3f2
simplify
sparkoo Feb 20, 2020
b38d98a
comment up
sparkoo Feb 20, 2020
5d5fa70
tests
sparkoo Feb 21, 2020
971220f
Merge branch 'master' into logs
sparkoo Feb 21, 2020
6ec9813
PodLogHandlerToEventPublisherTest
sparkoo Feb 21, 2020
13538a5
make debug workspace start query param lowercase
sparkoo Feb 21, 2020
6ac559a
hold sharedpool object in namespace/project factories
sparkoo Feb 21, 2020
a5448b3
watch plugin broker logs
sparkoo Feb 24, 2020
81d7eb4
synchroinze closing and adding container log watchers, wait before cl…
sparkoo Feb 25, 2020
2292dbb
synchronize new logwatch with closing
sparkoo Feb 25, 2020
1f6e85f
add missing license header
sparkoo Feb 25, 2020
a08094b
fix logwatch close test
sparkoo Feb 25, 2020
029ba5d
get startOptions down to broker deploy to tell wether we want to watc…
sparkoo Feb 25, 2020
be58621
Update infrastructures/kubernetes/src/main/java/org/eclipse/che/works…
sparkoo Feb 26, 2020
1bfebf8
Update infrastructures/kubernetes/src/main/java/org/eclipse/che/works…
sparkoo Feb 26, 2020
602ec57
review fixes
sparkoo Feb 26, 2020
73d367c
aaand format
sparkoo Feb 26, 2020
8153e71
timeoutes to constants
sparkoo Feb 26, 2020
4985b5f
remove unnecessary AtomiBoolean, synchronize creating LogWatch, and f…
sparkoo Feb 26, 2020
9fd495f
limit log inputstream size to be safe
sparkoo Feb 26, 2020
368e81b
remove logwatch TODO, which is fixed now
sparkoo Feb 26, 2020
30143b7
don't need AtomicBoolean, extra options isEmpty check, some javadoc
sparkoo Feb 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
format
Signed-off-by: Michal Vala <[email protected]>
sparkoo committed Feb 14, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 8346d1c48b33649afc9877388ed06ffff425d558
Original file line number Diff line number Diff line change
@@ -190,14 +190,15 @@ public void run() {

/**
* Reads given inputStream. If we receive error message about pod is initializing from k8s (see:
* {@link ContainerLogWatch#isErrorMessage(String)} and {@link ContainerLogWatch#ERROR_MESSAGE_MATCH_FORMAT}),
* returns false immediately so we can try again later. Otherwise keeps reading the messages
* from the stream and gives them to given handler. Be aware that it is blocking and potentially
* long operation!
* {@link ContainerLogWatch#isErrorMessage(String)} and {@link
* ContainerLogWatch#ERROR_MESSAGE_MATCH_FORMAT}), returns false immediately so we can try again
* later. Otherwise keeps reading the messages from the stream and gives them to given handler.
* Be aware that it is blocking and potentially long operation!
*
* @param inputStream to read log messages from
* @param handler we delegate log messages to this handler.
* @return false if 40x error received from k8s, true at the end of the stream or if interrupted
* @param handler we delegate log messages to this handler.
* @return false if error message received from k8s, true at the end of the stream or if
* interrupted
*/
private boolean readAndHandle(InputStream inputStream, PodLogHandler handler) {
try (BufferedReader in = new BufferedReader(new InputStreamReader(inputStream))) {