[BEAM-8015] Get logs from Docker containers#9389
Merged
mxm merged 1 commit intoapache:masterfrom Aug 27, 2019
Merged
Conversation
Author
|
Run Java PreCommit |
3 similar comments
Author
|
Run Java PreCommit |
Author
|
Run Java PreCommit |
Author
|
Run Java PreCommit |
mxm
reviewed
Aug 22, 2019
Contributor
mxm
left a comment
There was a problem hiding this comment.
That will be very helpful for debugging container problems.
.../src/main/java/org/apache/beam/runners/fnexecution/environment/DockerEnvironmentFactory.java
Outdated
Show resolved
Hide resolved
96c0051 to
8c285a6
Compare
Author
|
Run Java PreCommit |
mxm
reviewed
Aug 23, 2019
...n-execution/src/main/java/org/apache/beam/runners/fnexecution/environment/DockerCommand.java
Show resolved
Hide resolved
mxm
reviewed
Aug 26, 2019
| Thread.currentThread().interrupt(); | ||
| throw new RuntimeException(interruptEx); | ||
| String containerLogs = docker.getContainerLogs(containerId); | ||
| LOG.error("Docker container {} logs:\n{}", containerId, containerLogs); |
Contributor
There was a problem hiding this comment.
This will only print "redirected to stdout" now?
Author
There was a problem hiding this comment.
(Also, I changed the code a bit, it was incorrect before)
...n-execution/src/main/java/org/apache/beam/runners/fnexecution/environment/DockerCommand.java
Show resolved
Hide resolved
mxm
approved these changes
Aug 27, 2019
| return reader.lines().collect(Collectors.joining()); | ||
| return reader.lines().collect(Collectors.joining(delimiter)); | ||
| }); | ||
| CompletableFuture<String> errorFuture; |
Contributor
There was a problem hiding this comment.
Wouldn't a better place for this and all following lines to be in the
if (exitCode != 0) {block? The errorFuture and errorString are not used elsewhere.
...n-execution/src/main/java/org/apache/beam/runners/fnexecution/environment/DockerCommand.java
Show resolved
Hide resolved
Contributor
|
Run Java PreCommit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
rmoption fordocker run, which deletes containers before we can inspect what happened to them. Instead, calldocker rmourselves to clean up the container only after we log its logs. (Behavior for--retain_docker_containerstays the same.)Apologies for complicating the test setup -- I wanted to parameterize to make sure we're covering all the cases.
R: @angoenka @mxm
Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.