about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPjotr Prins <pjotr.public01@thebird.nl>2026-11-22 10:53:07 +0000
committerPjotr Prins <pjotr.public01@thebird.nl>2026-11-22 10:53:07 +0000
commitca32dd4c8c64f8fa5ed18b30fe2594dbe9f5ad98 (patch)
treed30e44fba06f4bae6716a054846e867c9e2c0097 /src
parent58de629953a75daad50daca795465784d37c7359 (diff)
downloadgenenetwork4-ca32dd4c8c64f8fa5ed18b30fe2594dbe9f5ad98.tar.gz
gemma: the store step runs gemma-wrapper's geno2mdb binary, not python
The converter became an Odin binary in gemma-wrapper e244f99 and is packaged in
guix-bioinformatics (built in the package, installed as bin/geno2mdb). This
switches the store workflow to it: no interpreter, no python-lmdb, no
PYTHONPATH in the job, which is what the python version cost this deployment
twice -- a hand-exported PYTHONPATH on the API host and three python packages
in the artifact manifest.

Three things had to change, each of them measured:

- `store.scm` runs `#:run "geno2mdb"` and no longer takes the script as a File
  input. ccwl appends every declared input to the command line, so a staged copy
  of the binary arrived as argv[1] and geno2mdb read its own ELF header as the
  BIMBAM file ("16 genotypes, expected 14, line 1").
- the server stops supplying `store_script`; the pre-flight input check named
  the disagreement, as designed.
- artifact runs keep GUIX_PACKAGE_PATH set. Clearing it saved ~4 s of Guile per
  run, but the artifact manifest now names gemma-wrapper, which only exists in
  the channel: cleared, the job died with "gemma-wrapper: unknown package"
  before reading a marker. Correctness over four seconds, and the artifact memo
  means most requests never pay it.

Verified on a cold artifact path (BXD.8, impute=mean, engine=pangemma):
artifacts built in 19,263 ms, 41 cluster jobs (prepare + store + 19 kinship + 20
gwa), workflow 14,793 ms, 21,056 rows. The packaged binary was earlier checked
to produce a store identical to bin/geno2mdb.py's, on BXD.8 and on the 3.9 GB
HSNIH-Palmer_true panel.
Diffstat (limited to 'src')
-rw-r--r--src/gemma.rs22
-rw-r--r--src/routes/gemma.rs12
2 files changed, 17 insertions, 17 deletions
diff --git a/src/gemma.rs b/src/gemma.rs
index 2188530..58d1d53 100644
--- a/src/gemma.rs
+++ b/src/gemma.rs
@@ -1738,18 +1738,16 @@ pub async fn run_artifact(
     ];
     let batch_args = run.batch.ravanan_args(scratch);
     args.extend(batch_args.iter().map(String::as_str));
-    // With GUIX_PACKAGE_PATH cleared: these manifests name only `(gnu
-    // packages)` specs (bash, gawk, R/qtl2, python), and leaving the channel
-    // path set makes guix autoload guix-bioinformatics' module tree for every
-    // invocation -- an ABI mismatch warning per module and about four seconds
-    // of Guile per ravanan call (measured: 12.0 s with, 7.9 s without).
-    let output = streaming::run_streaming_with_env(
-        run.ravanan_cmd,
-        &args,
-        None,
-        &[("GUIX_PACKAGE_PATH", "")],
-    )
-    .await
+    // GUIX_PACKAGE_PATH stays set.  Clearing it saves ~4 s of Guile per
+    // artifact call (guix autoloads guix-bioinformatics' module tree, one ABI
+    // mismatch warning per module) -- but a manifest may name a package that
+    // only exists in the channel, which is exactly what happened when the store
+    // step moved to gemma-wrapper's geno2mdb: with the variable cleared the
+    // job died with "gemma-wrapper: unknown package" before a single marker was
+    // read.  Correctness over four seconds, and the artifact memo means most
+    // requests never pay it at all.
+    let output = streaming::run_streaming(run.ravanan_cmd, &args, None)
+        .await
     .map_err(|error| GemmaError::Spawn {
         command: run.ravanan_cmd.to_string(),
         error,
diff --git a/src/routes/gemma.rs b/src/routes/gemma.rs
index 548c464..96a0fb2 100644
--- a/src/routes/gemma.rs
+++ b/src/routes/gemma.rs
@@ -614,11 +614,13 @@ async fn ravanan_artifacts(
                     .unwrap_or_default(),
             )
         } else {
+        // No converter script: geno2mdb comes from the job's profile
+        // (gemma-wrapper's bin/geno2mdb, an Odin binary), and ccwl appends
+        // every declared input to the command line -- a staged copy of the
+        // binary arrived as argv[1] and was read as the BIMBAM file.
         let inputs = format!(
-            "store_script: {{class: File, path: {}}}\n\
-             genotype_file: {{class: File, path: {genotype_file}}}\n\
-             snps_file: {{class: File, path: {snps_file}}}\n",
-            absolute(&config.geno2mdb_cmd),
+            "genotype_file: {{class: File, path: {genotype_file}}}\n\
+             snps_file: {{class: File, path: {snps_file}}}\n"
         );
         let run = gemma::ArtifactWorkflow {
             label: "store",
@@ -632,7 +634,7 @@ async fn ravanan_artifacts(
         };
         let outputs = gemma::run_artifact(
             &run,
-            &["store_script", "genotype_file", "snps_file"],
+            &["genotype_file", "snps_file"],
             &inputs,
             &["store"],
         )