-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Hide bwc build output on success #42102
Conversation
Previously we used LoggedExec for running the internal bwc builds. However, this had bad performance implications as all the output was buffered into memory, thus we changed back to normal Exec. This commit adds a `useFileBuffer` setting to LoggedExec which can be used for commands with large amounts of output, and switches the bwc builds to use this flag.
Pinging @elastic/es-core-infra |
@elasticmachine run elasticsearch-ci/1 |
@elasticmachine run elasticsearch-ci/bwc |
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.
Just a couple of minor comments. Otherwise 💯 on this change 👍
ByteArrayOutputStream output = new ByteArrayOutputStream(); | ||
ByteArrayOutputStream error = new ByteArrayOutputStream(); | ||
this.useFileBuffer = getProject().getObjects().property(Boolean.class); | ||
this.useFileBuffer.set(false); // default to in memory |
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 believe the "convention" is to use convention()
for setting default values on properties.
buildSrc/src/main/minimumRuntime/org/elasticsearch/gradle/LoggedExec.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/minimumRuntime/org/elasticsearch/gradle/LoggedExec.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/minimumRuntime/org/elasticsearch/gradle/LoggedExec.java
Outdated
Show resolved
Hide resolved
buildSrc/src/main/minimumRuntime/org/elasticsearch/gradle/LoggedExec.java
Outdated
Show resolved
Hide resolved
Thanks @mark-vieira. I really liked your idea for not using afterEvaluate. I pushed e4b8a9b, can you take another look? I believe I also addressed your other big points. |
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.
Changes look good! Just need to fix the stream close()
bit and this is good to go.
buildSrc/src/main/minimumRuntime/org/elasticsearch/gradle/LazyFileOutputStream.java
Show resolved
Hide resolved
if (useFileBuffer) { | ||
File spoolFile = new File(getProject().getBuildDir() + "/buffered-output/" + this.getName()); | ||
out = new LazyFileOutputStream(spoolFile); | ||
outputReader = () -> Files.readString(spoolFile.toPath()); |
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.
Another potential optimization (and not a blocker) would be to define instead an outputLogger
instead of outputReader
which also handled the logging bit. This way the file-based once could stream from the spool file to the console instead of having to read the entire log file into memory.
buildSrc/src/main/minimumRuntime/org/elasticsearch/gradle/LazyFileOutputStream.java
Show resolved
Hide resolved
Updates LGTM 👍 |
Previously we used LoggedExec for running the internal bwc builds. However, this had bad performance implications as all the output was buffered into memory, thus we changed back to normal Exec. This commit adds a `spoolOutput` setting to LoggedExec which can be used for commands with large amounts of output, and switches the bwc builds to use this flag.
Previously we used LoggedExec for running the internal bwc builds. However, this had bad performance implications as all the output was buffered into memory, thus we changed back to normal Exec. This commit adds a `spoolOutput` setting to LoggedExec which can be used for commands with large amounts of output, and switches the bwc builds to use this flag.
Previously we used LoggedExec for running the internal bwc builds.
However, this had bad performance implications as all the output was
buffered into memory, thus we changed back to normal Exec. This commit
adds a
useFileBuffer
setting to LoggedExec which can be used forcommands with large amounts of output, and switches the bwc builds to
use this flag.