Skip to content

feat(autosynth): add LogCollector and Executor classes#531

Closed
chingor13 wants to merge 21 commits intogoogleapis:masterfrom
chingor13:logging-executor
Closed

feat(autosynth): add LogCollector and Executor classes#531
chingor13 wants to merge 21 commits intogoogleapis:masterfrom
chingor13:logging-executor

Conversation

@chingor13
Copy link
Copy Markdown
Contributor

@chingor13 chingor13 commented May 8, 2020

Executors abstract away running processes and capturing the log output
for later consumption.

LogCollector will collect logs by type and let us craft the desired
logging artifacts.

  • when running autosynth.synth, synthtool logs are tee'ed to stdout and captured in sponge_log.log files and saved as build artifacts
  • added a --hide-synth-log which is used by autosynth.multi which hides the synthtool logs -- the main autosynth.multi invocation won't show all the synthtool logs.
  • each individual autosynth.synth log is also captured in a sponge_log.log and saved as a build artifact.
  • converges logging setup to fix double logging - when switching to synthtool's git clone logic, we pulled in synthtool's logger setup which added a separate handler.

Towards #540

chingor13 added 3 commits May 8, 2020 10:46
Executors abstract away running processes and capturing the log output
for later consumption.

LogCollector will collect logs by type and let us craft the desired
logging artifacts.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 8, 2020
@chingor13 chingor13 marked this pull request as ready for review May 11, 2020 18:28
Copy link
Copy Markdown
Contributor

@SurferJeffAtGoogle SurferJeffAtGoogle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR will take me a while to grok.

The description describes LogCollector's purpose well. That helps.

But taking a step to a higher point of view, what are the goals of these code changes?
"Stop piping synthlog to stdout when running multi.py" appears to be one goal. Are there others?

@chingor13
Copy link
Copy Markdown
Contributor Author

The goal is to be able to organize and capture logs for debugging failures. Wrapping each shell execution gives us an easy entrypoint for capturing the logs to consume later.

"Stop piping synthlog to stdout when running multi.py" was so that if you run autosynth.synth, you will see the full stdout logs, but when running via autosynth.multi, you instead capture logs so the main autosynth log is not polluted. Each individual autosynth.synth execution is logged to its own sponge_log.log and captured as a build artifact.

@SurferJeffAtGoogle
Copy link
Copy Markdown
Contributor

The goal is to be able to organize and capture logs for debugging failures. Wrapping each shell execution gives us an easy entrypoint for capturing the logs to consume later.

"Stop piping synthlog to stdout when running multi.py" was so that if you run autosynth.synth, you will see the full stdout logs, but when running via autosynth.multi, you instead capture logs so the main autosynth log is not polluted. Each individual autosynth.synth execution is logged to its own sponge_log.log and captured as a build artifact.

The goal is to be able to organize and capture logs for debugging failures. Wrapping each shell execution gives us an easy entrypoint for capturing the logs to consume later.

"Stop piping synthlog to stdout when running multi.py" was so that if you run autosynth.synth, you will see the full stdout logs, but when running via autosynth.multi, you instead capture logs so the main autosynth log is not polluted. Each individual autosynth.synth execution is logged to its own sponge_log.log and captured as a build artifact.

autosynth.multi.py invokes autosynth.synth.py by creating a subprocess here:

return subprocess.run(

If we want the output of autosynth.synth.py to go to a sponge_log.log file instead of stdout, we can set subprocess.run's stdout param to open("sponge_log.log", "w").

@chingor13
Copy link
Copy Markdown
Contributor Author

We also should be able to debug what commands are being executed.

@SurferJeffAtGoogle
Copy link
Copy Markdown
Contributor

SurferJeffAtGoogle commented May 12, 2020 via email

@chingor13
Copy link
Copy Markdown
Contributor Author

Going to go with a simpler method for now.

@chingor13 chingor13 closed this May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants