diff options
| author | Pjotr <wrk@bosa.lan> | 2026-11-14 16:32:31 +0000 |
|---|---|---|
| committer | pjotr <pjotr.public01@thebird.nl> | 2026-11-14 22:05:30 +0000 |
| commit | da2f10c0d61ff784eaaa6173ba334ad22667fe56 (patch) | |
| tree | 41ca45bffe11cd649bcd4ad37ed4e4b4c5a3f315 | |
| parent | d80efbbcde23b2839393557b25a3de41e985da7a (diff) | |
| download | gn-machines-da2f10c0d61ff784eaaa6173ba334ad22667fe56.tar.gz | |
gn4ai: gemma-wrapper in a directory of its own
gemma-wrapper was in the container's package list, which is wrong for the same reason a store path would be: it is an engine, not a tool for whoever ssh-es in, and the container profile then carries a version that can drift from the one the API actually runs. It now lives in a Guix profile of its own, on the shared gn4-container tree (gn4-container/gemma-wrapper), and gn4.env names that directory: GEMMA_WRAPPER_DIR .../gn4-container/gemma-wrapper/bin GEMMA_WRAPPER_CMD $GEMMA_WRAPPER_DIR/gemma-wrapper PATH $GEMMA_WRAPPER_DIR:/run/current-system/profile/bin:... A directory rather than one store path, because this is measured: with only the wrapper pinned, /compute/gemma answered 502 twice, first with Errno::ENOENT inside Open3.popen_run for `time -v gemma ...` and then, after GNU time was added, with "env: 'tar': No such file or directory". The wrapper shells out to its neighbours, so gemma, time, tar, parallel and xz are installed beside it. The profile is on the share (so it outlives the container) and pins its own closure (so a guix gc cannot take the engine away). The container definition uses the directory too -- the service sets GEMMA_WRAPPER_DIR and PATH from it -- so a half-written env file cannot leave the engine unfindable. With gemma-wrapper out of the package list, nothing in this file imports guix-bioinformatics any more; -L is needed only for (genenetwork services container-ssh). Verified in the running container: /compute/gemma 200 with 21 055 rows, /compute/bnw 200 with 30 edges, /groups/BXD 200, /version in 2 s, and gemma-wrapper absent from the system profile while the service still finds it.
| -rw-r--r-- | gn4ai.scm | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/gn4ai.scm b/gn4ai.scm index 78c6f1c..217308d 100644 --- a/gn4ai.scm +++ b/gn4ai.scm @@ -60,9 +60,6 @@ ;; The service's runtime: python for the plotters, gemma-wrapper (and gemma ;; behind it) for /compute/gemma, R and the R packages the scan scripts load. (use-package-modules base bash admin linux python cran statistics) -;; gemma-wrapper lives in (gn packages gemma) -- guix-bioinformatics, not the -;; guix channel -- which is why the build needs -L for that checkout. -(use-modules (gn packages gemma)) ;; The GN4 binary as built above and pinned by --root, so a `guix gc` cannot ;; take it away underneath the container. A store-sharing container: the OS @@ -75,6 +72,20 @@ (define %gn4-binary "/gnu/store/y0drkwyhib43sg8micrnhd227mmhp1mf-genenetwork4-git-0.1.0/bin/genenetwork4") +;; gemma-wrapper in a directory of its own -- a Guix profile on the shared +;; gn4-container tree -- rather than in the container's package profile: it is +;; an *engine*, not a tool for whoever ssh-es in, and gn4.env names this +;; directory in GEMMA_WRAPPER_DIR, so there is exactly one copy and one version +;; in play. A directory, not a single store path, because the wrapper shells +;; out to its neighbours: `time -v gemma ...` and `env tar ...` both failed +;; with just the wrapper pinned (measured: Errno::ENOENT inside +;; Open3.popen_run, then "env: 'tar': No such file or directory"), and the +;; profile puts gemma, time, tar, parallel and xz next to it on PATH. +;; The profile lives on the share so that it survives the container, and it +;; pins its own closure, so a `guix gc` cannot take the engine away. +(define %gemma-wrapper-dir + "/home/wrk/tmp/ai-root/factory/gn4-container/gemma-wrapper/bin") + (define %gn4-env-file "/home/wrk/tmp/ai-root/factory/gn4-container/gn4.env") @@ -101,6 +112,13 @@ (requirement '(user-processes)) (start #~(make-forkexec-constructor (list #$%gn4-start) + ;; The engine directory goes in front of PATH here as well as in + ;; gn4.env: the .scm owns where gemma-wrapper lives, so the + ;; service finds it even if the env file is only half written. + #:environment-variables + (list (string-append "GEMMA_WRAPPER_DIR=" #$%gemma-wrapper-dir) + (string-append "PATH=" #$%gemma-wrapper-dir + ":/run/current-system/profile/bin:/run/current-system/profile/sbin")) #:log-file #$%gn4-log-file)) (stop #~(make-kill-destructor)) ;; A crash should not leave the container "running" with a dead service; the @@ -129,9 +147,11 @@ ;; expects; 'herd' arrives with the shepherd service. (packages (list bash coreutils grep procps shadow python ; /plot/*, /compute/bulklmm, the gn-bnw driver - gemma-wrapper ; /compute/gemma: gemma-wrapper, and gemma behind it r ; Rscript: /compute/rqtl, /compute/qtl2, /compute/fitqtl r-qtl r-qtl2 r-optparse r-stringr r-stringi r-digest r-jsonlite)) + ;; gemma-wrapper is *not* here: it is pinned by %gemma-wrapper above and + ;; named by GEMMA_WRAPPER_CMD in gn4.env, so the container profile does not + ;; carry a second copy that could drift from the one the API uses. (services (append |
