gendersdb

HPC · cluster node attributes

The genders flat file, made relational.

Classic genders is a flat (node, key)=value bag — no multi-values, no real relationships, no query language. gendersdb puts SQLite where genders kept a text file: an (entity, name, value) triple model plus typed relations. Your nodeattr and pdsh muscle memory still works — everything else gets an upgrade.

  • Python 3.8+
  • standard library only
  • backed by SQLite
  • drop-in nodeattr / pdsh
  • no daemon · no pip
  • MIT licensed

the model, fixed

It fixes the model, instead of wrapping it.

The flat file couldn't say a node has two VLANs, or that a rack is powered by a phase-B PDU. gendersdb makes attributes multi-valued and relationships first-class — so the questions you always wanted to ask become one line.

/etc/genders · flat

# one (node,key)=value bag; last write wins
node[01-08]  compute,eth0=e%n,bmc=%n-ipmi
node[01-04]  gpu
node01       vlan=10
node01       vlan=20   # clobbers 10
# racks? PDUs? phases? nowhere to put them.
  • single value per key
  • no relations between nodes
  • substring / glob matching only

gendersdb · triple + relations

set node01 vlan=10
set node01 vlan=20     # both kept
link node01 member_of rack-b
link rack-b powered_by pdu-b
set pdu-b  phase=B
  • native multi-valued attributes
  • real 1‑n / m‑n edges (node→rack→PDU)
  • booleans, numbers, regex, hops, aggregation

what you get

Small tool. Sharp edges in the right places.

Multi-valued by design

Uniqueness is on the triple, not the pair — so a node can carry two VLANs, three networks, any repeated key, with nothing clobbered.

Relations & inheritance

Typed edges model real topology — node→rack→PDU. Attributes inherit one hop along member_of, opt-in when you want it.

A real query language

Booleans, numeric comparison, regex, relational hops and aggregation — compiled to safe, parameterized SQL. compute && mem>=256 && !gpu.

Natural language

Ask in English; gendersdb translates to the DSL, echoes it, and waits for your yes. It proposes a verifiable expression — it never selects nodes on its own. Local, never cloud.

Interactive shell

A REPL over your database — tab-completion of live names, history, hostlist expansion, and staged begin/commit/rollback transactions.

Drop-in compatible

A nodeattr shim speaks the classic CLI, and export emits a flat genders file — so existing nodeattr/pdsh scripts run unchanged.

Head-node friendly

Standard library only — no pip install, no daemon, no cache. It drops onto a locked-down HPC head node with just Python 3.8+ and SQLite.

the DSL in anger

Ask the cluster hard questions.

Every value is a bound parameter; every attribute and relation name is charset-validated. The same grammar drives the CLI, the shell and natural language.

download · install · run

Up and running in three commands.

Download the package, unpack, and run the installer — no pip, no clone. Already have an /etc/genders? Import it and keep going; a sample flat file ships in the box.

Quick start

the migration story, end to end

  1. 1 · create the database $ gendersdb --db cluster.gdb init
  2. 2 · import your flat genders file $ gendersdb --db cluster.gdb import /etc/genders
  3. 3 · ask a question $ gendersdb --db cluster.gdb select 'compute && !gpu' $ gendersdb --db cluster.gdb nl "gpu nodes with 512+ of ssd"
  4. or drop into the shell $ gshell --db cluster.gdb

Download & install

v1.0 · per-user or system-wide; no pip

# unpack, then: $ tar xzf gendersdb-1.0.tar.gz $ cd gendersdb-1.0 $ ./install.sh # ~/.local $ sudo ./install.sh # /usr/local
  • Python 3.8 or newer
  • SQLite (bundled with Python)
  • Zero third-party packages
  • MIT licensed · optional local Ollama for NL