Log stream the build and pull.#4535
Conversation
|
@danegsta it seems like the output from Based on what I'm observing it looks like you are observing the error code and piping into stderr the entire output? |
I will let David investigate but it might be a limitation of Docker/Podman CLI in the sense that if they detect they do not write to actual console, with its control character capabilities, they buffer the output until the build process is done. Just a theory. Because we do stream whatever is coming from the build command, at least that is the intent.
|
|
@karolz-ms could you reset your vote? (assuming you are ok with my changes) |
eerhardt
left a comment
There was a problem hiding this comment.
Are there any tests that can be written for this?
|
@mitchdenny I've got a small change to DCP that'll land soon to pass |
Will that also help with streaming. |
It should, but I'll need to test with your branch to make sure. |
Would testing with a simple custom dockerfile be useful here? 1. purge the image; 2. WithDockerFile with some custom messages(?); 3. start; 4. check the logs? |
|
|
||
| var timestamps = resource is Container; // Timestamps are available only for Containers as of Aspire P5. | ||
|
|
||
| if (resource is Container) |
There was a problem hiding this comment.
nit:
| if (resource is Container) | |
| if (timestamps) |
There was a problem hiding this comment.
Will look at this as a follow up. You would be surprised how much I agonized over that.
| var startupStdoutStreamTask = Task.Run(() => StreamLogsAsync(startupStdoutStream, isError: false), cancellationToken); | ||
| streamTasks.Add(startupStdoutStreamTask); | ||
|
|
||
| var startupStderrStreamTask = Task.Run(() => StreamLogsAsync(startupStderrStream, isError: false), cancellationToken); |
There was a problem hiding this comment.
Why is this using isError: false?
There was a problem hiding this comment.
Deliberate. docker build outputs vritually everything to stderr which @karolz-ms points out is the right thing for it to do from a unix philosophy point of view. But given it prepends the err text to ever line its quite noisy.
I think we might want to have a chat to the dashboard folks about a slightly different visual treatment here.
Eric I accidentally ignored this comment. I'll look at what our coverage for this change looks like. Mostly this is prepending existing logs so existing test coverage should make sure its working. But I'll have a think about what if anything extra we can do. |
We do have live tests already which take an image from MCR (which is pretty small) inject some custom files and then fetch the files from the web-server built into the image just to confirm the build args and build secrets are working. I'll look at what we can do to have a test that reads the log messages. |
This PR addresses #4522
This is still a draft because we have a few issues:
docker build/pulloutput is showing up as stderr.build/pulloutput with regular logs.Microsoft Reviewers: Open in CodeFlow