feat(runner): redirect local runner stdout/stderr to fluentd#1007
Open
patricklundquist wants to merge 2 commits intomasterfrom
Open
feat(runner): redirect local runner stdout/stderr to fluentd#1007patricklundquist wants to merge 2 commits intomasterfrom
patricklundquist wants to merge 2 commits intomasterfrom
Conversation
When running a local runner inside a developer pod, standard output and standard error are redirected to `/proc/1/fd/1` using `os.dup2`. This allows fluentd to capture and route the local runner's logs as part of the main pod logs. This behavior is enabled when the `CLARIFAI_DEV_POD` environment variable is set to `"true"`. Co-authored-by: patricklundquist <1460278+patricklundquist@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in mechanism for local runners (when running inside a developer pod) to redirect their stdout/stderr to PID 1’s stdout so fluentd can capture the logs in the main pod log stream.
Changes:
- Redirects stdout/stderr to
/proc/1/fd/1whenCLARIFAI_DEV_POD="true". - Adds
sysimport to support the file descriptor redirection logic.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Minimum allowed line rate is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When running a local runner inside a developer pod, standard output and standard error are redirected to
/proc/1/fd/1usingos.dup2. This allows fluentd to capture and route the local runner's logs as part of the main pod logs. This behavior is enabled when theCLARIFAI_DEV_PODenvironment variable is set to"true".