Switch to AIPCC base image and enable fully hermetic builds#245
Switch to AIPCC base image and enable fully hermetic builds#245ckhordiasma wants to merge 17 commits into
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #245 +/- ##
=======================================
Coverage 76.91% 76.91%
=======================================
Files 200 200
Lines 20473 20473
=======================================
Hits 15747 15747
Misses 4726 4726
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/ |
Replace the UBI9 + source-build approach with AIPCC base images for both build and runtime stages. This eliminates ppc64le/s390x source builds, RPM-based toolchain installs, and separate torch requirements by using prebuilt AIPCC wheels for all architectures. - Rewrite Dockerfile.konflux from Dockerfile.server using quay.io/aipcc/base-images/cpu:3.5.0-ea.1 - Recompile requirements.txt against AIPCC 3.5-EA1 CPU index - Add requirements-build.txt for poetry-core build backend Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use --prerelease=if-necessary instead of --prerelease=allow to avoid RC versions with incomplete arch coverage (safetensors 0.8.0rc0 → 0.7.0) - Use --no-strip-markers to preserve platform markers (triton excluded on s390x via platform_machine marker) - Use --default-index instead of --index for correct --emit-index-url output Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace generic prefetch placeholder with pip config pointing at AIPCC requirements and build requirements files - Add linux/s390x to build-platforms - Keep hermetic: false (model download step needs network) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Generated with `uv run --with pip-tools pip-compile` using --build-deps-for=wheel --only-build-deps to extract build backend requirements from pyproject.toml, replacing hand-maintained file. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the runtime model download step (pre_download_required_models.py) with prefetched artifacts via the Konflux generic fetcher, enabling full hermetic builds with --network none. - Add scripts/generate_model_lockfile.py to discover required models and generate artifacts.lock.yaml with HuggingFace download URLs + checksums - Add scripts/setup_prefetched_models.sh to reconstruct HF cache directories from prefetched generic artifacts during Docker build - Add requirements-models.txt for spacy en-core-web-lg model (pip prefetch) - Update hermeto.json with generic fetcher entry - Update Dockerfile.konflux to use setup script instead of Python downloader Models prefetched: sentence-transformers/all-MiniLM-L6-v2 (PyTorch), qdrant/all-MiniLM-L6-v2-onnx (FastEmbed ONNX), en-core-web-lg (SpaCy), punkt (NLTK). Validated on x86_64, aarch64, ppc64le, and s390x. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove hermeto.json (local testing only) and inline the prefetch config into the PR pipeline's prefetch-input parameter. Adds the generic fetcher entry for model artifacts and requirements-models.txt for the spacy model. Sets hermetic: true now that all four architectures have been validated with --network none. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
left requirements-build on EA1 because poetry-core doesn't appear to be on EA2 yet
This reverts commit d560b15.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
due to endianness issue in thinc package
This reverts commit a6fbf5e.
67fd39d to
9523209
Compare
9523209 to
03bb333
Compare
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