Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .tekton/rag-tool-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ spec:
],
"requirements_build_files": ["requirements-build.txt"],
"binary": {
"packages": "aiohappyeyeballs,aiohttp,aiosignal,annotated-doc,annotated-types,antlr4-python3-runtime,asyncpg,beautifulsoup4,cffi,colorama,cryptography,dataclasses-json,defusedxml,deprecated,dill,distro,docling-parse,einops,et-xmlfile,faiss-cpu,filetype,fire,frozenlist,greenlet,h11,hf-xet,httpcore,httpx,httpx-sse,idna,importlib-metadata,jinja2,joblib,jsonlines,jsonref,jsonschema,jsonschema-specifications,lxml,markdown-it-py,marko,markupsafe,marshmallow,mdurl,mpire,mpmath,multidict,mypy-extensions,nest-asyncio,networkx,numpy,omegaconf,openpyxl,packaging,pandas,pillow,pluggy,prompt-toolkit,propcache,psycopg2-binary,pycparser,pydantic,pydantic-core,pylatexenc,pypdfium2,python-dateutil,python-docx,python-pptx,pyyaml,referencing,rpds-py,rtree,safetensors,scikit-learn,scipy,setuptools,shapely,shellingham,six,sniffio,sympy,termcolor,threadpoolctl,tiktoken,tomlkit,torchvision,tqdm,transformers,tree-sitter,tree-sitter-c,tree-sitter-javascript,tree-sitter-python,tree-sitter-typescript,triton,typing-extensions,typing-inspect,typing-inspection,urllib3,xlsxwriter,zipp,uv-build,uv,pip,maturin,jiter,opencv-python,rapidocr,tokenizers,torch",
"packages": "accelerate,aiohappyeyeballs,aiohttp,aiosignal,aiosqlite,annotated-doc,annotated-types,antlr4-python3-runtime,anyio,asyncpg,attrs,banks,beautifulsoup4,certifi,cffi,chardet,charset-normalizer,circuitbreaker,click,colorama,colorlog,cryptography,dataclasses-json,defusedxml,deprecated,dill,dirtyjson,distro,docling-ibm-models,docling-parse,einops,et-xmlfile,faiss-cpu,filetype,fire,frozenlist,fsspec,googleapis-common-protos,greenlet,griffe,griffecli,griffelib,h11,hf-xet,httpcore,httpx,httpx-sse,importlib-metadata,jinja2,jiter,joblib,jsonlines,jsonref,jsonschema,jsonschema-specifications,latex2mathml,llama-index-embeddings-openai,llama-index-instrumentation,llama-index-llms-openai,llama-index-workflows,llama-stack,llama-stack-client,markdown-it-py,marko,markupsafe,marshmallow,mcp,mdurl,mpire,mpmath,multidict,mypy-extensions,nest-asyncio,networkx,nltk,numpy,omegaconf,opencv-python,openpyxl,opentelemetry-api,opentelemetry-exporter-otlp-proto-common,opentelemetry-exporter-otlp-proto-http,opentelemetry-proto,opentelemetry-sdk,opentelemetry-semantic-conventions,oracledb,packaging,pandas,pgvector,pillow,platformdirs,pluggy,polyfactory,prompt-toolkit,propcache,protobuf,psutil,pyaml,pycparser,pygments,pyjwt,pylatexenc,pyopenssl,pypdf,pypdfium2,python-dateutil,python-docx,python-dotenv,python-multipart,python-pptx,pytz,pyyaml,referencing,regex,requests,rich,rpds-py,rtree,safetensors,scikit-learn,scipy,semchunk,setuptools,shapely,shellingham,six,sniffio,soupsieve,sqlalchemy,sse-starlette,starlette,striprtf,sympy,tabulate,tenacity,termcolor,threadpoolctl,tiktoken,tinytag,tokenizers,tomlkit,torch,torchvision,tornado,tqdm,transformers,tree-sitter,tree-sitter-c,tree-sitter-javascript,tree-sitter-python,tree-sitter-typescript,triton,typer,typing-extensions,typing-inspect,typing-inspection,tzdata,urllib3,wcwidth,websockets,wrapt,xlsxwriter,yarl,zipp,uv-build,uv,pip,maturin,psycopg2-binary,rapidocr",
"os": "linux",
"arch": "x86_64,aarch64",
"py_version": 312
Expand Down Expand Up @@ -220,7 +220,7 @@ spec:
- name: name
value: prefetch-dependencies-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies-oci-ta:0.3@sha256:9917d11f0a38c844184042d504b3d5605c009e6e43785fa113caae8b4c99b75e
value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies-oci-ta:0.3@sha256:dca9728e1ba9eb1bf6419bc800f082d13f054a3db8b345af0b188ce3ee6246dd
- name: kind
value: task
resolver: bundles
Expand Down
4 changes: 2 additions & 2 deletions .tekton/rag-tool-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
],
"requirements_build_files": ["requirements-build.txt"],
"binary": {
"packages": "aiohappyeyeballs,aiohttp,aiosignal,annotated-doc,annotated-types,antlr4-python3-runtime,asyncpg,beautifulsoup4,cffi,colorama,cryptography,dataclasses-json,defusedxml,deprecated,dill,distro,docling-parse,einops,et-xmlfile,faiss-cpu,filetype,fire,frozenlist,greenlet,h11,hf-xet,httpcore,httpx,httpx-sse,idna,importlib-metadata,jinja2,joblib,jsonlines,jsonref,jsonschema,jsonschema-specifications,lxml,markdown-it-py,marko,markupsafe,marshmallow,mdurl,mpire,mpmath,multidict,mypy-extensions,nest-asyncio,networkx,numpy,omegaconf,openpyxl,packaging,pandas,pillow,pluggy,prompt-toolkit,propcache,psycopg2-binary,pycparser,pydantic,pydantic-core,pylatexenc,pypdfium2,python-dateutil,python-docx,python-pptx,pyyaml,referencing,rpds-py,rtree,safetensors,scikit-learn,scipy,setuptools,shapely,shellingham,six,sniffio,sympy,termcolor,threadpoolctl,tiktoken,tomlkit,torchvision,tqdm,transformers,tree-sitter,tree-sitter-c,tree-sitter-javascript,tree-sitter-python,tree-sitter-typescript,triton,typing-extensions,typing-inspect,typing-inspection,urllib3,xlsxwriter,zipp,uv-build,uv,pip,maturin,jiter,opencv-python,rapidocr,tokenizers,torch",
"packages": "accelerate,aiohappyeyeballs,aiohttp,aiosignal,aiosqlite,annotated-doc,annotated-types,antlr4-python3-runtime,anyio,asyncpg,attrs,banks,beautifulsoup4,certifi,cffi,chardet,charset-normalizer,circuitbreaker,click,colorama,colorlog,cryptography,dataclasses-json,defusedxml,deprecated,dill,dirtyjson,distro,docling-ibm-models,docling-parse,einops,et-xmlfile,faiss-cpu,filetype,fire,frozenlist,fsspec,googleapis-common-protos,greenlet,griffe,griffecli,griffelib,h11,hf-xet,httpcore,httpx,httpx-sse,importlib-metadata,jinja2,jiter,joblib,jsonlines,jsonref,jsonschema,jsonschema-specifications,latex2mathml,llama-index-embeddings-openai,llama-index-instrumentation,llama-index-llms-openai,llama-index-workflows,llama-stack,llama-stack-client,markdown-it-py,marko,markupsafe,marshmallow,mcp,mdurl,mpire,mpmath,multidict,mypy-extensions,nest-asyncio,networkx,nltk,numpy,omegaconf,opencv-python,openpyxl,opentelemetry-api,opentelemetry-exporter-otlp-proto-common,opentelemetry-exporter-otlp-proto-http,opentelemetry-proto,opentelemetry-sdk,opentelemetry-semantic-conventions,oracledb,packaging,pandas,pgvector,pillow,platformdirs,pluggy,polyfactory,prompt-toolkit,propcache,protobuf,psutil,pyaml,pycparser,pygments,pyjwt,pylatexenc,pyopenssl,pypdf,pypdfium2,python-dateutil,python-docx,python-dotenv,python-multipart,python-pptx,pytz,pyyaml,referencing,regex,requests,rich,rpds-py,rtree,safetensors,scikit-learn,scipy,semchunk,setuptools,shapely,shellingham,six,sniffio,soupsieve,sqlalchemy,sse-starlette,starlette,striprtf,sympy,tabulate,tenacity,termcolor,threadpoolctl,tiktoken,tinytag,tokenizers,tomlkit,torch,torchvision,tornado,tqdm,transformers,tree-sitter,tree-sitter-c,tree-sitter-javascript,tree-sitter-python,tree-sitter-typescript,triton,typer,typing-extensions,typing-inspect,typing-inspection,tzdata,urllib3,wcwidth,websockets,wrapt,xlsxwriter,yarl,zipp,uv-build,uv,pip,maturin,psycopg2-binary,rapidocr",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, locate and examine the two YAML files
find . -name "rag-tool-push.yaml" -o -name "rag-tool-pull-request.yaml" | head -20

Repository: lightspeed-core/rag-content

Length of output: 136


🏁 Script executed:

# Search for wheel hash requirements files
find . -name "*requirements*" -o -name "*wheel*" | grep -E "\.(txt|lock)$" | head -20

Repository: lightspeed-core/rag-content

Length of output: 626


🏁 Script executed:

# Check if llama-stack-api appears in the YAML files
rg "llama-stack-api" .tekton/ 2>/dev/null || echo "No matches found"

Repository: lightspeed-core/rag-content

Length of output: 87


🏁 Script executed:

# Get the full content of rag-tool-push.yaml to verify line 64
cat .tekton/rag-tool-push.yaml | head -80

Repository: lightspeed-core/rag-content

Length of output: 4671


🏁 Script executed:

# Check all requirements files for llama-stack-api
rg "llama-stack-api" ./requirements*.txt 2>/dev/null || echo "No matches in requirements files"

Repository: lightspeed-core/rag-content

Length of output: 397


🏁 Script executed:

# Check the pull-request YAML for comparison
cat .tekton/rag-tool-pull-request.yaml | grep -A 5 "llama-stack"

Repository: lightspeed-core/rag-content

Length of output: 2128


🏁 Script executed:

# Extract the packages line from pull-request YAML to see if it has llama-stack-api
cat .tekton/rag-tool-pull-request.yaml | sed -n '50,80p'

Repository: lightspeed-core/rag-content

Length of output: 2835


🏁 Script executed:

# Extract and compare the packages lists from both YAML files
echo "=== PUSH YAML packages ===" && \
cat .tekton/rag-tool-push.yaml | sed -n '64p' | grep -o '"packages": "[^"]*"' | cut -d'"' -f4 | tr ',' '\n' | grep llama && \
echo "=== PULL-REQUEST YAML packages ===" && \
cat .tekton/rag-tool-pull-request.yaml | grep -o '"packages": "[^"]*"' | cut -d'"' -f4 | tr ',' '\n' | grep llama

Repository: lightspeed-core/rag-content

Length of output: 402


🏁 Script executed:

# Verify that llama-stack-api is in source requirements files
grep -l "llama-stack-api" ./requirements.hashes.source*.txt

Repository: lightspeed-core/rag-content

Length of output: 141


Add llama-stack-api to the binary packages allowlist.

Both .tekton/rag-tool-push.yaml and .tekton/rag-tool-pull-request.yaml use identical package allowlists that include llama-stack and llama-stack-client but omit llama-stack-api. However, llama-stack-api==0.5.0 appears in requirements.hashes.source.txt and requirements.hashes.source.cuda.txt. Add it to the binary.packages list to maintain consistency with requirements files across both pipeline configurations.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.tekton/rag-tool-push.yaml at line 64, The binary.packages allowlist is
missing "llama-stack-api" while "llama-stack" and "llama-stack-client" are
present and requirements include llama-stack-api==0.5.0; update the "packages"
comma-separated string in the binary.packages entry (the same list shown in the
diff) to include "llama-stack-api" and apply the same change in the peer
pipeline config that has an identical allowlist (the other .tekton rag-tool
file), ensuring the package name is added exactly as "llama-stack-api".

"os": "linux",
"arch": "x86_64,aarch64",
"py_version": 312
Expand Down Expand Up @@ -216,7 +216,7 @@ spec:
- name: name
value: prefetch-dependencies-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies-oci-ta:0.3@sha256:9917d11f0a38c844184042d504b3d5605c009e6e43785fa113caae8b4c99b75e
value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies-oci-ta:0.3@sha256:dca9728e1ba9eb1bf6419bc800f082d13f054a3db8b345af0b188ce3ee6246dd
- name: kind
value: task
resolver: bundles
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,9 @@ The CUDA image uses the same layout as the CPU `Containerfile` but with a CUDA b

#### aarch64 and PyTorch CUDA

On **aarch64 (ARM64)**, PyPI only distributes **CPU-only** wheels for `torch`. CUDA aarch64 wheels are available from (1) [RHOAI](https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.3/cuda12.9-ubi9/simple/torch/) (torch 2.9.0-13 for cuda12.9-ubi9) and (2) [PyTorch’s index](https://download.pytorch.org/whl/cu128/). If the image is built using only PyPI (e.g. from the base + aarch64 requirement files without an override), `nvidia-smi` can see the GPU but `torch.cuda.is_available()` is `False` because the installed PyTorch is the CPU build.
On **aarch64 (ARM64)**, PyPI only distributes **CPU-only** wheels for `torch`. CUDA aarch64 wheels are available from (1) [RHOAI](https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.4/cuda12.9-ubi9/simple/torch/) (torch 2.9.0-13 for cuda12.9-ubi9) and (2) [PyTorch’s index](https://download.pytorch.org/whl/cu128/). If the image is built using only PyPI (e.g. from the base + aarch64 requirement files without an override), `nvidia-smi` can see the GPU but `torch.cuda.is_available()` is `False` because the installed PyTorch is the CPU build.

**Fix (hermetic build):** The script `scripts/konflux_requirements_cuda.sh` appends to `requirements.hashes.wheel.pypi.cuda.aarch64.txt` direct wheel URLs for **torch** and **torchvision** from the [RHOAI cuda12.9-ubi9 index](https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.3/cuda12.9-ubi9/simple/) (already prefetched; package list at that URL). No extra prefetch source is needed. After regenerating with `make konflux-requirements-cuda` and rebuilding, `torch.cuda.is_available()` should be `True` on aarch64.
**Fix (hermetic build):** The script `scripts/konflux_requirements_cuda.sh` appends to `requirements.hashes.wheel.pypi.cuda.aarch64.txt` direct wheel URLs for **torch** and **torchvision** from the [RHOAI cuda12.9-ubi9 index](https://packages.redhat.com/api/pypi/public-rhai/rhoai/3.4/cuda12.9-ubi9/simple/) (already prefetched; package list at that URL). No extra prefetch source is needed. After regenerating with `make konflux-requirements-cuda` and rebuilding, `torch.cuda.is_available()` should be `True` on aarch64.

**RHOAI torch dependencies (single policy):** Hermetic builds install **`torch` from RHOAI pulp**, not from PyPI CUDA. The **dependency contract** is whatever that wheel declares in its package metadata (`Requires-Dist`), not PyPI’s CUDA `torch` graph (the same METADATA field pip uses). That metadata includes runtime deps such as `filelock`, `sympy`, `fsspec`, **`triton==3.5.0`**, etc., and **does not** list the **`nvidia-*` cu12** wheels that PyPI’s CUDA `torch` pulls in. So the project **does not** install those `nvidia-*` pip packages to “satisfy RHOAI torch”—they are not declared on the RHOAI wheel. **Triton** (and any other companion that RHOAI publishes as its own wheel) should be installed from **RHOAI indices** (e.g. **cpu-ubi9** for `triton`), alongside **`torch` / `torchvision`**, as wired in `konflux_requirements_cuda.sh`. Other shared libraries come from the **container** (CUDA base image and `dnf` packages in `Containerfile-cuda`).

Expand Down
2 changes: 1 addition & 1 deletion build-args-konflux.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
BASE_IMAGE=registry.redhat.io/rhai/base-image-cpu-rhel9:3.3
BASE_IMAGE=registry.redhat.io/rhai-early-access/base-image-cpu-rhel9:3.4.0-ea.2-1775076373
DNF_COMMAND=dnf
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dependencies = [
"hf-xet>=1.2.0",
"einops>=0.8.1",
# For HTML to Markdown conversion in BYOK workflows
"docling>=2.68.0,<2.73.0",
"docling>=2.68.0",
"python-frontmatter>=1.1.0",
"certifi>=2025.10.5",
]
Expand Down
117 changes: 12 additions & 105 deletions requirements-build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,88 +8,41 @@ calver==2025.10.20
# via trove-classifiers
cython==3.2.4
# via
# oracledb
# lxml
# pyclipper
# sqlalchemy
dunamai==1.26.1
# via uv-dynamic-versioning
expandvars==1.1.2
# via yarl
flit-core==3.12.0
# via
# aiosqlite
# click
# jinja2
# idna
# packaging
# pathspec
# pypdf
# tinytag
# wheel
hatch-fancy-pypi-readme==25.1.0
# via
# attrs
# llama-stack-client
# openai
# pydantic
hatch-vcs==0.5.0
# via
# attrs
# chardet
# filelock
# fsspec
# platformdirs
# via filelock
hatchling==1.26.3
# via
# hatch-fancy-pypi-readme
# llama-stack-client
# openai
hatchling==1.29.0
# via
# attrs
# banks
# chardet
# expandvars
# filelock
# fsspec
# griffe
# griffecli
# griffelib
# hatch-fancy-pypi-readme
# hatch-vcs
Comment on lines 23 to 33
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Detect duplicate pinned package names in requirements-build.txt.
set -euo pipefail

python - <<'PY'
import re
from collections import defaultdict

fname = "requirements-build.txt"
pat = re.compile(r'^([A-Za-z0-9_.-]+)==([^\s]+)')
seen = defaultdict(list)

with open(fname, encoding="utf-8") as f:
    for i, line in enumerate(f, 1):
        m = pat.match(line.strip())
        if m:
            seen[m.group(1).lower()].append((i, m.group(2)))

dups = {k:v for k,v in seen.items() if len(v) > 1}
if not dups:
    print("No duplicate pinned package names found.")
else:
    print("Duplicate pinned package names:")
    for pkg, rows in sorted(dups.items()):
        print(f"- {pkg}: " + ", ".join([f'line {ln} -> {ver}' for ln, ver in rows]))
PY

Repository: lightspeed-core/rag-content

Length of output: 203


🏁 Script executed:

cat -n requirements-build.txt | head -90

Repository: lightspeed-core/rag-content

Length of output: 2561


Fix conflicting duplicate package pins in auto-generated build requirements.

This auto-generated file contains multiple unpinned versions of the same packages (hatchling at lines 25 and 29, setuptools at lines 79 and 81). pip-compile should not produce this output. The duplicates indicate unresolved dependency conflicts in your source specification. When pip installs this file, it uses only the last occurrence of each package, silently dropping the others, making the resolution non-deterministic and hiding the underlying constraint conflict.

Fix by resolving the conflicting requirements in your source dependency file (requirements.source.txt.build).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@requirements-build.txt` around lines 23 - 33, The build requirements file
contains conflicting duplicate pins (e.g., hatchling and setuptools) produced by
pip-compile; fix this by resolving the source dependency conflicts in your
requirements.source.txt.build—identify where hatchling and setuptools are
required with different versions (direct or transitive), choose a single
compatible version (or add an explicit constraint/compatibility marker) in
requirements.source.txt.build, then re-run pip-compile to regenerate
requirements-build.txt so it contains a single pinned entry per package.

# latex2mathml
# llama-index
# llama-index-core
# llama-index-embeddings-huggingface
# llama-index-embeddings-openai
# llama-index-instrumentation
# llama-index-llms-openai
# llama-index-readers-file
# llama-index-vector-stores-faiss
# llama-index-vector-stores-postgres
# mcp
# opentelemetry-api
# opentelemetry-exporter-otlp-proto-common
# opentelemetry-exporter-otlp-proto-http
# opentelemetry-proto
# opentelemetry-sdk
# opentelemetry-semantic-conventions
# platformdirs
# polyfactory
# pydantic
# pydantic-settings
# pygments
# python-multipart
# semchunk
# soupsieve
# starlette
# uv-dynamic-versioning
# uvicorn
# wcwidth
jinja2==3.1.6
# via uv-dynamic-versioning
markupsafe==3.0.3
# via jinja2
maturin==1.10.2
# via uv-build
packaging==26.0
# via pydantic-core
packaging==26.1
# via
# hatchling
# setuptools-scm
Expand All @@ -98,91 +51,45 @@ packaging==26.0
pathspec==1.0.4
# via hatchling
pdm-backend==2.4.8
# via
# fastapi
# griffe
# griffecli
# griffelib
# typer
# via fastapi
pluggy==1.6.0
# via hatchling
poetry-core==2.3.2
# via
# dunamai
# rich
# tomlkit
semantic-version==2.10.0
# via setuptools-rust
setuptools-rust==1.12.1
# via maturin
setuptools-scm==10.0.5
# via
# anyio
# hatch-vcs
# llama-stack
# llama-stack-api
# pluggy
# pyclipper
# setuptools-rust
# tabulate
# tenacity
tomlkit==0.14.0
# via uv-dynamic-versioning
trove-classifiers==2026.1.14.14
# via hatchling
uv-build==0.9.30
# via llama-index-workflows
uv-dynamic-versioning==0.14.0
# via
# griffe
# griffecli
# griffelib
# mcp
vcs-versioning==1.1.1
# via setuptools-scm
wheel==0.46.3
# via
# oracledb
# oci
# pyclipper
# sentence-transformers
# tornado
# tzdata
# wrapt

# The following packages are considered to be unsafe in a requirements file:
setuptools==78.1.1
# via oci
setuptools==82.0.1
# via
# anyio
# calver
# certifi
# charset-normalizer
# colorlog
# googleapis-common-protos
# llama-stack
# llama-stack-api
# markupsafe
# lxml
# maturin
# multiprocess
# oracledb
# pathspec
# pgvector
# pluggy
# psutil
# pyclipper
# pyjwt
# python-dotenv
# regex
# requests
# sentence-transformers
# setuptools-rust
# setuptools-scm
# sqlalchemy
# sse-starlette
# tabulate
# tenacity
# tornado
# trove-classifiers
# tzdata
# vcs-versioning
# wrapt
# yarl
Loading
Loading