Run Ray Data Pipelines from pipelines-components
The next Alauda AI Platform release packages reusable components from the mirrored
pipelines-components project for Kubeflow Pipelines 2.16.1. AutoGluon
pipelines can be preloaded by the operator. The Ray Data group is
experimental and is not preloaded. Compile it the same way as any
other custom asset: clone the mirror Alauda supplies, install
kfp-components editable, and upload the YAML. See
Use Reusable Kubeflow Pipeline Components.
Ray Data itself never appears as a KFP task. The parse_and_chunk component
submits a KubeRay RayJob. The job builds a ray.data dataset of PDF paths,
runs Docling inside an actor pool, and writes one JSONL object per file to
S3-compatible storage.
A compile-and-upload notebook lives next to this page:
For a few dozen PDFs, convert them in a Workbench instead: Prepare Fine-Tuning Data with Docling and SDG Hub. For RAG search over chunking and retrieval settings, use Optimize a RAG Application with AutoRAG Pipelines.
TOC
PrerequisitesPrepare input storageCompile from a WorkbenchRun parse-and-chunk onlyRun the full RAG pipelineWhat Ray Data does inside the jobTroubleshootingNext stepsPrerequisites
The component runtime image defaults to an ODH CPU datascience image. Replace
it with the Alauda-mirrored runtime for your cluster, or set
RELATED_IMAGE_RAG_BASE_RUNTIME when you compile.
Kueue: leave bypass_kueue=false (the default) when the namespace has a Local
Queue. Set bypass_kueue=true only on clusters without Kueue.
Prepare input storage
Create the PDF PVC and the chunk-store Secret in the pipeline namespace:
Copy PDFs under input/pdfs/ on that PVC (the default input_path). A
Workbench that mounts data-pvc can upload files from JupyterLab. Nested
directories are included; num_files=0 processes every *.pdf.
Compile from a Workbench
The kfp-components package is not published to PyPI. Clone the Alauda mirror
and install it in a Python 3.11 or later virtual environment. Pin the SDK to the
version shipped by Alauda AI Platform. Replace <pipelines-components-repo-url> with the
repository address supplied by Alauda for the environment:
Compile only parse_and_chunk when you need JSONL chunks and will embed them
yourself:
Compile the full RAG DAG when you also want Milvus ingest and an LLM
InferenceService. Override ray_image and namespace at run time, not in
this compile step:
Upload the YAML from Kubeflow Pipelines > Pipelines > Upload pipeline, or submit it with the KFP SDK from the same Workbench.
Run parse-and-chunk only
Create a run of parse_and_chunk and set:
The component waits until the Ray cluster reports readyWorkerReplicas == num_workers, then until the RayJob jobStatus is SUCCEEDED (up to four
hours). Output is the URI s3://<bucket>/<prefix>.
Each JSONL line is:
tokenizer should match the embedding model you will use later. The default is
sentence-transformers/all-MiniLM-L6-v2. For the full RAG pipeline, pass the
same string as embedding_model.
Do not schedule Docling actors on the Ray head. Size cpus_per_actor × max_actors so the pool fits on the worker group; a hung converter is killed
inside a subprocess after timeout_seconds.
Run the full RAG pipeline
The compiled rag_multistep_pipeline has two independent chains:
parse_and_chunk→ingest_to_milvus(optionaldeploy_embedding_modelfirst)download_model→model_deployment
Leave deploy_embedding=false and embedding_endpoint="" to embed with a local
sentence-transformers model inside the ingest task. Set deploy_embedding=true
only when you want a dedicated embedding InferenceService.
Additional run inputs for the model chain:
ingest_to_milvus reads S3_ACCESS_KEY / S3_SECRET_KEY from the same
minio-secret. The LLM deploy step does not wait for ingest; both chains can
finish independently.
What Ray Data does inside the job
The entrypoint that parse_and_chunk injects into the RayJob is the Ray Data
pipeline:
DoclingChunkProcessor is a Ray actor. Each actor owns a subprocess that runs
DocumentConverter + HybridChunker and uploads JSONL. Timeouts restart that
subprocess so one stuck PDF does not kill the actor. This is the same pattern
the Workbench Docling guide points at for thousands of files; you do not write
this script yourself when you use the component.
A CPU-only smoke of that actor-pool shape (no Docling, no PDF PVC) is
assets/ray-data-pipelines/rayjob-smoke.yaml.
Troubleshooting
Next steps
- Use Reusable Kubeflow Pipeline Components — AutoGluon managed pipelines and how to import other mirror assets.
- Prepare Fine-Tuning Data with Docling and SDG Hub — interactive Docling before you need Ray Data.
- Optimize a RAG Application with AutoRAG Pipelines — search RAG settings instead of a fixed HybridChunker.
- CodeFlare SDK Tutorial — submit a RayJob from a notebook without KFP.