Conversation
Signed-off-by: 1fanwang <1fannnw@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8083 +/- ##
==========================================
+ Coverage 57.32% 57.33% +0.01%
==========================================
Files 931 931
Lines 58315 58329 +14
==========================================
+ Hits 33427 33444 +17
+ Misses 21835 21832 -3
Partials 3053 3053
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: 1fanwang <1fannnw@gmail.com>
This branch has not been deployed
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.
Tracking issue
Related to #7153.
Why are the changes needed?
When a Ray task uses
FLYTE_FAIL_ON_ERROR=true, the SDK records a user exception inerror.pband exits 1, so KubeRay reportsFailed/AppFailed. The v1 Ray plugin currently classifies even a non-recoverable USER error as a retryable SYSTEM failure. This loses the SDK's user-error verdict.What changes were proposed in this pull request?
After KubeRay reports failure, use the existing output reader to honor readable USER errors: non-recoverable errors become permanent USER failures, and recoverable errors become retryable USER failures. Both request cleanup.
SYSTEM errors, absent writers, and missing, corrupt or oversized error files retain the existing SYSTEM retry-and-cleanup result. Metadata and read failures are logged. No flag or API is added.
How was this patch tested?
Added file-backed regressions for user/system verdicts and missing, corrupt and oversized error documents.
Labels
fixed
Setup process
The SDK/KubeRay capture and plugin replay setup are included under Testing Done.
Testing Done
The tasks ran with Flytekit 1.16.28, flytekitplugins-ray 1.16.28 and Ray 2.46.0 under KubeRay 1.5.1 on a Kind cluster running Kubernetes 1.35. Both tasks explicitly enable
FLYTE_FAIL_ON_ERROR=true. KubeRay produced the failed statuses naturally, and the SDK wrote the captured protobufs.This is SDK/KubeRay-to-plugin component integration. The Go driver uses the repository fixture for execution metadata, then calls production
GetTaskPhasewith the captured RayJob and the real filesystem-backed output reader. Status, storage and classification are not mocked. This evidence does not include a full Flyte Admin/Propeller workflow or an observed multi-attempt scheduler run.cleanup=trueis the returned cleanup request, not an observation of resource deletion.The classifier replays used Go 1.26.2. Set
EVIDENCE_ROOTto the absolute directory containing the captures, and run each classifier command from the corresponding checkout'sflyteplugins/directory with the driver below available in the Ray package.RAY_EVIDENCE_ROOT="$EVIDENCE_ROOT" RAY_EVIDENCE_CASE=permanent go test ./go/tasks/plugins/k8s/ray -run TestLiveRayErrorVerdict -count=1 -vRAY_EVIDENCE_ROOT="$EVIDENCE_ROOT" RAY_EVIDENCE_CASE=permanent go test ./go/tasks/plugins/k8s/ray -run TestLiveRayErrorVerdict -count=1 -vRAY_EVIDENCE_ROOT="$EVIDENCE_ROOT" RAY_EVIDENCE_CASE=recoverable go test ./go/tasks/plugins/k8s/ray -run TestLiveRayErrorVerdict -count=1 -vRAY_EVIDENCE_ROOT="$EVIDENCE_ROOT" RAY_EVIDENCE_CASE=recoverable go test ./go/tasks/plugins/k8s/ray -run TestLiveRayErrorVerdict -count=1 -vCaptured SDK failures
The decoded permanent error document contains:
jq '{origin,kind,code}' permanent/error.json{ "origin": "USER", "kind": "NON_RECOVERABLE", "code": "USER:RuntimeError" }jq -r '.message' permanent/error.jsonThe message ends with this verbatim excerpt:
The recoverable task produced:
jq '{origin,kind,code}' recoverable/error.json{ "origin": "USER", "kind": "RECOVERABLE", "code": "USER:Recoverable" }jq -r '.message' recoverable/error.jsonBoth captured RayJob status messages report entrypoint exit 1:
Each command prints:
Permanent user error
Before:
After:
Recoverable user error
Before:
After:
These are verbatim result excerpts. The baseline driver exits 1 because its assertions expect the corrected USER verdict; the printed phase shows the baseline's SYSTEM classification.
From-scratch capture and replay
The following is a recipe for a new disposable cluster, not an additional clean run performed for this description. The observed SDK executions and classifier results are above.
In an empty working directory, save the Dockerfile, requirements, task module and two RayJob manifests shown below. Build the image before creating the dedicated kubeconfig:
Capture the statuses and SDK-written files without changing either:
The manifests keep the Ray heads running so their output volumes remain available. The JSON below is only a readable rendering; the Go driver consumes the original protobuf:
Prepare separate Flyte source checkouts at the before/after revisions above. Save the complete Go driver below as
flyteplugins/go/tasks/plugins/k8s/ray/live_evidence_test.goin each checkout. It is a reproduction aid outside the product diff. With Go 1.26 available andEVIDENCE_ROOTstill exported, run the recorded commands from each checkout'sflyteplugins/directory.Reproducer source: Dockerfile
Dependency configuration, saved as
requirements.txt:Reproducer source: ray_tasks.py
Reproducer source: rayjob.yaml
Reproducer source: rayjob-recoverable.yaml
Reproducer source: live_evidence_test.go
Screenshots
Not applicable; the status, error-document and classifier output above are the evidence.
Check all the applicable boxes
Related PRs
Stack
No dependent PRs. Git Town documentation.
Docs link
Not applicable; no documentation changes.