| Age | Commit message (Collapse) | Author |
|
The page said a human issues tokens and to "stop and ask", without
saying whose door to knock on -- and the operator commands belong in the
operator file anyway. State it as the GeneNetwork team, with wording the
assistant can relay to its user: what a token is for, how long the
default lasts, and to pass it out of band rather than through a public
issue or a shared chat. Same wording for renewal, since a 401 is the one
failure the assistant cannot fix itself.
* docs/www/ai-instruction.md (1. Get a token): "If you do not have one"
and "If it stops working", the latter quoting request_id and retrying
exactly once; the summary line and the 401 row of the error table say
GeneNetwork team rather than "the operator".
* docs/www/operator-checklist.md (Token issuance): the request path, so
the team knows what the ask they receive looks like.
* .gitignore: *.swp, after one got swept into this commit.
|
|
ai-instruction.md was written before anything was deployed: it took a
placeholder base URL, did not say where the API is mounted, and buried
the operator's deployment notes in an appendix labelled "not for the AI
reader" -- awkward to hand to an assistant, and confusing when it is.
So: the AI-facing page now names the deployment
(https://vesuvio.pu.ac.ke/gn4) and is self-contained, and the operator
material moves to operator-checklist.md. Everything in the page was
exercised against the running deployment.
Content changes, beyond the move:
* `next` hrefs arrive already prefixed (`/gn4/groups/BXD/strains`), so
they resolve against the origin -- joining them to the current URL's
directory double-prefixes them. Said plainly, since it is the one
thing the prefix breaks.
* says what cannot work and should not be retried: get-test-token is a
404, /compute/* is a 403 from the front end, and neither is a
permissions problem to work around.
* `/publications/{pubmed_id}/traits` wants the PubMed id, not the
internal `publication_id` in the same trait record, which 404s.
* states the current rate-limit position (none configured) instead of
implying a 429 policy that does not exist yet.
* docs/www/ai-instruction.md: rewritten, paste-ready.
* docs/www/operator-checklist.md: new file, the former appendix, updated
with what is now enforced at the proxy and a record of the verified
request matrix.
* README.md, docs/nginx.md, etc/nginx-vesuvio.pu.ac.ke.conf: point at
the operator checklist by its new name.
|
|
Without it /search forwards to GeneNetwork3 at GN3_URL (:5003) and
answers 502 backend_unreachable when nothing is listening there -- a
correct error, with the error body's links rewritten, but easy to
misread as the proxy being wrong. The deployment has an index, so native
is what it wants.
* docs/nginx.md (The server behind nginx): add the variable and say what
the default does.
* etc/nginx-vesuvio.pu.ac.ke.conf: same, in the start-up comment.
|
|
Reproduced from a mirror of the deployed /etc/nginx: with
sites-enabled/default still present, nginx logs
conflicting server name "vesuvio.pu.ac.ke" on 0.0.0.0:443, ignored
and answers 443 with the default site -- stock welcome page at /,
nginx's own 404 for /gn4/..., HTTP/1.1 despite `http2 on` in this block.
sites-enabled/* is globbed alphabetically and the first block whose
server_name matches wins, so `default` (edited by certbot to serve this
hostname) shadows the gn4 block. Removing it gives the expected 302 /
301 / 200 / 404 / 403 matrix.
* docs/nginx.md (nginx): say to install the snippet instead of the
distribution default, and what the shadowing looks like from outside.
|
|
The installed copy merged certbot's port-80 redirect into the TLS block,
which makes that block an HTTP one (listen 80) -- so the /gn4 mount was
only reachable over plain HTTP and https://…/gn4 fell through to the
default server. The same redirect left inside a restored `listen 443 ssl`
block would point at itself, since hosts matching `$host` would be
redirected to the URL they already asked for.
So the port 80 block exists only for the redirect, and www is dropped
from server_name: the certificate's subjectAltName is only
vesuvio.pu.ac.ke, so https://www.<host> cannot be served until the
certificate covers it.
* etc/nginx-vesuvio.pu.ac.ke.conf (server): new listen-80 redirect block;
drop www from the TLS block's server_name.
|
|
The certificate on :443 carries subjectAltName DNS:vesuvio.pu.ac.ke, and
vesuvio.pu.ac.uk does not resolve at all, so the config as committed
could not have matched a request for the real name: nginx falls through
to the default server, which is why /gn4/... answered 404 from nginx
rather than a 502 from genenetwork4.
* etc/nginx-vesuvio.pu.ac.uk.conf -> etc/nginx-vesuvio.pu.ac.ke.conf:
server_name and the certificate paths.
* docs/nginx.md: the same rename, and a "Checking it" section that
starts from what actually gets in the way on the box -- TLS validates
the URL hostname rather than a Host: header, so on-box checks need
--resolve against the name on the certificate, and a mismatch there and
in server_name look identical (default server answers).
|
|
docs/nginx.md explained the pieces; this is the assembled file for the
deployment actually being set up, so it can be reviewed and installed
without stitching anything together. It lives in etc/ rather than
docs/, being deployable configuration rather than prose.
It refuses /compute/*, which the README-based template did not: those
endpoints take server-side file paths and run gemma/ravanan/R on them,
so any token holder able to reach them can read the box -- the operator
checklist in docs/www/ai-instruction.md already said to keep them on the
internal listener, and this is that rule where it belongs.
* etc/nginx-vesuvio.pu.ac.uk.conf: new file. TLS, http2, log format
carrying x-request-id, / and /gn4 redirects, proxy_pass with the
prefix-stripping trailing slash, raised timeouts, sub_filter rewriting
of href/next/spec_url/type, and 403/404 refusals for /compute/ and
/get-test-token.
* docs/nginx.md: point at it, and say why /compute/ is refused.
|
|
|
|
The page told the operator to mint with POST /get-test-token, which is
gn-auth's dev password grant and does not exist in the deployment being
set up. Issuing a second user's token also had no good answer: the stub
minted exactly one token per process, so a new user meant starting a
throwaway instance, grabbing --token-file and killing it.
So add --mint-only: mint for --subject, print, write --token-file and
exit without listening. Verification only depends on the key (committed,
so shared by every instance) and on iss, which now falls back to
AUTH_SERVER_URL -- a token minted this way verifies against the
long-running stub untouched.
* scripts/gn-auth-stub.py (main): --mint-only; --issuer defaults to
AUTH_SERVER_URL before the port-derived default. Docstring says how a
second user's token is issued.
* docs/www/ai-instruction.md (1. Get a token): the operator's command is
the stub, not /get-test-token; the token lasts whatever --expires-in said
rather than an hour, and there is no early revocation. (4. What is
public): minting is operator-side. Appendix: "Token issuance" rewritten
around the stub -- public-data-only, expiry as the only revocation, sub
as attribution, one token per user -- with gn-auth kept as what replaces
it later; the stub is no longer listed as a dev leftover to delete, but
as the auth server that must never be routed publicly.
* README.md (Tests): mention --mint-only next to the stub's other flags.
|
|
Nothing about a bearer token is kept server side -- no session table, no
issued-token list, no denylist -- so restarting genenetwork4 (or the
auth server) loses no tokens, and restarting is not a way to revoke
them. The two in-process caches (the key set for an hour, authorisation
answers for a minute) are refresh intervals, not lifetimes; the hour
only bites when the auth server is unreachable, after which every
request is a 401 with a JWKS-fetch detail while the tokens themselves
are still valid.
Also records that `exp` is optional in this validation, so a
hand-minted token without one never expires -- which is exactly what the
gn-auth dev token mentioned a few paragraphs earlier is doing.
* README.md (Development): "Tokens are stateless", plus a note on the
gn-auth dev token not carrying `exp`, and the config keys paragraph
moved back above the section it belongs to.
|
|
The deployment being set up is https://vesuvio.pu.ac.uk/gn4 proxying to
a loopback port, with no gn-auth yet. Two things there are not obvious
and neither is discoverable from the README's /get-test-token section:
every link the API emits is root-relative, so under /gn4 they resolve
outside the mount point; and /compute/* runs for minutes in a single
request, so nginx's one-minute default read timeout cuts it off
mid-computation.
The link rewriting is the delicate part -- the server's serde output is
compact ("href":"/"), not the pretty-printed shape the README examples
show, so a filter written from those examples silently does nothing.
Both spellings of all four affected keys (href, next, spec_url, type)
are in the config, and the envelope's "next":[ array is deliberately
left alone.
* docs/nginx.md: new file. Server environment, the nginx block, what the
prefix does to links and the three ways to handle it, stub-minted
tokens instead of gn-auth, and how to check the result.
* README.md (Behind nginx or in a container): point at it.
|
|
A stub token had a fixed 24h lifetime, and nothing said what an
ungranted one can reach. Both matter for the case that is not a test
run: handing a caller or an agent a long-lived token that may only read
public data. An ungranted stub token already is exactly that -- the
restriction lives in the authorisation lookup genenetwork4 consults for
anything not public, not in the token's scope -- so only the lifetime
was missing.
* scripts/gn-auth-stub.py (duration): new helper, "30d"/"24h"/"60m"/s.
(sign): take expires_in instead of a hard-coded 86400.
(main): --expires-in, defaulting to 24h as before; docstring says what
an ungranted token can reach and why the key's fixity makes a month-long
token safe.
* README.md (Tests): the public-data-only token, what stays visible
(dataset metadata), the --expires-in example and the iss/port coupling.
|
|
A second instance started while one is already listening used to write
its own token to --token-file (and print it) before failing to bind,
leaving a token nothing was serving in the place the first instance's
token was expected -- tests then failed as if the stub had issued it.
Bind first, then write and print.
* scripts/gn-auth-stub.py (main): construct the server before writing
--token-file or printing the token.
|
|
The suites skip rather than fail whatever needs a database, an index or
a token they cannot get, which is right in the build sandbox but leaves
most endpoints unexercised. With a live MariaDB, a full Xapian index
(GN4_FULL_INDEX) and a token, the same commands run the whole suite:
225 Rust tests pass with 0 failures, and the Python suite runs all 94
with no skips -- as against 77 skipped without them.
The token was the only piece with no local stand-in, so add
scripts/gn-auth-stub.py: it serves the JWKS matching the committed test
key, answers /auth/token (so POST /get-test-token works) and answers
both authorisation endpoints with "no privileges", the stranger case
the non-public 403 tests assert. --grant-resource-id grants one
resource id to the fixture token for the owner-side tests.
* scripts/gn-auth-stub.py: new file.
* README.md (Tests): "Against a real database and index", what the
three inputs are, the full run, and what still skips and why.
|
|
The xapian-rs git revision Cargo.toml pins was written against Xapian
1.4: it generates bindings for Xapian::InMemory::open, which Xapian 2.0
removed (2.x spells it as the Xapian::DB_BACKEND_INMEMORY flag), and
autocxx then aborts with "the 'generate' or 'generate_pod' directive for
'Xapian::InMemory::open' did not result in any code being generated".
2.x's headers also need C++17, where autocxx hands the parser a fixed
-std=c++14 that 1.4's headers accept. Guix's own xapian has moved to
2.1.0, so guix build -f guix.scm stopped working; pin the last 1.4
release instead of tracking it.
* guix.scm (xapian-1.4): new variable, Xapian 1.4.29 inheriting
xapian's inputs, with 1.4's own check targets.
(genenetwork4-git)[inputs]: use xapian-1.4.
(use-modules): (guix download), for url-fetch.
* README.md (Running with cargo): "Building with cargo, outside a bare
toolchain", the guix shell -D variables that a bare cargo build lacks.
(Running with Guix): why xapian is pinned, and when to drop it.
|
|
docs/www/ai-instruction.md is the AI-facing page: you are handed a JWT
(the operator mints it on the server's loopback interface, so there is no
token endpoint on the public host and no flow for the model to follow),
send it as a bearer token, and read the envelope. It covers discovery
(/openapi.json, /version), the readable endpoints, search's grammar and
paging cost, the public-data rule (public > 0 && confidentiality < 1, or
older than five years), error classes and what to do with each, and a
worked example.
The operator appendix records the deployment findings from this session:
* /get-test-token is now the minting route and only a loopback peer
check plus proxy-header refusal keeps it off the internet -- it must
not be proxied and the app must stay bound to 127.0.0.1;
* POST /compute/* takes server-side file paths and is token_only, so it
is an arbitrary-read/execution surface and stays internal;
* the public rule is enforced per dataset for values, while metadata
endpoints are token_only by design and do reveal non-public dataset
records -- a decision to make, not an accident;
* the index must be built with the public filter (GN4's indexer does;
gn3's index-genenetwork has no WHERE clause). Verified on the current
full index: the confidentiality=1 HCPPublish and the public=0
BR_U_0303_M dataset both return zero hits;
* error detail can carry the database address, and tokens minted this way
all carry gn-auth's development user as sub, so the audit trail is
"someone with a token" until client_credentials exists.
|
|
mark_failed_appends_failure_marker_with_the_error and
create_run_log_rejects_a_reused_id both worked in
/tmp/gn4-streaming-test-<pid>, and the second removes the directory when
it is done, so under cargo's parallel test threads it could delete the
first one's log mid-assertion -- an intermittent failure that has
nothing to do with either test's subject. Give each its own directory.
|
|
The suite covered each half of /search separately: tests/search.rs pins
the MariaDB side (locus, abbreviation, complete/partial) but through the
gn3 stub engine, and the search_native* tests pin the native engine
against a dev index and never need a database. Native engine + live
db_webqtl -- the combination that actually runs in production -- was
only ever checked by hand.
tests/search_native_db.rs closes that: route level, dataset:bxdpublish
must come back 200 with meta.state complete and annotated hits; at the
engine seam, dataset:BXDPublish must match the same documents as
dataset:bxdpublish; and the match set's ids must be the database's
PublishXRef ids for the BXD group.
The strict id comparison runs only against a full index, selected with
GN4_FULL_INDEX (skipped by default, like GN4_PARITY_FIXTURES). Against
the dev index the ids are printed as reference data instead: it is a
different snapshot, missing 1 772 of the database's traits and holding
349 the database no longer has, which is exactly what made the strict
form worth having.
|
|
The index stores every boolean term in lowercase and holds no
mixed-case variants at all: XDSbxdpublish (15 060 docs), Awilliams
(10 958), XSmouse, XCx, XYbdnf, XImrna all exist, while XDSBXDPublish,
AWilliams, XSMouse, XCX, XYBDNF and XIMRNA report "not in database" on
both the dev index and a full production one. Matching the value
exactly therefore rejected the way a caller naturally writes it --
dataset:BXDPublish returned 0 hits against an index holding 15 060
BXDPublish traits, author:Williams 0 against 10 958 williams authors.
Lowercase the value for every boolean prefix, generalising the
group-only rule gn3 already has (search.py:204-209). No graded parity
shape changes: they all use lowercase values already.
Pinned per prefix in boolean_prefixes_parse_to_exact_index_terms, so a
registration that regresses to an exact add_boolean_prefix fails there
instead of silently returning zero hits.
|
|
Measured the same request (BXD fixtures, three chromosomes) through
/compute/gemma, ravanan's single-machine backend and ravanan on Slurm,
cold and warm. The Slurm backend is dispatch-bound at this size -- one
scheduler tick per step, with each job itself running in under a second
-- so cold and warm are identical there, and the README's 16.7s figure
belongs to the single-machine backend.
Also document the Slurm-side requirement behind that measurement: a
completed job has to stay queryable for as long as the workflow runs.
Once slurmctld purges the record ravanan falls back to slurmdbd, and on
a cluster without accounting the workflow aborts on a 404 long after the
job succeeded.
|
|
The cache dir was keyed by chromosome only and shared across requests,
so a request with different inputs (another trait, or another snps or
genotype file) left a second *-gemma-cXX.tar.xz in the same chr-N dir.
gemma-wrapper names those archives by a content hash, so the workflow's
single-File glob output binding then matched more than one path and the
step failed -- silently, since ravanan's user-error only logs when
%log-level is set, which never happens inside a generated job script.
Key the cache root by a hash of the input set (genotype path and size,
snps contents, trait values, lmm) as well as by chromosome, so repeated
identical requests still hit gemma-wrapper's cache while different
input sets cannot see each other's archives. chromosomes_in reads the
snps file, so it now takes the already-read contents (chromosomes_from)
to avoid reading it twice.
cwl/README.md: describe the two-part keying, and note that a node needs
a writable HOME -- ravanan forwards the submitting process's HOME into
the job (as sbatch would) and gemma-wrapper writes its lock file there.
|
|
Spell out why the current design needs the store visible (ravanan
submits a store path and Slurm does not substitute, so an absent path is
an immediate ENOENT), then list the five ways out as a table -- shared
store, realise-then-run wrapper, per-workflow realise job, guix publish
plus wrapper, shipping closures -- with what runs, what each needs on
the nodes, and what it costs in caching.
Also records where the wrapper would live (build-gexp-script already
builds the derivation but returns only its output path; submit-job in
ravanan/slurm-api.scm assembles the script field), that nothing of it is
implemented here, and the four costs that decide the question: channel
skew, build time inside the job's time limit, caching on ephemeral node
stores, and guix publish as the sane companion.
Tables tightened so no line runs past ~170 characters.
|
|
cwl/README.md explains the whole path (API -> ccwl compile -> ravanan ->
slurmrestd -> slurmd), where Guix sits (front end only: nodes just need
the same /gnu/store mounted, plus bash, a writable ravanan store for
data/logs, and scratch for the job's working directory), the two caches
(ravanan's work reuse, checked before submitting; gemma-wrapper's
per-chromosome --cache-dir, inside the job) and why the latter is what
actually saves work for this endpoint.
It also answers "can the nodes rebuild the tools instead of sharing a
store": yes in principle, since Guix is deterministic and a node
building the same derivations would materialise identical store paths,
but ravanan submits a store path and Slurm does not substitute
automatically -- so it needs a realise-then-run wrapper (ravanan's
slurm backend already holds the script's derivation), a per-workflow
realise job, or guix publish plus a node-side daemon, with the costs
and channel-pinning caveats listed. The timing table from the test
cluster (cached: identical; fresh: waves vs synchronous steps) is
included so expectations are explicit.
docs/ravanan-slurm.md and README.md link to it.
|
|
POST /compute/gemma/ravanan used to run every CWL step locally, because
compute_ravanan never passed ravanan a batch system. Add a
RavananBatch setting:
- RAVANAN_BATCH_SYSTEM=single-machine (default) or slurm-api, failing
closed on anything else, exactly like GN4_DB_MODE;
- slurm-api adds --batch-system=slurm-api, --slurm-api-endpoint,
--slurm-jwt (a *file*, which is what ravanan reads) and, when set,
--slurm-partition/--slurm-nice; a slurm selection without an endpoint
or a JWT file refuses to start rather than 502-ing every request;
- --scratch defaults to ravanan_cache_dir for slurm, so the store and
the job scratch space live on the same shared filesystem (with slurm
that directory has to be visible to the compute nodes);
- the response's ravanan note records which backend ran.
The switch building is RavananBatch::ravanan_args so it is unit
testable; compute_ravanan takes the backend and the scratch directory,
and the route passes them from config. docs/ravanan-slurm.md documents
the keys, the shared-directory requirement, and the slurm-side auth
wiring (AuthType=auth/munge + AuthAltTypes=auth/jwt with SLURM_JWT in
slurmrestd's environment) that makes REST-submitted jobs actually run.
|
|
# Conflicts:
# src/gemma.rs
# src/rqtl.rs
# src/streaming.rs
|
|
gemma-loco.cwl was a generated artifact (ccwl compile's output), but
was being committed like hand-written source. Remove it, and have
compute_ravanan compile cwl/gemma/gemma-loco.scm to a throwaway CWL
file under its own cache dir on every call instead -- cheap (pure
macro expansion, no Guix build involved), so there's no real cost to
regenerating it fresh each time, and no risk of a stale compiled file
drifting from its ccwl source.
Config gains a ccwl_cmd knob (default "ccwl", resolved via PATH,
alongside ravanan_cmd/gemma_wrapper_cmd); gemma_ravanan_workflow now
names the .scm source, not a .cwl file. Verified end to end by running
the exact compile-then-run sequence compute_ravanan now performs
against the real ccwl/ravanan/gemma-wrapper binaries and the BXD
fixtures: same correctness and timings as before.
|
|
Per Arun's request, express the --loco kinship/GWA workflow as a
ccwl (https://ccwl.systemreboot.net/) source, cwl/gemma/gemma-loco.scm,
compiled with `ccwl compile --output=gemma-loco.cwl gemma-loco.scm`.
ccwl inlines the two command definitions (kinship, gwa) directly into
the Workflow CWL, so tools/kinship.cwl and tools/gwa.cwl are no longer
needed as separate files.
The two scatter steps (kinship over [chr, cache_dir], gwa over [chr,
cache_dir, kinship_json], both dotproduct) and the gwa_json/archive
outputs are unchanged in substance -- verified by compiling and
running the generated gemma-loco.cwl through ravanan against the BXD
fixtures: same 20-chromosome scatter, same cold (~17.7s) and warm
(~2.4s, 0 jobs re-run) timings, and the same GWA values (rs31443144:
chr=1, ps=3010274, p_lrt=0.2178407) as the hand-written CWL it
replaces.
|
|
--cache-dir "." pointed every scattered job at its own hermetic CWL
working directory (fresh under ravanan's --store every run), so
gemma-wrapper's cache was never actually reused across requests.
Point it instead at <ravanan_cache_dir>/gemma-wrapper-cache/chr-<N>,
one persistent directory per chromosome -- not a single shared
directory, because gemma-wrapper's cache-hit hash does not vary with
--chromosomes, so sharing one directory would let one chromosome's
job silently reuse another's cached result.
Also drops gwa.cwl's InitialWorkDirRequirement staging hack: since
kinship and gwa for the same chromosome now point at the same
persistent cache_dir, gemma-wrapper finds the kinship step's archive
there directly, no staging needed.
Confirmed via a real integration run (BXD fixtures) that gemma-wrapper
itself unconditionally re-executes GEMMA regardless of whether a
matching cached archive already exists -- --cache-dir is only used to
hand results between gemma-wrapper's own pipeline stages within one
request, not to skip recomputation across requests. So this fixes a
real latent bug (archive-glob collisions once a chromosome's cache
directory holds more than one request's output) but does not, on its
own, speed up repeated identical requests; verified the direct
/compute/gemma path shows the same lack of cross-request speedup.
|
|
Replace gemma-loco.cwl's single kinship/gwa pair (each one gemma-wrapper
invocation covering all chromosomes, relying on gemma-wrapper's own
internal GNU-parallel fan-out) with one gemma-wrapper invocation PER
CHROMOSOME, restricted via its existing --chromosomes/--no-parallel
flags and scattered by ravanan itself (ScatterFeatureRequirement,
scatterMethod: dotproduct). gemma-wrapper still does the correct
per-chromosome LOCO math (exclude this chromosome from kinship, test
only its markers) against the full genotype/SNP files -- only which
chromosome(s) it loops over changes. compute_ravanan now computes the
chromosome list itself (chromosomes_in, mirroring gemma-wrapper's own
get_chromosomes) and passes it as the workflow's scatter input, and
collates the resulting per-chromosome gwa_json/archive array outputs.
Measured 16.7s wall-clock end-to-end against the BXD fixtures (20
chromosomes), vs. ~19s for /compute/gemma's direct path and ~21s for
the previous sequential ravanan workflow -- confirmed byte-for-byte
identical output (rs31443144's exact values, 7320 total rows).
Also fixes three real, previously-unexercised bugs in compute_ravanan
found getting this to run at all (POST /compute/gemma/ravanan had no
automated test until this commit):
- missing --guix-manifest (ravanan requires it; added
gemma_ravanan_manifest config key and cwl/gemma/manifest.scm)
- missing --store files/logs/data subdirectories (ravanan does not
create them itself)
- --output-directory dropped entirely: every chromosome's gwa archive
shares gemma-wrapper's own content-hash basename (the hash doesn't
factor in --chromosomes), so ravanan's optional flat-symlink step
collides across them; unneeded anyway since results are read
straight from ravanan's --store via its stdout JSON record.
Also found and worked around a ravanan scheduler bug: a step scattered
over exactly one input needs an explicit scatterMethod even though CWL
only requires one for multiple scattered inputs -- ravanan has no
fallback case for a missing one and silently misbehaves.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
|
So a caller of /compute/gemma(/ravanan) or /compute/rqtl doesn't need
to count data's rows or columns.len() itself. with_columns now takes
the row count too and derives num_cols from the column list.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
|
Same space-saving shape as the gemma commit: /compute/rqtl's markers
are now positional arrays (name, chr, pos, lod, plus any 4-way-cross
extra effect columns trailing) instead of one keyed object per row,
with the fixed column names in meta.columns.
Also fixes tests/gemma.rs, which still asserted the old keyed shape
from the gemma change -- missed in that commit.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
|
Cuts repeated key names out of large /compute/gemma(/ravanan) responses:
data is now a list of positional row arrays instead of one keyed object
per row, with the column names moved to a new meta.columns field shared
with any other endpoint that wants the same shape.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
|
|
|
- rqtl: per-call unique output filename. The content hash alone was
deterministic across processes, so two concurrent identical
requests shared one output file; R truncates on open, so one
request could read the other's half-written results with no error.
The per-call unique (pid + nanos, already computed for the pheno
file) now names the output file too.
- streaming/gemma/rqtl: append a failure marker to the run log on
every error path, mirroring the completion marker. A status
poller can now tell a failed run from a still-running one.
- rqtl: --scale is now honored. The wrapper selects the geno file's
cM/Mb map column from it, and the route rejects values other
than mb/cm with 422 instead of silently ignoring them.
Both new behaviors are unit-tested; the live Rscript tests pass.
|
|
Pure formatting sweep (import ordering, line wrapping); the tree
had accumulated rustfmt drift. Separated from any semantic change
so it stays reviewable and revertable on its own.
|
|
|
|
|
|
* src/config.rs (DbMode, Config.db_mode, parse_db_mode): add
GN4_DB_MODE=dev|production in the layered config; dev runs with no
configured DB; fail-closed parse (a typo refuses).
* src/db.rs (DbError, pool, probe), src/error.rs (ApiError::from_db):
mint a typed 503 db_unavailable at the db::pool() choke point,
distinguishing Unavailable from Query.
* src/main.rs: loud no-DB startup line; production refuses to start
(exit non-zero) before axum::serve.
* src/routes/{accessions,datasets,groups,mapping_methods,publications,species,traits}.rs:
route every DB error through ApiError::from_db.
* src/bin/gn-indexer.rs: refuse to build an index when the DB is unreachable.
* tests/no_db.rs: pin no-DB degradation (search 200 partial, DB routes 503).
His ask (DM 2026-10-12): "Make it an option to switch it off for
development machines? I mean mariadb." The no-DB hardening is ours
(review-driven). Default GN4_DB_MODE left unflipped (=dev); the flip needs
owner sign-off.
|
|
* src/indexer/delta.rs (scan): enumerate dataset labels under COLLATE
utf8mb4_bin so a case-only rename's old and new labels both enter scope;
route to FULL when a case-variant label pair is in the affected scope.
* src/indexer/run.rs (run_delta): seed the duplicate-check map with manifest
labels not in scope; route to FULL when a manifest carries an unknown
versioning flavour.
* scripts/gn-indexer-lag.sh: honour the table-prefix seam only with the
explicit test opt-in; treat a literal NULL MAX as no change; guard an
empty lag value.
* scripts/gn-indexer-run.sh: --index=PATH-aware argument scan.
|
|
* src/indexer/delta.rs: change detection over MariaDB system versioning
(ROW_START/ROW_END): coverage marker, versioning probe, purge check,
per-table candidate queries and identity-term fan-out.
* src/indexer/run.rs (run_delta): reuse the streaming crawl and shard diff,
scoped to the affected datasets.
* src/indexer/sidecar.rs: manifest v3 with versioning_marker/versioning_flavour.
* src/bin/gn-indexer.rs: add the delta mode.
* scripts/gn-indexer-run.sh, scripts/gn-indexer-lag.sh: flock wrapper and lag SLA.
|
|
GN4_INDEXER_HALT_AFTER_COMMITS parks the process and
GN4_INDEXER_COMMIT_CHUNK reshapes the commit cadence; either set by
accident in a production environment could hang or change a run. Make
both inert unless GN4_INDEXER_TEST_HOOKS=1.
|
|
shard_filename truncated the label's SHA-256 to 32 bits, so two labels
sharing a sanitized stem and a 32-bit prefix could merge into one shard
(last writer wins). Use 16 hex chars and assert length and distinctness.
|
|
Duplicate-identity detection kept only the current dataset's set, so two
labels differing only by case lowercased to the same <dataset> and
collided across shards unseen; the manifest doc_count would then
double-count and every later run would re-FULL forever. Keep an
O(#datasets) lowercased-label map and flag a second distinct raw label
that lowers to a seen key.
|
|
The crawl ordered by dataset with the Name column's utf8mb4_general_ci
collation while merge_streams compares labels by Rust byte order, so a
label could arrive in two non-contiguous runs and the second begin_dataset
would drop the first run's rows. Pin COLLATE utf8mb4_bin on both ORDER BY
clauses so the SQL order matches the merge.
|
|
A monolithic sidecar rewrote and re-read the whole identity map each run;
sharding it by dataset under <index>.sidecar.json plus <index>.sidecar.d/
lets a run load and rewrite only the shards it touches and keeps resident
memory at O(largest dataset).
* src/indexer/run.rs: crawl the SQL sources one dataset at a time through a
sink and commit every 5000 documents instead of buffering the whole crawl;
a bounded-channel variant was tried and reverted (several times slower).
* src/indexer/rows.rs: order and group the crawl streams by dataset.
* src/bin/gn-indexer.rs: follow the sharded sink wiring.
|
|
Building and writing each document as the crawl yields it is leaner than
collecting the whole set in a Vec, so live documents stay O(1) and peak
memory stops scaling with the corpus.
* src/indexer/livemem.rs: the live-document counter that proves it.
* src/indexer/build.rs, src/indexer/mod.rs, src/bin/gn-indexer.rs: adapt
to the streamed build and write signatures.
* Cargo.lock: repin xapian-rs 97fd343 -> 70c5eac (the write-API set).
|
|
* rust-package.scm: regenerate with 'guix import crate -f Cargo.lock
genenetwork4', bringing the crate set in sync with Cargo.lock (the
gemma/auth work bumped tokio, which added signal-hook-registry 1.4.8).
* guix.scm (native-inputs): add rust-signal-hook-registry-1.4.8.
Without these the vendored build aborts at patch-cargo-checksums
(missing guix-vendor/rust-signal-hook-registry-1.4.8.tar.gz). Verified
hermetic: guix time-machine -C channels.scm -- build -L ~/guix-bioinformatics
-f guix.scm -> /gnu/store/7gk50nkrlyd3sc52bra48j70i5hb031z-genenetwork4-git-0.1.0
|
|
|
|
Realigns every pipe-table column to a uniform width, and trims cell
text so each table stays under 100 chars per row, moving one
over-long cell's detail (InbredSet.MappingMethodId) into a footnote
paragraph below its table instead of dropping it. The gn-auth.md
endpoints table is left over 100 chars, with a note explaining why: its
longest path is 66 chars by itself, leaving no room for the other two
columns under that cap.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
|
|