Batch processing with Kueue
An end-of-day delivery reconciliation per carrier, run as three Kubernetes Jobs admitted by Kueue, with a failed partition replayed alone and a low-priority run preempted by a high-priority one.
examples/ai-batch-processing-with-kueue/ reconciles the scheduled and delivered shipment events of a time window per carrier. It accompanies Appendix I.
A Quarkus and Camel batch-runner keeps the state of each run in PostgreSQL and creates the Job for each step. A Quarkus command-mode batch-worker image runs the three steps: plan, reconcile and aggregate. Kueue is installed and removed by verify.sh itself.
examples/_k8s/cluster.sh up
cd examples/ai-batch-processing-with-kueue
./verify.sh
What to observe
- A run in three Jobs. The
reconcileJob is Indexed with three pods, one per partition, and the totals per carrier equal the in-window counts. - A retried and a poisoned partition. A transient fault gives one index a second pod; exit 42 fails only that index and leaves
completedIndexesat0,2. - A replay. The finished partitions keep their completion time and only the failed one is read.
- Two runs, one quota. The second
reconcileWorkload waits with the reasonWaitingForQuotaand its Job has no pods. - Preemption. A high-priority run evicts a low-priority one, which resumes with only its missing index.
Infrastructure
Strimzi, Kafka, CloudNativePG and the observability stack from examples/_k8s on the edp minikube profile, Kueue v0.20.6, the runner on NodePort 30080, and a producer Job that writes the input.