@roomi-fields/grillhouse 0.55.1 → 0.55.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,5 +5,5 @@
5
5
  "author": {
6
6
  "name": "Romain Peyrichou"
7
7
  },
8
- "version": "0.55.1"
8
+ "version": "0.55.2"
9
9
  }
package/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.55.2] - 2026-12-03
10
+
11
+ - **The reservation of a step follows the observed usage, on the cores of the machine** (grillhouse-j9m.16): the cores of the machine are counted on its topology, not on the affinity of the measuring process (a process confined to 6 cores gave a budget of 4 cores and a part equal to the whole budget); the default part of a phase without measures is the budget divided by the places (a third at 3 places), never the whole budget, and its cores are min(3, budget); a reservation that can never fit in the budget protects no rank at the bound of passages, and its refusal says so with its figures; the restriction of a measure's dedicated cores is lifted at its end, an interrupted one included, and at the opening of the arbiter; the migration `table des consommations` writes the table of a project that has none. It also mends the regression of 0.55.1 (the same reservation mechanism): the reviewer no longer started in any project (« MemoryMax is out of range »), its step having no phase and a reservation of 0; every session of a role now starts with the reservation of its phase, the reviewer included, and no null bound is ever written. `machine.md` §5.2 and §5.6 say it. **Action for projects**: none; `grillhouse maj` writes the table.
12
+
9
13
  ## [0.55.1] - 2026-12-03
10
14
 
11
15
  - **The tests of a migration no longer fix its version** (grillhouse-jcq.3): the three tests of the migration « lectures des tests » (typescript, cargo, python) required it to carry no version, so the release, which writes it, turned them red; they still check its name, its listing and its guard. **Action for projects**: none.
@@ -7,7 +7,7 @@ import { Context } from '@temporalio/activity';
7
7
  import { maxDuProjet } from '../../../scripts/circuits-cles.mjs';
8
8
  import { mesurerLaCopie } from '../../../scripts/disque-des-copies.mjs';
9
9
  import { departDe } from '../../../scripts/mesure-de-la-machine.mjs';
10
- import { budgetDeLaMachine, partDe, plafondDeDepart, } from '../../../scripts/plafond-de-la-machine.mjs';
10
+ import { budgetDeLaMachine, partDe, plafondDe, plafondDeDepart, } from '../../../scripts/plafond-de-la-machine.mjs';
11
11
  import { lireLaTable } from '../../../scripts/table-des-consommations.mjs';
12
12
  import { jouer } from '../acte.js';
13
13
  import { ouvrirLeClient } from '../client.js';
@@ -24,7 +24,7 @@ function tableDe(racine, phase) {
24
24
  const phases = { ...(lireLaTable(racine)?.phases ?? {}) };
25
25
  if (!phases[phase]) {
26
26
  const budget = budgetDeLaMachine();
27
- const part = partDe({ budget });
27
+ const part = partDe({ budget, places: plafondDe() });
28
28
  phases[phase] = { ...part, ...plafondDeDepart(part, budget) };
29
29
  }
30
30
  return { phases };
@@ -1 +1 @@
1
- {"version":3,"file":"activites.js","sourceRoot":"","sources":["../../../src/temporal/circuit/activites.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,kEAAkE;AAClE,gGAAgG;AAChG,iGAAiG;AACjG,sEAAsE;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AACrE,OAAO,EACL,iBAAiB,EACjB,MAAM,EACN,eAAe,GAChB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAA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CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,CAA6B;IAE7B,OAAO,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAC9B,KAAK,CAA6B,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAC3E,CAAC;AACJ,CAAC"}
@@ -4,12 +4,12 @@ import { type IssueDeLaFermeture, type IssueDeLaReouverture, type CircuitsDuProj
4
4
  /**
5
5
  * Starts the workflow of the machine on <file> when none runs; leaves the one that runs, without
6
6
  * asking a start, whose history the server would write and leave orphan. Two callers that start it
7
- * at once share the one run (USE_EXISTING).
7
+ * at once share the one run (USE_EXISTING). True when this call opened the arbiter.
8
8
  */
9
9
  export declare function demarrerLesPlaces(client: Client, entree: EntreeDesPlaces, { file, id }?: {
10
10
  file?: string;
11
11
  id?: string;
12
- }): Promise<void>;
12
+ }): Promise<boolean>;
13
13
  /**
14
14
  * Takes a place of the machine for <demande>: records the request under an id of its own, then
15
15
  * reads it every <veilleMs> ms until the place is given. A request withdrawn, or whose process is
@@ -25,11 +25,11 @@ async function tourne(h) {
25
25
  /**
26
26
  * Starts the workflow of the machine on <file> when none runs; leaves the one that runs, without
27
27
  * asking a start, whose history the server would write and leave orphan. Two callers that start it
28
- * at once share the one run (USE_EXISTING).
28
+ * at once share the one run (USE_EXISTING). True when this call opened the arbiter.
29
29
  */
30
30
  export async function demarrerLesPlaces(client, entree, { file = FILE_DE_LA_MACHINE, id = ID_DES_PLACES } = {}) {
31
31
  if (await tourne(client.workflow.getHandle(id))) {
32
- return;
32
+ return false;
33
33
  }
34
34
  await client.workflow.start(PLACES, {
35
35
  workflowId: id,
@@ -37,6 +37,7 @@ export async function demarrerLesPlaces(client, entree, { file = FILE_DE_LA_MACH
37
37
  args: [entree],
38
38
  workflowIdConflictPolicy: 'USE_EXISTING',
39
39
  });
40
+ return true;
40
41
  }
41
42
  /**
42
43
  * Takes a place of the machine for <demande>: records the request under an id of its own, then
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/temporal/places/client.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,8FAA8F;AAC9F,+FAA+F;AAC/F,+FAA+F;AAC/F,8FAA8F;AAC9F,8FAA8F;AAC9F,2DAA2D;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAGlB,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,OAAO,EACP,SAAS,EACT,MAAM,EACN,eAAe,EACf,QAAQ,EACR,aAAa,GAQd,MAAM,cAAc,CAAC;AAEtB,oGAAoG;AACpG,4DAA4D;AAC5D,KAAK,UAAU,MAAM,CAAC,CAAiB;IACrC,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC;IACxD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAK,CAAW,CAAC,IAAI,KAAK,uBAAuB,EAAE,CAAC;YAClD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAAc,EACd,MAAuB,EACvB,EAAE,IAAI,GAAG,kBAAkB,EAAE,E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AK,UAAU,gBAAgB,CACpC,MAAc,EACd,EAAE,GAAG,aAAa;IAElB,OAAO,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,aAAa,CAA2B,kBAAkB,CAAC,CAAC;AACnG,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAc,EACd,CAAmB,EACnB,EAAE,GAAG,aAAa;IAElB,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChF,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACxC,IAAI,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,CAAC,aAAa,CAA+B,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAChF,CAAC"}
@@ -216,7 +216,7 @@ interface LigneDeConsommation {
216
216
 
217
217
  **La phase** est la clé qui lie une ligne du registre, une ligne de la table et une demande. Dans un circuit, elle vaut `<étape>:<rôle>` pour une séance et `<étape>:passe` pour une passe, le numéro de l'étape étant celui de la liste des étapes (document du circuit, §5.1) : `1:explorateur`, `1:questionneur`, `1.1:explorateur`, `2:testwriter`, `2.1:passe`, `3:developpeur`, `3:direct`, `3.1:passe`, `4.1:passe`, `4.2:passe`, `4.3:relecteur`, `5.3:explorateur`. Hors d'un circuit, elle vaut `verification` (une vérification lancée à la main), `tests` (un lancement ciblé), `nuit` et `ci` (la CI sur l'exécuteur du poste).
218
218
 
219
- **La table d'une phase** se recalcule chaque jour depuis les lignes de ses huit derniers jours : `coeurs` est le 95ᵉ centile des cœurs occupés (le temps de processeur divisé par la durée), arrondi à l'entier supérieur, au moins un ; `memoire` est le 95ᵉ centile du pic de mémoire de chaque mesure. Une quantité qui a moins de vingt mesures lisibles dans la fenêtre prend la valeur de départ, comme une phase sans ligne : 3 cœurs, et en mémoire le tiers du budget. Le plafond de cœurs (`limiteCoeurs`) est le maximum des cœurs occupés plus un quart, arrondi au cœur entier ; sans assez de mesures, la réservation plus un quart. Les travailleurs d'une passe valent ce plafond, non sa réservation : une suite qui profite de plus de cœurs que sa réservation le montre à la mesure, et sa réservation monte d'un recalcul à l'autre, d'environ un quart plus l'arrondi par pas, tant que la mesure maximale égale ses travailleurs ; une suite qui ne les sature pas ne monte pas. Chaque valeur est bornée par le budget. Huit jours couvrent une semaine de travail et le jour qui la suit, comme le recommandeur de Kubernetes ; vingt mesures au moins évitent qu'une phase rare réserve sur quelques exécutions.
219
+ **La table d'une phase** se recalcule chaque jour depuis les lignes de ses huit derniers jours : `coeurs` est le 95ᵉ centile des cœurs occupés (le temps de processeur divisé par la durée), arrondi à l'entier supérieur, au moins un ; `memoire` est le 95ᵉ centile du pic de mémoire de chaque mesure. Une quantité qui a moins de vingt mesures lisibles dans la fenêtre prend la valeur de départ, comme une phase sans ligne : 3 cœurs (ou le budget s'il en a moins), et en mémoire le budget divisé par les places, arrondi au-dessus (la part d'avant la spécialisation, grillhouse-3uv.126 ; jamais le tiers du budget entier d'un coup, ni un plancher proportionnel aux cœurs), relevée au pic mesuré plus un quart quand le registre en a un, le tout borné par le budget. Les cœurs de la machine se comptent sur sa topologie (`/proc/cpuinfo`), jamais sur l'affinité du processus qui mesure : un processus confiné à 6 cœurs calcule le même budget qu'un autre. Le plafond de cœurs (`limiteCoeurs`) est le maximum des cœurs occupés plus un quart, arrondi au cœur entier ; sans assez de mesures, la réservation plus un quart. Les travailleurs d'une passe valent ce plafond, non sa réservation : une suite qui profite de plus de cœurs que sa réservation le montre à la mesure, et sa réservation monte d'un recalcul à l'autre, d'environ un quart plus l'arrondi par pas, tant que la mesure maximale égale ses travailleurs ; une suite qui ne les sature pas ne monte pas. Chaque valeur est bornée par le budget. Huit jours couvrent une semaine de travail et le jour qui la suit, comme le recommandeur de Kubernetes ; vingt mesures au moins évitent qu'une phase rare réserve sur quelques exécutions.
220
220
 
221
221
  ### 4.3 Ce qui traverse l'arbitre
222
222
 
@@ -272,7 +272,7 @@ Une passe lancée hors d'un déroulé (une vérification à la main, un lancemen
272
272
  L'arbitre juge les demandes en attente à chaque changement de son état et toutes les `veilleMs`, dans l'ordre de leur rang, et accorde chacune qui passe ces conditions, dans cet ordre :
273
273
 
274
274
  1. la machine n'est pas fermée, et l'admission n'est pas suspendue par une alerte (§5.3) ;
275
- 2. aucune demande d'un rang plus petit n'a déjà été doublée 5 fois (`PASSAGES_MAX`, `scripts/regles-des-places.mjs`) : une demande qui tient passe devant celles qui attendent (le remplissage de Slurm, sans estimation de durée), et chaque attente de rang plus petit gagne un passage, compté par attente dans l'état de l'arbitre et emporté avec elle ; à la borne, rien ne passe devant elle jusqu'à son tour, et le refus dit « rang réservé : <ticket> attend, la borne de 5 passages est atteinte (<raison>) ». La borne compte des passages, non des minutes : une étape accordée devant la première peut tenir sa place longtemps. Les places de circuit gardent l'ordre d'arrivée (§5.4) ;
275
+ 2. aucune demande d'un rang plus petit n'a déjà été doublée 5 fois (`PASSAGES_MAX`, `scripts/regles-des-places.mjs`) : une demande qui tient passe devant celles qui attendent (le remplissage de Slurm, sans estimation de durée), et chaque attente de rang plus petit gagne un passage, compté par attente dans l'état de l'arbitre et emporté avec elle ; à la borne, rien ne passe devant elle jusqu'à son tour, sauf si sa réservation ne tient jamais dans le budget à vide : elle ne protège alors aucun rang, et son refus dit « ne tient jamais dans le budget du poste » avec ses chiffres ; le refus dit « rang réservé : <ticket> attend, la borne de 5 passages est atteinte (<raison>) ». La borne compte des passages, non des minutes : une étape accordée devant la première peut tenir sa place longtemps. Les places de circuit gardent l'ordre d'arrivée (§5.4) ;
276
276
  3. **sa réservation tient dans le budget** : ses cœurs dans ce que les réservations accordées laissent des cœurs du budget, sa mémoire dans ce qu'elles laissent de la mémoire du budget multipliée par le cran en vigueur ;
277
277
  4. **la machine a réellement de quoi la jouer à cet instant** : la mémoire réellement disponible, moins la réserve de l'utilisateur, couvre sa mémoire ; le dossier temporaire et le disque de sa copie ont chacun 4 Go libres ;
278
278
  5. pour une mesure de temps, des cœurs entiers sont libres, et aucune autre mesure ne joue.
@@ -383,7 +383,7 @@ Le relevé écrit une ligne pour chaque étape, séance comme passe. Une étape
383
383
  ## 6. Exécution
384
384
 
385
385
  - **Où** : l'arbitre tourne sur le travailleur de la machine, file de tâches `grillhouse-machine`, un par compte ; il démarre au premier appel s'il ne tourne pas (`USE_EXISTING`). Le groupe d'une étape est un scope transitoire de systemd du compte, sous le service de l'utilisateur, avec les contrôleurs de processeur, de mémoire et de cœurs délégués.
386
- - **Le groupe** : `CPUWeight` vaut cent fois les cœurs de la réservation, `MemoryAccounting=yes`, `MemoryMax` et `CPUQuota` valent le plafond de la phase de l'étape (§5.2) ; il vit sous `grillhouse.slice`, dont `MemoryMax` vaut la mémoire de la machine moins la réserve de l'utilisateur, et que systemd-oomd surveille sous la pression (`ManagedOOMMemoryPressure=kill`) ; une mesure de temps reçoit ses cœurs dédiés par `AllowedCPUs`, sinon par l'affinité de son lancement, en plus de sa réservation. Quand le contrôleur `cpuset` est délégué au compte, les programmes hors du cadre (`app.slice`) sont tenus hors des cœurs dédiés le temps de la mesure ; sans délégation, la mesure le dit une fois, avec le réglage du poste qui la donne ; dans l'enveloppe d'un agent, une mesure ne réserve ni n'attache rien, le dit, et n'est jamais refusée pour cela. Les outils d'une passe reçoivent le plafond de cœurs de sa phase dans `GRILLHOUSE_TRAVAILLEURS` (ses cœurs réservés quand la réservation n'a aucun plafond), borné par le budget ; une séance sous enveloppe n'en reçoit aucun.
386
+ - **Le groupe** : `CPUWeight` vaut cent fois les cœurs de la réservation, `MemoryAccounting=yes`, `MemoryMax` et `CPUQuota` valent le plafond de la phase de l'étape (§5.2) ; il vit sous `grillhouse.slice`, dont `MemoryMax` vaut la mémoire de la machine moins la réserve de l'utilisateur, et que systemd-oomd surveille sous la pression (`ManagedOOMMemoryPressure=kill`) ; une mesure de temps reçoit ses cœurs dédiés par `AllowedCPUs`, sinon par l'affinité de son lancement, en plus de sa réservation. Quand le contrôleur `cpuset` est délégué au compte, les programmes hors du cadre (`app.slice`) sont tenus hors des cœurs dédiés le temps de la mesure, et la restriction est levée à sa fin, interrompue comprise (signal) ; une restriction restée d'une mesure morte est levée par la suivante et à l'ouverture de l'arbitre ; sans délégation, la mesure le dit une fois, avec le réglage du poste qui la donne ; dans l'enveloppe d'un agent, une mesure ne réserve ni n'attache rien, le dit, et n'est jamais refusée pour cela. Les outils d'une passe reçoivent le plafond de cœurs de sa phase dans `GRILLHOUSE_TRAVAILLEURS` (ses cœurs réservés quand la réservation n'a aucun plafond), borné par le budget ; une séance sous enveloppe n'en reçoit aucun.
387
387
  - **La mémoire de la machine** : la veille de l'arbitre (§5.3) la tient pour toutes les étapes ; aucune passe ne porte de veille à elle.
388
388
  - **Le disque** : l'arbitre exige 4 Go libres sous le dossier temporaire et sur le disque de la copie de chaque étape (§5.2), et dit ce qui les occupe ; la place d'un circuit attend le disque d'une copie de plus (§5.4).
389
389
  - **Ce qui survit** : les places, les réservations, les attentes et la fermeture survivent au redémarrage du serveur et des travailleurs, dans l'histoire de l'arbitre ; au-delà de deux mille événements, l'arbitre continue dans une exécution neuve, son état en argument. Une réservation dont le demandeur est mort se libère au jugement suivant.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomi-fields/grillhouse",
3
- "version": "0.55.1",
3
+ "version": "0.55.2",
4
4
  "description": "Roomi's Grillhouse: the frame's scripts, called by one command, grillhouse <sous-commande>",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -13,7 +13,7 @@
13
13
  // of the launch, else not at all.
14
14
  // - The rest of the dedicated cores: the load of those cores alone, read from /proc/stat.
15
15
  import { readFileSync } from 'node:fs';
16
- import { availableParallelism } from 'node:os';
16
+ import { coeursDeLaMachine } from './mesure-de-la-machine.mjs';
17
17
  import { spawnSync } from 'node:child_process';
18
18
  import { paquetsDeLEnveloppe } from './enveloppe/paquets-du-plan.mjs';
19
19
  import { COEURS_PAR_DEFAUT } from './plafond-de-la-machine.mjs';
@@ -103,7 +103,7 @@ const lireUnFichier = chemin => {
103
103
  * reading of a file of the system (null when it does not read), for a trial
104
104
  * @returns {{ lisible: boolean, coeurs: { fils: number[], noeud: number }[] }}
105
105
  */
106
- export function lireLaTopologie({ lire = lireUnFichier, nombreDeFils = availableParallelism() } = {}) {
106
+ export function lireLaTopologie({ lire = lireUnFichier, nombreDeFils = coeursDeLaMachine() } = {}) {
107
107
  const cpu = n => `/sys/devices/system/cpu/cpu${n}/topology/thread_siblings_list`;
108
108
  const groupes = new Map();
109
109
  let lisible = true;
@@ -339,6 +339,23 @@ export function ecartDesProgrammes({ dedies, fils: tous }) {
339
339
  };
340
340
  }
341
341
 
342
+ /**
343
+ * Lifts the restriction a measure set on the programs out of the frame (`AllowedCPUs` of
344
+ * `app.slice`): the group may use every core again. Called at the end of a measure, interrupted
345
+ * one included, by the next measure, and when the arbiter opens, so that the restriction of a
346
+ * dead measure never outlives it. True when the system took it.
347
+ * @param {{ lancer?: (cmd: string, args: string[]) => number | null }} [o] the command, for a trial
348
+ * @returns {boolean}
349
+ */
350
+ export function leverLaRestriction({
351
+ lancer = (cmd, args) => spawnSync(cmd, args, { stdio: 'ignore', timeout: 20_000 }).status,
352
+ } = {}) {
353
+ // An empty value resets the group to every core of the machine.
354
+ return (
355
+ lancer('systemctl', ['--user', 'set-property', '--runtime', 'app.slice', 'AllowedCPUs=']) === 0
356
+ );
357
+ }
358
+
342
359
  /**
343
360
  * The busy and the total time of each thread, from the text of /proc/stat (hundredths of a
344
361
  * second): busy is user, nice, system, irq, softirq and steal; idle and iowait are rest. Null
@@ -8,7 +8,6 @@
8
8
  // (§3.1, §5.6).
9
9
  import { spawn, spawnSync } from 'node:child_process';
10
10
  import { appendFileSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
11
- import { cpus } from 'node:os';
12
11
  import path from 'node:path';
13
12
  import { fileURLToPath } from 'node:url';
14
13
 
@@ -165,9 +164,6 @@ export function sorteDeLaPasse(nom) {
165
164
  .replace(/^-|-$/g, '');
166
165
  }
167
166
 
168
- /** The cores of the machine. */
169
- export const coeursDeLaMachine = () => cpus().length;
170
-
171
167
  /**
172
168
  * What the scope <unite> reports now (`lireLeScope` of `systemctl --user show`); null when the
173
169
  * manager does not answer, the scope gone.
@@ -23,7 +23,7 @@ import { AttenteDeLaMachine } from './attente-de-la-machine.mjs';
23
23
  import { bilanDeLaConsommation, lireLaConsommation } from './consommation-des-passes.mjs';
24
24
  import { ecrireAtomique } from './mesure/avancement.mjs';
25
25
  import { budgetDeLaPasse } from './places-de-la-machine.mjs';
26
- import { partDe } from './plafond-de-la-machine.mjs';
26
+ import { partDe, plafondDe } from './plafond-de-la-machine.mjs';
27
27
  import { fichierDeLaTable, lireLaTable } from './table-des-consommations.mjs';
28
28
 
29
29
  const GO = 1024 ** 3;
@@ -54,7 +54,7 @@ const commandeDeLaPlanification = () => import('../dist/temporal/consommation/co
54
54
  function recalculer(racine, lignes) {
55
55
  return calculDeLaTable().tableDesPhases(lignes, {
56
56
  budget: budgetDeLaPasse(process.env),
57
- defaut: partDe({ budget: budgetDeLaPasse(process.env) }),
57
+ defaut: partDe({ budget: budgetDeLaPasse(process.env), places: plafondDe(process.env) }),
58
58
  maintenant: Date.now(),
59
59
  veille: lireLaTable(racine),
60
60
  });
@@ -46,6 +46,9 @@ export function uniteDeLEtape(id: string): string;
46
46
  /** The machine now: its cores, the cores occupied over ten seconds, its free memory in bytes. */
47
47
  export function mesureDeLaMachine(): MesureDeLaMachine;
48
48
 
49
+ /** The cores of the machine, on its topology, never the affinity of the process. */
50
+ export function coeursDeLaMachine(): number;
51
+
49
52
  /** The start of the process <pid> as the system gives it, null when it is gone. */
50
53
  export function departDe(pid: number): string | null;
51
54
 
@@ -8,7 +8,7 @@
8
8
  // (§3.1, §5.2).
9
9
  import { spawnSync } from 'node:child_process';
10
10
  import { readFileSync } from 'node:fs';
11
- import { availableParallelism, freemem, totalmem } from 'node:os';
11
+ import { cpus, freemem, totalmem } from 'node:os';
12
12
  import { departDe, leMemeVivant, vivant } from './mesure/base-de-passe.mjs';
13
13
 
14
14
  export { departDe };
@@ -150,6 +150,14 @@ export function memoireDisponible() {
150
150
  return memoireRestante().disponible ?? freemem();
151
151
  }
152
152
 
153
+ /**
154
+ * The cores of the machine, counted on its topology (the processors the system lists), never on
155
+ * the affinity of the calling process: a process confined to 6 cores sees the same machine, so the
156
+ * budget does not depend on who measures it.
157
+ * @returns {number}
158
+ */
159
+ export const coeursDeLaMachine = () => Math.max(1, cpus().length);
160
+
153
161
  /** The window the cores occupied are read on, in ms: the last ten seconds. */
154
162
  export const FENETRE_DE_CHARGE_MS = 10_000;
155
163
 
@@ -241,7 +249,7 @@ function coeursOccupesMaintenant(coeurs) {
241
249
  * @returns {{ coeurs: number, charge: number, memoireLibre: number, memoireTotale: number }}
242
250
  */
243
251
  export const mesureDeLaMachine = () => {
244
- const coeurs = availableParallelism();
252
+ const coeurs = coeursDeLaMachine();
245
253
  return {
246
254
  coeurs,
247
255
  charge: coeursOccupesMaintenant(coeurs),
@@ -0,0 +1,36 @@
1
+ // A project holds the table of the consumptions of its phases: the reservation of a step comes
2
+ // from it (machine.md §5.2, §5.6), and a project mounted before the first daily recalculation had
3
+ // none, so every phase took the default part. The migration writes it once
4
+ // (`grillhouse consommation --ecrire`); the daily recalculation then rewrites it. Mechanism:
5
+ // installation.md §5.4 (packages/grillhouse/docs/architecture/).
6
+ import { existsSync } from 'node:fs';
7
+ import { consommation } from '../consommation.mjs';
8
+ import { fichierDeLaTable } from '../table-des-consommations.mjs';
9
+
10
+ // No version before its release: `grillhouse sortie` numbers it.
11
+ export const version = '0.55.2';
12
+ export const nom = 'table des consommations';
13
+
14
+ /**
15
+ * The table of the consumptions written for <projet> when it holds none; returns what it could not do (the writing itself is silent: the table is data).
16
+ * A table already there is left to the daily recalculation.
17
+ * @param {string} projet
18
+ * @param {{ ecrire?: (racine: string) => number | Promise<number> }} [o] the writing, for a trial
19
+ * @returns {string[]}
20
+ */
21
+ export function migrer(projet, { ecrire } = {}) {
22
+ const fichier = fichierDeLaTable(projet);
23
+ if (fichier === null || existsSync(fichier)) {
24
+ return [];
25
+ }
26
+ const jouer =
27
+ ecrire ?? (racine => consommation({ args: ['--ecrire'], racine, ecrire: () => undefined }));
28
+ try {
29
+ const code = jouer(projet);
30
+ return existsSync(fichier)
31
+ ? []
32
+ : [`la table des consommations n'est pas écrite (code ${String(code)}) : \`grillhouse consommation --ecrire\` la pose`];
33
+ } catch (e) {
34
+ return [`la table des consommations n'est pas écrite : ${(e instanceof Error ? e.message : String(e))}`];
35
+ }
36
+ }
@@ -55,6 +55,7 @@ import * as reservationDeTroisCoeurs from './migrations/0.49.0-reservation-de-tr
55
55
  import * as reglagesHorsDeLaCharte from './migrations/0.50.0-reglages-hors-de-la-charte.mjs';
56
56
  import * as lireUnTicket from './migrations/lire-un-ticket.mjs';
57
57
  import * as partRetiree from './migrations/part-retiree.mjs';
58
+ import * as tableDesConsommations from './migrations/table-des-consommations.mjs';
58
59
  import * as nuitYmlRetire from './migrations/nuit-yml-retire.mjs';
59
60
  import * as serveursDeLIndex from './migrations/serveurs-de-l-index.mjs';
60
61
  import * as coutDesJetons from './migrations/cout-des-jetons-au-registre.mjs';
@@ -89,6 +90,7 @@ export const MIGRATIONS = [
89
90
  suiviDuSuperviseurRetire,
90
91
  lireUnTicket,
91
92
  partRetiree,
93
+ tableDesConsommations,
92
94
  nuitYmlRetire,
93
95
  ];
94
96
 
@@ -29,8 +29,8 @@
29
29
  import { spawnSync } from 'node:child_process';
30
30
  import { randomUUID } from 'node:crypto';
31
31
  import { readFileSync } from 'node:fs';
32
+ import { coeursDeLaMachine } from './mesure-de-la-machine.mjs';
32
33
  import {
33
- coeursDeLaMachine,
34
34
  depasseLaPart,
35
35
  garderLaConsommation,
36
36
  marquesDeLaPasse,
@@ -148,7 +148,9 @@ export function commandeDuGroupe({
148
148
  'MemoryAccounting=yes',
149
149
  '-p',
150
150
  `CPUWeight=${poidsDeLaPart(part)}`,
151
- ...(memoire ? ['-p', `MemoryMax=${Math.floor(part.limite ?? part.memoire)}`] : []),
151
+ ...(memoire && Math.floor(part.limite ?? part.memoire) > 0
152
+ ? ['-p', `MemoryMax=${Math.floor(part.limite ?? part.memoire)}`]
153
+ : []),
152
154
  ...(plafond ? ['-p', `CPUQuota=${(part.limiteCoeurs ?? part.coeurs) * 100}%`] : []),
153
155
  ...(fils ? ['-p', `AllowedCPUs=${listeDeCoeurs(fils)}`] : []),
154
156
  '--',
@@ -615,6 +617,26 @@ export function avecLaPasse(
615
617
  }
616
618
  rendreLesCoeurs = () => void ecarter({ dedies: [], fils: tous });
617
619
  }
620
+ // An interrupted measure (SIGINT, SIGTERM, SIGHUP) lifts the restriction before it dies: the
621
+ // end of the `finally` below is not reached when a signal kills the process.
622
+ const signaux = ['SIGINT', 'SIGTERM', 'SIGHUP'];
623
+ const fin = signal => {
624
+ rendreLesCoeurs();
625
+ for (const s of signaux) {
626
+ process.removeListener(s, fin);
627
+ }
628
+ process.kill(process.pid, signal);
629
+ };
630
+ if (attache?.voie === 'groupe') {
631
+ for (const s of signaux) {
632
+ process.once(s, fin);
633
+ }
634
+ }
635
+ const retirerLesSignaux = () => {
636
+ for (const s of signaux) {
637
+ process.removeListener(s, fin);
638
+ }
639
+ };
618
640
  const identite = {
619
641
  racine,
620
642
  sorte: sorteLue,
@@ -721,6 +743,7 @@ export function avecLaPasse(
721
743
  rendreLAffinite();
722
744
  }
723
745
  } finally {
746
+ retirerLesSignaux();
724
747
  rendreLesCoeurs();
725
748
  }
726
749
  } finally {
@@ -29,7 +29,6 @@
29
29
  // to the tool of each language (GRILLHOUSE_TRAVAILLEURS).
30
30
  import { spawnSync } from 'node:child_process';
31
31
  import { readFileSync } from 'node:fs';
32
- import { availableParallelism } from 'node:os';
33
32
  import path from 'node:path';
34
33
  import { departDe } from './mesure/base-de-passe.mjs';
35
34
  import { coeursDeLaMesureDe, mesureDeclareeDe } from './coeurs-dedies.mjs';
@@ -37,7 +36,7 @@ import { A_REPASSER } from './codes-de-sortie.mjs';
37
36
  import { AttenteDeLaMachine, borneDe, racineDuDepot } from './attente-de-la-machine.mjs';
38
37
  import { paquetsDeLEnveloppe } from './enveloppe/paquets-du-plan.mjs';
39
38
  import { ecrireLaTrace, traceDesPlaces } from './journal-des-etats.mjs';
40
- import { mesureDeLaMachine } from './mesure-de-la-machine.mjs';
39
+ import { coeursDeLaMachine, mesureDeLaMachine } from './mesure-de-la-machine.mjs';
41
40
  import {
42
41
  budgetDe,
43
42
  partDe,
@@ -122,7 +121,7 @@ const PONT = path.join(import.meta.dirname, 'places-du-serveur.mjs');
122
121
  * @returns {number}
123
122
  */
124
123
  export function travailleursDe({
125
- coeurs = availableParallelism(),
124
+ coeurs = coeursDeLaMachine(),
126
125
  places,
127
126
  env = process.env,
128
127
  } = {}) {
@@ -380,7 +379,7 @@ export function budgetDeLaPasse(env = process.env) {
380
379
  /**
381
380
  * The reservation of a pass of the phase <phase> of the project at <racine> under <env>: the cores
382
381
  * and the memory the table of the consumptions of the project gives that phase, else the default
383
- * reservation of the budget (`partDe`: 3 cores); and its ceiling (`limite` in bytes,
382
+ * reservation of the budget (`partDe`: 3 cores, the budget divided by the places); and its ceiling (`limite` in bytes,
384
383
  * `limiteCoeurs`: where the group of the step is cut), that of the line of its phase, else its
385
384
  * reservation plus a quarter; all within the budget of the machine. No key of the `package.json`
386
385
  * of the project enters it.
@@ -396,7 +395,7 @@ export function reservationDeLaPasse({ racine, env = process.env, phase }) {
396
395
  coeurs: Math.max(1, Math.min(budget.coeurs, voulue.coeurs)),
397
396
  memoire: Math.min(budget.memoire, voulue.memoire),
398
397
  }
399
- : partDe({ budget });
398
+ : partDe({ budget, places: plafondDe(env) });
400
399
  const depart = plafondDeDepart({ coeurs, memoire }, budget);
401
400
  return {
402
401
  coeurs,
@@ -36,6 +36,7 @@ import net from 'node:net';
36
36
  import path from 'node:path';
37
37
  import { pathToFileURL } from 'node:url';
38
38
  import { A_REPASSER } from './codes-de-sortie.mjs';
39
+ import { leverLaRestriction } from './coeurs-dedies.mjs';
39
40
  import { duree, RAISON_FERMEE } from './regles-des-places.mjs';
40
41
 
41
42
  // The start of the reason of a wait under the supervisor's closure.
@@ -180,6 +181,21 @@ function construireLeClient() {
180
181
  return r.status === 0 && existsSync(path.join(DIST, 'places', 'client.js'));
181
182
  }
182
183
 
184
+ /**
185
+ * Opens the arbiter when none runs. No measure holds a place when it opens, so the restriction a
186
+ * dead measure left on the programs out of the frame is lifted then (`lever`).
187
+ * @param {{ places: { demarrerLesPlaces: Function }, client: unknown, entree: unknown, file: string,
188
+ * lever?: () => unknown }} o
189
+ * @returns {Promise<boolean>} true when this call opened the arbiter
190
+ */
191
+ export async function ouvrirLArbitre({ places, client, entree, file, lever = leverLaRestriction }) {
192
+ const ouvert = await places.demarrerLesPlaces(client, entree, { file });
193
+ if (ouvert) {
194
+ lever();
195
+ }
196
+ return ouvert;
197
+ }
198
+
183
199
  // The call <mode> with <args>: its exit code.
184
200
  async function principal(mode, args) {
185
201
  if (!Object.hasOwn(MODES, mode ?? '') || args.length !== MODES[mode]) {
@@ -204,10 +220,8 @@ async function principal(mode, args) {
204
220
  const sous = f => avecReprises(() => c.client.connection.withDeadline(Date.now() + DELAI_MS, f));
205
221
  try {
206
222
  try {
207
- await sous(async () =>
208
- places.demarrerLesPlaces(c.client, entreeDe(), {
209
- file: FILE_DE_LA_MACHINE,
210
- })
223
+ await sous(() =>
224
+ ouvrirLArbitre({ places, client: c.client, entree: entreeDe(), file: FILE_DE_LA_MACHINE })
211
225
  );
212
226
  } catch (x) {
213
227
  if (x?.name !== 'WorkflowExecutionAlreadyStartedError') {
@@ -42,7 +42,7 @@ export function budgetDe(
42
42
  ): PartDeLaPasse;
43
43
 
44
44
  /** The default reservation of a pass: 3 cores within the budget, the default memory within it. */
45
- export function partDe(o: { budget: PartDeLaPasse; pic?: number }): PartDeLaPasse;
45
+ export function partDe(o: { budget: PartDeLaPasse; pic?: number; places?: number }): PartDeLaPasse;
46
46
 
47
47
  /** The ceiling of a part without a measure: its reservation plus a quarter, within the budget. */
48
48
  export function plafondDeDepart(
@@ -20,12 +20,13 @@
20
20
  // - The budget is the cores and the memory of the machine less the reserve; a reserve that leaves
21
21
  // no core or no memory is refused by its name.
22
22
  // - The default reservation of a pass (`partDe`) is 3 cores, within the budget and one core at
23
- // least, and its memory the share of the budget that max(4, a third of its cores) cores hold,
23
+ // least, and its memory the budget divided by the places (the ceiling of the places, 3 by default),
24
24
  // raised to the largest peak given plus a quarter, within the budget. A project's table of the
25
25
  // consumptions gives a phase its own (`reservationDeLaPasse` of ./places-de-la-machine.mjs).
26
26
  import { readFileSync } from 'node:fs';
27
- import { cpus, totalmem } from 'node:os';
27
+ import { totalmem } from 'node:os';
28
28
  import path from 'node:path';
29
+ import { coeursDeLaMachine } from './mesure-de-la-machine.mjs';
29
30
  import {
30
31
  avecLeFichierDuPoste,
31
32
  configurationDuPoste,
@@ -46,7 +47,7 @@ export const RESERVE_COEURS_PAR_DEFAUT = 4;
46
47
  export const RESERVE_MEMOIRE_GO_PAR_DEFAUT = 4;
47
48
  /** The cores the reservation of an ordinary pass holds when its project declares none. */
48
49
  export const COEURS_PAR_DEFAUT = 3;
49
- // The cores the reserve of the user leaves the passes at least; the floor of the memory.
50
+ // The cores the reserve of the user leaves the passes at least.
50
51
  const COEURS_LAISSES_AUX_PASSES = 4;
51
52
 
52
53
  /**
@@ -120,10 +121,10 @@ function entierDuPoste(env, nom, defaut, lire) {
120
121
  * @throws {Error} naming the variable whose value is not a whole number ≥ 0
121
122
  */
122
123
  export function reserveDe(env = process.env, o = {}) {
123
- const coeursDeLaMachine = o.coeurs ?? cpus().length;
124
+ const coeursDuPoste = o.coeurs ?? coeursDeLaMachine();
124
125
  const parDefaut = Math.min(
125
126
  RESERVE_COEURS_PAR_DEFAUT,
126
- Math.max(0, coeursDeLaMachine - COEURS_LAISSES_AUX_PASSES)
127
+ Math.max(0, coeursDuPoste - COEURS_LAISSES_AUX_PASSES)
127
128
  );
128
129
  return {
129
130
  coeurs: entierDuPoste(env, VARIABLE_RESERVE_COEURS, parDefaut, o.lire),
@@ -157,18 +158,14 @@ export function budgetDe({ coeurs, memoireTotale }, reserve) {
157
158
  /** The margin over the largest measured peak of memory: a quarter. */
158
159
  const MARGE_DE_LA_MEMOIRE = 1.25;
159
160
 
160
- // The default memory: its floor, the proportion of the budget a part of 4 cores held (or a third
161
- // of the budget rounded up when that is more), raised to the largest measured peak <pic> plus a
161
+ // The default memory: its floor, the budget divided by the places (the part before the
162
+ // specialisation, grillhouse-3uv.126), rounded up, raised to the largest measured peak <pic> plus a
162
163
  // quarter (the hard ceiling of the group kills a pass above it) when the register measured more. A
163
164
  // register that holds light passes alone (the guards, a pass of 50 ms: a peak of 16 Mo) would
164
165
  // else give the next pass a ceiling its kernel kills it under, as the Vertical Pod Autoscaler
165
166
  // bounds its recommendation by a minimum (`minAllowed`).
166
- function memoireParDefautDe(budget, pic) {
167
- const coeursDAvant = Math.max(
168
- 1,
169
- Math.min(budget.coeurs, Math.max(COEURS_LAISSES_AUX_PASSES, Math.ceil(budget.coeurs / 3)))
170
- );
171
- const plancher = Math.floor((budget.memoire * coeursDAvant) / budget.coeurs);
167
+ function memoireParDefautDe(budget, pic, places) {
168
+ const plancher = Math.ceil(budget.memoire / Math.max(1, places));
172
169
  return Math.min(budget.memoire, Math.max(plancher, Math.floor((pic ?? 0) * MARGE_DE_LA_MEMOIRE)));
173
170
  }
174
171
 
@@ -177,13 +174,14 @@ function memoireParDefautDe(budget, pic) {
177
174
  * the default memory within the budget. A project's table of the consumptions gives a phase its own
178
175
  * measure (`reservationDeLaPasse` of ./places-de-la-machine.mjs); no key of its `package.json`
179
176
  * enters it.
180
- * @param {{ budget: { coeurs: number, memoire: number }, pic?: number }} o
177
+ * @param {{ budget: { coeurs: number, memoire: number }, pic?: number, places?: number }} o
178
+ * `places`, the ceiling of the places (3 by default)
181
179
  * @returns {{ coeurs: number, memoire: number }}
182
180
  */
183
- export function partDe({ budget, pic }) {
181
+ export function partDe({ budget, pic, places = PLAFOND_PAR_DEFAUT }) {
184
182
  return {
185
183
  coeurs: Math.max(1, Math.min(budget.coeurs, COEURS_PAR_DEFAUT)),
186
- memoire: Math.min(budget.memoire, memoireParDefautDe(budget, pic)),
184
+ memoire: Math.min(budget.memoire, memoireParDefautDe(budget, pic, places)),
187
185
  };
188
186
  }
189
187
 
@@ -203,7 +201,7 @@ export const plafondDeDepart = (part, budget) => ({
203
201
  * The hardware of this machine: its cores and its total memory (bytes).
204
202
  * @returns {{ coeurs: number, memoireTotale: number }}
205
203
  */
206
- export const materielDeLaMachine = () => ({ coeurs: cpus().length, memoireTotale: totalmem() });
204
+ export const materielDeLaMachine = () => ({ coeurs: coeursDeLaMachine(), memoireTotale: totalmem() });
207
205
 
208
206
  /**
209
207
  * The budget of this machine under <env>: its hardware less the reserve of the user.
@@ -86,6 +86,8 @@ export function refusDeLaReservation(
86
86
  rang: number;
87
87
  ticket?: string | null;
88
88
  raison?: string;
89
+ coeurs?: number;
90
+ memoire?: number;
89
91
  /** The requests that fit and were granted before it. */
90
92
  passages?: number;
91
93
  }[];
@@ -174,8 +174,14 @@ export function refusDeLaReservation(
174
174
  }
175
175
  // A request that fits passes before the waits of a lower rank, until one of them has been
176
176
  // passed PASSAGES_MAX times (the backfill of Slurm, bounded in passages, not in minutes).
177
+ // A wait whose reservation can never fit in the budget (unschedulable, as Kubernetes refuses it
178
+ // at admission) protects no rank: no other wait is held back for it.
179
+ const tientUnJour = a =>
180
+ a.coeurs === undefined ||
181
+ a.memoire === undefined ||
182
+ partDansLeBudget({ part: a, budget, prises: [], cran }).ok;
177
183
  const bloquante = etat.attentes.find(
178
- a => a.id !== id && a.rang < rang && (a.passages ?? 0) >= PASSAGES_MAX
184
+ a => a.id !== id && a.rang < rang && (a.passages ?? 0) >= PASSAGES_MAX && tientUnJour(a)
179
185
  );
180
186
  if (bloquante) {
181
187
  return `rang réservé : ${bloquante.ticket ?? 'une étape'} attend, la borne de ${PASSAGES_MAX} passages est atteinte (${bloquante.raison})`;
@@ -183,7 +189,9 @@ export function refusDeLaReservation(
183
189
  const prises = etat.prises.filter(p => p.id !== id);
184
190
  const tient = partDansLeBudget({ part: reservation, budget, prises, cran });
185
191
  if (!tient.ok) {
186
- return tient.raison;
192
+ return partDansLeBudget({ part: reservation, budget, prises: [], cran }).ok
193
+ ? tient.raison
194
+ : `ne tient jamais dans le budget du poste, ${tient.raison}`;
187
195
  }
188
196
  const mesure = mesurer();
189
197
  const parties = prises.filter(p => maintenant - (p.depuis ?? 0) < FENETRE_DE_DEPART_MS);
@@ -294,6 +294,9 @@ export const phaseDuFait = (fait, parametres) => {
294
294
  if (fait === 'seanceDuGeste') {
295
295
  return phaseDeLaSeance('explorateur', 'geste');
296
296
  }
297
+ if (fait === 'relecture') {
298
+ return phaseDeLaSeance('relecteur', undefined);
299
+ }
297
300
  return fait === 'seance' && typeof parametres.role === 'string'
298
301
  ? phaseDeLaSeance(
299
302
  parametres.role,