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

Hide bwc build output on success #42102

Merged
merged 10 commits into from
May 16, 2019
Merged

Hide bwc build output on success #42102

merged 10 commits into from
May 16, 2019

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented May 11, 2019

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.

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.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@rjernst rjernst requested a review from mark-vieira May 11, 2019 21:40
@rjernst
Copy link
Member Author

rjernst commented May 12, 2019

@elasticmachine run elasticsearch-ci/1
@elasticmachine run elasticsearch-ci/bwc

@rjernst
Copy link
Member Author

rjernst commented May 13, 2019

@elasticmachine run elasticsearch-ci/bwc
@elasticmachine run elasticsearch-ci/1

Copy link
Contributor

@mark-vieira mark-vieira left a 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
Copy link
Contributor

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.

@rjernst
Copy link
Member Author

rjernst commented May 14, 2019

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.

Copy link
Contributor

@mark-vieira mark-vieira left a 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.

if (useFileBuffer) {
File spoolFile = new File(getProject().getBuildDir() + "/buffered-output/" + this.getName());
out = new LazyFileOutputStream(spoolFile);
outputReader = () -> Files.readString(spoolFile.toPath());
Copy link
Contributor

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.

@mark-vieira
Copy link
Contributor

Updates LGTM 👍

@rjernst rjernst merged commit bc0b0f5 into elastic:master May 16, 2019
@rjernst rjernst deleted the distro_tests7 branch May 16, 2019 13:49
rjernst added a commit that referenced this pull request May 16, 2019
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.
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this pull request May 27, 2019
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.
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure >enhancement Team:Delivery Meta label for Delivery team v7.2.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants