Skip to content

feat(runner): redirect local runner stdout/stderr to fluentd#1007

Open
patricklundquist wants to merge 2 commits intomasterfrom
local-runner-fluentd-logs-9469375267477175563
Open

feat(runner): redirect local runner stdout/stderr to fluentd#1007
patricklundquist wants to merge 2 commits intomasterfrom
local-runner-fluentd-logs-9469375267477175563

Conversation

@patricklundquist
Copy link
Copy Markdown
Contributor

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".

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/1 when CLARIFAI_DEV_POD="true".
  • Adds sys import to support the file descriptor redirection logic.

Comment thread clarifai/runners/server.py
Comment thread clarifai/runners/server.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@patricklundquist patricklundquist marked this pull request as ready for review April 2, 2026 23:42
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Code Coverage

Package Line Rate Health
clarifai 45%
clarifai.cli 61%
clarifai.cli.templates 67%
clarifai.cli.templates.toolkits 100%
clarifai.client 65%
clarifai.client.auth 67%
clarifai.constants 100%
clarifai.datasets 100%
clarifai.datasets.export 69%
clarifai.datasets.upload 75%
clarifai.datasets.upload.loaders 37%
clarifai.models 100%
clarifai.rag 0%
clarifai.runners 49%
clarifai.runners.models 60%
clarifai.runners.pipeline_steps 39%
clarifai.runners.pipelines 72%
clarifai.runners.utils 62%
clarifai.runners.utils.data_types 72%
clarifai.schema 100%
clarifai.urls 58%
clarifai.utils 64%
clarifai.utils.evaluation 16%
clarifai.workflows 95%
Summary 60% (11878 / 19744)

Minimum allowed line rate is 50%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants