Skip to content

fix(plugins/ray): remove terminal-only noise from Ray logs - #7890

Merged
pingsutw merged 1 commit into
flyteorg:masterfrom
1fanwang:1fanwang-ray-log-noise-env-vars-v1
Aug 21, 2026
Merged

pingsutw merged 1 commit into
flyteorg:masterfrom
1fanwang:1fanwang-ray-log-noise-env-vars-v1

Conversation

@1fanwang

@1fanwang 1fanwang commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Tracking issue

Related to #7504

Why are the changes needed?

Ray formats logs for an interactive terminal. In collected pod logs, ANSI escapes
appear as literal characters and progress-bar redraws become repeated lines.

Before this change, v1 Ray task output is buried in that noise. After this change,
head and worker logs are plain text without progress-bar redraws, matching v2.

What changes were proposed in this pull request?

Set Ray's existing environment switches on both containers:
RAY_COLOR_PREFIX=0 and RAY_DATA_DISABLE_PROGRESS_BARS=1.

How was this patch tested?

The resource builder creates the RayJob and checks both variables on the head and
worker containers. A live pod-log comparison has not been run.

$ git checkout upstream/master -- flyteplugins/go/tasks/plugins/k8s/ray/ray.go
$ cd flyteplugins && go test ./go/tasks/plugins/k8s/ray/... -run TestBuildResourceRayDisablesLogNoise -v
--- FAIL: TestBuildResourceRayDisablesLogNoise
    expected: "0"; actual: ""
    expected: "1"; actual: ""

$ git checkout origin/1fanwang-ray-log-noise-env-vars-v1 -- go/tasks/plugins/k8s/ray/ray.go
$ go test ./go/tasks/plugins/k8s/ray/... -run TestBuildResourceRayDisablesLogNoise -v
--- PASS: TestBuildResourceRayDisablesLogNoise

Labels

fixed

Setup process

No live cluster. The test drives the plugin's resource builder.

Check all the applicable boxes

  • I updated the documentation accordingly. Not applicable: no documented behavior changed.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

@github-actions

Copy link
Copy Markdown

This PR was flagged by our automated quality checks. If you're a genuine
contributor, please reply here and a maintainer will review your PR.

We appreciate your contribution and apologize if this is a false positive!

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.24%. Comparing base (b13deca) to head (d9753c1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7890   +/-   ##
=======================================
  Coverage   57.24%   57.24%           
=======================================
  Files         931      931           
  Lines       58269    58279   +10     
=======================================
+ Hits        33354    33364   +10     
  Misses      21856    21856           
  Partials     3059     3059           
Flag Coverage Δ
unittests-datacatalog 53.51% <ø> (ø)
unittests-flyteadmin 53.23% <ø> (ø)
unittests-flytecopilot 48.05% <ø> (ø)
unittests-flytectl 64.09% <ø> (ø)
unittests-flyteidl 75.71% <ø> (ø)
unittests-flyteplugins 60.45% <100.00%> (+0.03%) ⬆️
unittests-flytepropeller 53.81% <ø> (ø)
unittests-flytestdlib 64.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Ray colorizes its log prefixes with ANSI escapes and renders Ray Data
progress bars as repeated redraws. Both target an interactive terminal;
a Ray task's output is collected from a pod, so the escapes render as
literal noise and the progress bar repaints bloat the log.

Set RAY_COLOR_PREFIX=0 and RAY_DATA_DISABLE_PROGRESS_BARS=1 on the head
and worker containers so the collected logs stay readable.

Backport of flyteorg#7504, which landed on
the v2 branch only. Both branches ship the same Ray plugin.

Signed-off-by: 1fanwang <1fannnw@gmail.com>
@1fanwang
1fanwang force-pushed the 1fanwang-ray-log-noise-env-vars-v1 branch from c750569 to d9753c1 Compare August 20, 2026 20:17
@1fanwang 1fanwang changed the title fix(plugins/ray): disable Ray log noise on head and worker pods fix(plugins/ray): disable colour codes and progress bars in Ray logs Aug 20, 2026
@1fanwang 1fanwang closed this Aug 20, 2026
@1fanwang 1fanwang reopened this Aug 20, 2026
@github-actions

Copy link
Copy Markdown

This PR was flagged by our automated quality checks. If you're a genuine
contributor, please reply here and a maintainer will review your PR.

We appreciate your contribution and apologize if this is a false positive!

@1fanwang

Copy link
Copy Markdown
Contributor Author

This backports #7504 to the v1 Ray plugin. The current body includes the red/green BuildResource test, and the Flyte plugins unit and lint jobs pass.

@1fanwang 1fanwang changed the title fix(plugins/ray): disable colour codes and progress bars in Ray logs fix(plugins/ray): remove terminal-only noise from Ray logs Aug 20, 2026
@1fanwang 1fanwang closed this Aug 21, 2026
@1fanwang 1fanwang reopened this Aug 21, 2026
Comment on lines +379 to +386
{
Name: "RAY_COLOR_PREFIX",
Value: "0",
},
{
Name: "RAY_DATA_DISABLE_PROGRESS_BARS",
Value: "1",
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice, thank you thank you.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@1fanwang mind adding it to v2 as well

@1fanwang 1fanwang Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah this is already in v2 via #7504.

@pingsutw
pingsutw merged commit 89cf9cc into flyteorg:master Aug 21, 2026
138 of 142 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants