Switch to AIPCC base image and enable fully hermetic builds#245
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #245 +/- ##
==========================================
+ Coverage 76.91% 86.02% +9.11%
==========================================
Files 200 250 +50
Lines 20473 25297 +4824
==========================================
+ Hits 15747 21762 +6015
+ Misses 4726 3535 -1191
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
@ckhordiasma for s390x, loading spacy models causing endianess issue. for that thinc package has to be build from source and have to patch the fix. @modassarrana89-new do you want to add something? |
There was a problem hiding this comment.
AIPCC base image seems to have a different naming convention for the certificates inside /etc/pki/tls i.e. they are called ca-certificates.crt but Python ssl library expects them to be called ca-bundle.crt
I think we may need a symlink in the Dockerfile.konflux
daba7db to
a6fbf5e
Compare
|
removed s390x as a build target due to endianness issue in upstream thinc package. Awaiting explosion/thinc#970 |
|
@ckhordiasma Can you switch index-url to https://console.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9/simple/ in requirements.txt as for thinc package for s390x, it works well https://console.redhat.com/api/pypi/public-rhai/rhoai/3.5/cpu-ubi9/simple/thinc/ |
9523209 to
03bb333
Compare
|
/retest |
ef5d166 to
5e7938e
Compare
Replace the multi-stage UBI9 source-build approach with AIPCC prebuilt base images. This eliminates ppc64le/s390x source builds for PyTorch and OpenBLAS, RPM-based toolchain installs, and architecture-specific wheel compilation by using prebuilt AIPCC wheels for all architectures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add model lockfile generation and prefetch setup so Dockerfile.konflux builds can run fully offline (hermetic). Update the Tekton PR pipeline to enable hermetic builds with pip prefetch for all architectures including s390x. - scripts/generate_model_lockfile.py: generates artifacts.lock.yaml from HuggingFace model repos - scripts/setup_prefetched_models.sh: sets up prefetched models from Konflux artifact cache - requirements-models.txt: model download dependencies - Tekton pipeline: enable hermetic=true, pip prefetch, s390x target Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Recompile requirements.txt using uv pip compile with the AIPCC 3.5 cpu-ubi9 index as the sole package source. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5e7938e to
33601e5
Compare
Signed-off-by: Christopher Kodama <ckodama@redhat.com>
513cba0
into
red-hat-data-services:main
https://redhat.atlassian.net/browse/RHOAIENG-47507
Summary
Dockerfile.konfluxfrom UBI9 python-312 to AIPCC CPU base image (quay.io/aipcc/base-images/cpu:3.5.0-ea.1) with pre-installed system libraries and pre-configured Python indexrequirements.txtagainst the AIPCC index usinguv pip compilewith--default-index,--prerelease=if-necessary, and--no-strip-markersfor multi-arch compatibilityrequirements-build.txtgenerated viapip-compile --build-deps-for=wheel --only-build-depsfor the poetry-core build backendpre_download_required_models.pynetwork download with prefetched artifacts via the Konflux generic fetcher, enabling full--network nonebuildshermetic: truein the PR pipelineHermetic model prefetch
The previous approach downloaded ML models from HuggingFace/GitHub at build time, which was the last network dependency blocking hermetic builds. This PR replaces it with:
artifacts.lock.yaml— generic fetcher lockfile with download URLs and checksums for all model files, generated byscripts/generate_model_lockfile.pyscripts/setup_prefetched_models.sh— reconstructs HF cache directory structures from the flat prefetched files during Docker buildrequirements-models.txt— spacyen-core-web-lgmodel as a pip URL dependency (handled by the pip prefetcher)Models prefetched:
sentence-transformers/all-MiniLM-L6-v2qdrant/all-MiniLM-L6-v2-onnxen-core-web-lg3.8.0punktTo regenerate the lockfile when models change:
Multi-arch verification
Hermetic builds (
--network none) tested and model loading validated on all four target architectures:Key decisions
hermetic: true— all dependencies (pip wheels, spacy model, HuggingFace models, NLTK data) are now prefetched. No network access needed during build.artifacts.lock.yamlwith SHA256 checksums. The setup script reconstructs the HF Hub cache structure (models--org--repo/snapshots/{commit}/) at build time.requirements-models.txt— the spacy model URL dependency includes a--hash, which triggers pip's--require-hashesmode. Installing it separately prevents hash-mode from propagating to the mainrequirements.txt.generate_model_lockfile.pyandsetup_prefetched_models.shacceptGUARDRAILS_PROFILEand fail with a clear error for unsupported profiles (onlyopensourceis implemented).--prerelease=if-necessaryinstead of--prerelease=allow— avoids picking RC versions that may lack wheels on some architectures--no-strip-markers— preserves platform markers so arch-specific deps liketritonare skipped where not neededTest plan
🤖 Generated with Claude Code