-
Notifications
You must be signed in to change notification settings - Fork 840
[tmpnet] Deploy collectors with golang to simplify cross-repo use #3692
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
Conversation
59e5357 to
15c496b
Compare
| // TODO(marun) Figure out a way to redirect stdout and stderr of a detached child process without a bash shell | ||
| cmd := exec.Command("bash", "-c", fullCmd) | ||
| configureDetachedProcess(cmd) // Ensure the child process will outlive its parent |
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 you can create the command and set Stdout and Stderr to nil directly (according to the docs)
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.
Please give it a try and get back to me, because my attempts to create a child process that outlives its parent and configured with stdout and stderr redirected to a file created and opened by that parent were entirely unsuccessful.
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've added a comment detailing why I took this approach, PTAL.
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 may be wrong here, just remembered reading the documentation around this, so thought I'd provide the suggestion. May not behave as I expected from reading the docs (either due to a misread or incorrect docs).
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.
Re-reading your original comment, what is the intended result of setting Stdout and Stderr to nil? I need to send the output to a file, otherwise in CI I won't be able to collect the logs for troubleshooting (from the same tmpnet dir artifacts that contain the networks).
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 think that I thought you were trying to ignore the output here:
| // TODO(marun) Figure out a way to redirect stdout and stderr of a detached child process without a bash shell |
Stdout and Stderr to the corresponding file and avoid constructing a bash command.
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 attempted to do just that, but the following combination did not result in a log file that the child was writing to:
- child process that will outlive its parent
- child process configured with stderr and stdout set to a file opened by the parent
15c496b to
ccd3382
Compare
757b07a to
6060ccd
Compare
a8099ea to
34a8689
Compare
6060ccd to
d857661
Compare
01300b7 to
266cdb9
Compare
06869f7 to
e801d02
Compare
e801d02 to
284d898
Compare
|
Rebased |
456b45d to
a9e3433
Compare
Previously, prometheus and promtail were installed and launched by with bash scripts. Migrating installation to nix and launch to golang enables directly sharing the functionality with subnet-evm and hypersdk. No more having to copy and maintain copies of the scripts in multiple repos.
- ensure started/stopped -> start/stop collectors - use the same helpers between collector start and node process
Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Signed-off-by: maru <maru.newby@avalabs.org>
a9e3433 to
9c408ff
Compare
Why this should be merged
Previously, prometheus and promtail for collecting from local tmpnet networks were installed and launched by bash scripts. Migrating installation to nix and launch to golang simplifies reuse from subnet-evm and hypersdk. No more having to copy and maintain copies of the scripts in multiple repos.
How this works
--start-collectorsHow this was tested
Need to be documented in RELEASES.md?
N/A
TODO