feat(deploy): lab-grade deployment — pinned digests, lockfile, SBOM, offline mode, profiles, executed 500k–1M benchmarks - #30
Open
Zhang1178 wants to merge 1 commit into
Open
Conversation
…file, SBOM, offline mode, CPU/GPU profiles, Slurm reference profiles, executed 500k-1M cell benchmarks - container/apptainer.def: base image pinned by OCI digest (CI re-resolves and fails on drift); Python stack installed from container/requirements-lock.txt (208 packages, exact versions + wheel SHA-256 hashes via uv; pip hash-checking verifies wheels at install time — the offline supply-chain control); image %test runs the offline deployment gate - SBOM: container/sbom-python.json (CycloneDX 1.5, 209 components, exact locked versions) via generate_sbom.py --from-lockfile; CI regenerates inside the image and asserts component-level equality (drift fails build) - DEPLOYMENT_MANIFEST.json: single ledger for digests, lockfile/SBOM hashes, profiles, Slurm reference profiles, benchmark evidence + machine-class labels; consistency test-enforced - offline mode: BIONEXUS_OFFLINE=1 forces OFFLINE_STRICT egress regardless of other config and cannot be relaxed at runtime; bionexus offline-check gate + bionexus doctor --offline/--require-offline (fail-closed, no network requests); runs in image %test and Slurm profiles - CPU/GPU profiles: one SIF; CPU validated in CI, GPU via --nv with node-level CUDA assertion (honestly not CI-validated) - cluster/slurm/profiles/: hpc-cpu.sbatch, hpc-gpu.sbatch, run_scale_benchmark.sbatch (HPC reproduction path) - evals/scale_benchmark.py rework: memory-bounded by construction (chunked zero-inflated sparse generation at controlled density, in-place CPM/log1p, streaming HVG); Windows peak-memory reporting (psutil peak_wset / GetProcessMemoryInfo). Committed executed reports: 500k cells @ 8% density (278 s, 3.75 GB peak) and 1M cells @ 5% density (482 s, 4.13 GB peak) on an 8-core/8 GB node — honestly labeled small-node runs, not HPC numbers - tests/unit/test_lab_grade_deployment.py: 18 tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes lab-grade deployment after #26: the container/lockfile/SBOM/offline/profiles stack top-tier labs expect, plus really executed 500k and 1M cell scale benchmarks with committed reports — replacing the previous "harness only, cluster reference not runnable" state. Independent of #28.
Reproducible image (digest pin + lockfile)
container/apptainer.def: base image pinned by OCI digest —python:3.11-slim-bookworm@sha256:0bee7276f83efd4a1ee05bbbf4281d95ed28e079220a9457f25a93e3f1e3c31b(real digest resolved from Docker Hub, 2026-08-30). CI re-resolves the tag every build and fails on drift.container/requirements-lock.txt: 208 packages pinned to exact versions with wheel SHA-256 hashes (uv pip compile --python-version 3.11 --generate-hashes; command recorded in the manifest). pip hash-checking mode verifies every wheel at install — which is also the offline supply-chain control. Source tree installs with--no-deps -e .on top.SBOM
container/sbom-python.json: CycloneDX 1.5, 209 components, exact locked versions (scanpy 1.11.5, squidpy 1.8.2, torch 2.13.0, pydeseq2 0.5.4, …) viascripts/generate_sbom.py --from-lockfile(new mode; the old pyproject mode emitted placeholders).Deployment manifest
container/DEPLOYMENT_MANIFEST.json: single ledger — base digest, lockfile/SBOM SHA-256, CPU/GPU/offline profiles, Slurm reference profiles, benchmark evidence with machine-class labels, and an explicit evidence/adoption boundary. Digest consistency is test-enforced.Offline mode (air-gapped labs / HPC)
BIONEXUS_OFFLINE=1forcesOFFLINE_STRICTegress (zero hosted endpoints) regardless of any other configuration and cannot be relaxed at runtime (set_moderefuses).bionexus offline-check [--enforce]andbionexus doctor --offline / --require-offline(fail-closed, zero network requests; verifies replay eval provider + local zero-key MCP tools + policy-level endpoint refusal). Runs in the image%testand the Slurm profiles.CPU / GPU profiles
apptainer exec(CI-validated end to end) and GPUapptainer exec --nvwith a node-leveltorch.cuda.is_available()assertion — honestly documented as not CI-validatable (no GPU in CI).Slurm reference profiles (
cluster/slurm/profiles/)hpc-cpu.sbatch(doctor → offline gate → three-gate chain),hpc-gpu.sbatch(--nv+ CUDA evidence),run_scale_benchmark.sbatch(HPC reproduction of the committed evidence). Live-scheduler submission remains site adaptation — stated, not hidden.Scale benchmark: actually executed, honestly labeled
Reworked
evals/scale_benchmark.pyto be memory-bounded by construction (chunked zero-inflated sparse generation at controlled structural density, in-place CPM/log1p, streaming HVG) + Windows peak-memory reporting (psutilpeak_wset/ GetProcessMemoryInfo). The old harness's 500k-cell "cluster reference" was a ~78%-dense Poisson draw (~350 GB at the default 20k genes) — not runnable anywhere; this PR's committed evidence is.Committed executed reports (machine fingerprint, per-stage wall, peak memory + method, observed density):
scale_benchmark_30k_5g.jsonscale_benchmark_500k_5g.jsonscale_benchmark_1000k_5g.jsonHonesty: these are real runs of the committed harness, labeled as single small-node runs — not HPC numbers. The 500k–1M runs prove the pipeline is memory-feasible on commodity nodes; top-lab HPC evidence is produced by running
run_scale_benchmark.sbatchon the target cluster and committing the node's report (the harness records the machine fingerprint, so the report is the evidence).Test plan
tests/unit/test_lab_grade_deployment.py: 18 tests — offline enforcement/refusal/CLI gates, harness density + memory-method, manifest/lockfile/SBOM digest and component consistency, container digest pin, Slurm profile content.