@mark1russell7/harness 0.14.1 → 0.14.3
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.
- package/README.md +23 -0
- package/build/{cell-BccWKiXh.d.ts → cell-B3-BSTit.d.ts} +117 -4
- package/build/{image-Lg8LL6C3.js → image-BMdV7yWD.js} +154 -11
- package/build/image-BMdV7yWD.js.map +1 -0
- package/build/index.d.ts +548 -106
- package/build/index.js +1193 -44
- package/build/index.js.map +1 -1
- package/build/schema.d.ts +1 -1
- package/build/schema.js +1 -1
- package/image/mongo/client-mongo.mjs +5 -3
- package/image/native/src/bin/inject.rs +40 -13
- package/package.json +1 -1
- package/build/image-Lg8LL6C3.js.map +0 -1
package/build/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as RunRoute, A as MiddleboxExpectation, B as Reference, C as HopWrite, D as KernelRecord, E as Jitter, F as ProbeEvent, G as RouterHop, H as ReplicaSetStage, I as ProxyHop, J as RunBackup, K as RttRange, L as ProxyTime, M as Observer, N as PinnedImage, O as LineMatch, P as Prediction, Q as RunPart, R as Reconnects, S as HopSignal, T as ImageSource, U as Replies, V as ReplicaSet, W as RequestPrediction, X as RunFabric, Y as RunDrill, Z as RunGroup, _ as GroupPrediction, a as Cluster, at as Stage, b as HopEvent, c as Drill, ct as Target, d as Fabric, dt as WsProbe, et as RunTopology, f as FabricManifest, ft as isHopPlace, g as GroupPlace, h as Group, i as ClientImage, it as ShippedImage, j as MiddleboxForm, k as MiddleboxEvent, l as DriverBand, lt as Topology, m as FaultPlace, n as Cell, nt as SentinelStage, o as ClusterClientAt, ot as StageBand, p as Fault, pt as latestEndOf, q as Run, r as Client, rt as Shipped, s as ClusterStage, st as Subject, t as BuildImage, tt as SentinelEvent, u as DriverStep, ut as Toxic, v as GroupRole, w as HttpProbe, x as HopPlace, y as Hop, z as Recovers } from "./cell-B3-BSTit.js";
|
|
2
2
|
import { Quantity } from "@mark1russell7/quantity";
|
|
3
|
-
import "testcontainers";
|
|
3
|
+
import { StartedTestContainer } from "testcontainers";
|
|
4
4
|
//#region src/application.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* This module reads the acts of the program of the observer: its heartbeat, its drop of the
|
|
@@ -204,6 +204,74 @@ export declare const referenceOf: (run: Run, from: Reference, role: string, data
|
|
|
204
204
|
*/
|
|
205
205
|
export declare const measureDriver: (cell: Cell, run: Run) => Measured;
|
|
206
206
|
//#endregion
|
|
207
|
+
//#region src/recovery.d.ts
|
|
208
|
+
/**
|
|
209
|
+
* This module holds the pure parts of a recovery drill. These are the scripts of the shell, the reader
|
|
210
|
+
* of the output of `bsondump`, and the set check of a recovery. It has no container, thus unit tests
|
|
211
|
+
* run it. `drill.ts` does the drill on a lab.
|
|
212
|
+
*
|
|
213
|
+
* A dump with `--oplog` reads the oplog from the start of the dump to its end. A slice reads the
|
|
214
|
+
* oplog after the last entry of the backup before it. Thus the backups together hold each write up
|
|
215
|
+
* to the last entry of the last backup, and no write after it. One writer sends the writes one at a
|
|
216
|
+
* time, thus the highest sequence number is also the latest write.
|
|
217
|
+
*/
|
|
218
|
+
/** This size is one document of generated data. A tenant holds as many documents as its size needs. */
|
|
219
|
+
export declare const SEED_DOCUMENT = 65536;
|
|
220
|
+
/** This count is how far the lost writes can be from the writes after the last backup: the writes in flight at the fault. */
|
|
221
|
+
export declare const LOSS_MARGIN = 2;
|
|
222
|
+
/** This function gives the time of a drill from the start of the backups to the fault, in seconds. */
|
|
223
|
+
export declare const drillSpan: (drill: Drill) => number;
|
|
224
|
+
/**
|
|
225
|
+
* This script writes the generated data of each tenant into the collection `tenants`. Each write
|
|
226
|
+
* waits for `copies` members, thus each member holds the data when the script ends.
|
|
227
|
+
*/
|
|
228
|
+
export declare const seedScript: (drill: Drill, copies: number) => string;
|
|
229
|
+
/** This script prints the hash of the collection `tenants`. It takes locks, thus a run reads it with no writer. */
|
|
230
|
+
export declare const HASH_SCRIPT: string;
|
|
231
|
+
/** This function gives the hash from the output of `HASH_SCRIPT`. */
|
|
232
|
+
export declare const hashOf: (text: string) => string;
|
|
233
|
+
/** This function gives the command of a server with no set, on its own port. A client of the set cannot reach that server, and a restore writes to it. */
|
|
234
|
+
export declare const standaloneCommand: (set: ReplicaSet, port: number) => string;
|
|
235
|
+
/**
|
|
236
|
+
* This script waits for the end of the server of a box, and it can stop the server first. `kill -0`
|
|
237
|
+
* also succeeds on a zombie, and the shell of the box can leave its child as a zombie for a long
|
|
238
|
+
* time. Thus the script reads the state of the process, and a zombie has ended.
|
|
239
|
+
*/
|
|
240
|
+
export declare const stopScript: (terminate: boolean) => string;
|
|
241
|
+
/** An oplog time is the `ts` of an oplog entry: a time in seconds, and the count of the entry in that second. */
|
|
242
|
+
interface OplogTime {
|
|
243
|
+
readonly t: number;
|
|
244
|
+
readonly i: number;
|
|
245
|
+
}
|
|
246
|
+
/** An oplog read is what an oplog file holds: its last entry, and the highest sequence number that it inserts. */
|
|
247
|
+
interface OplogRead {
|
|
248
|
+
readonly last: OplogTime | null;
|
|
249
|
+
readonly highest: number | null;
|
|
250
|
+
}
|
|
251
|
+
/** This function reads an oplog file from the output of `bsondump`. Only an insert into `cells.w` is a write of a client. */
|
|
252
|
+
export declare const readOplog: (text: string) => OplogRead;
|
|
253
|
+
/** This function gives the highest sequence number of the file of the writes in a dump, from the output of `bsondump`, or null. */
|
|
254
|
+
export declare const highestHeld: (text: string) => number | null;
|
|
255
|
+
/** This function gives the query of a slice of the oplog: each entry after an oplog time, in Extended JSON. */
|
|
256
|
+
export declare const sliceQuery: (after: OplogTime) => string;
|
|
257
|
+
/** A recovery measurement is what a drill found, beside the writes of the run. */
|
|
258
|
+
interface RecoveryMeasured {
|
|
259
|
+
/** This time is from the reply to the last accepted write that the store kept to the fault, or null with no such write. */
|
|
260
|
+
readonly rpo: Quantity | null;
|
|
261
|
+
/** This time is `rpo` less the age of the drill: what a schedule adds to its interval. It is null for a control and for an election. */
|
|
262
|
+
readonly excess: Quantity | null;
|
|
263
|
+
/** These are the accepted writes that the store lost, below a write that it kept. A restore must leave none. */
|
|
264
|
+
readonly holes: readonly number[];
|
|
265
|
+
/** This count is the number of accepted writes after the last write of the last backup, or null without a backup. */
|
|
266
|
+
readonly afterBackup: number | null;
|
|
267
|
+
/** This flag tells if the tenants have the same data after the recovery, or null when that is not known. */
|
|
268
|
+
readonly sameData: boolean | null;
|
|
269
|
+
}
|
|
270
|
+
/** This function gives the measurement of a drill, from its run. `t0` is the fault. */
|
|
271
|
+
export declare const recoveryOf: (drill: Drill, run: Run, t0: number) => RecoveryMeasured;
|
|
272
|
+
/** This function gives the findings of a drill: each rule of a recovery that its run broke. */
|
|
273
|
+
export declare const recoveryFindings: (measured: RecoveryMeasured, writes: Writes) => string[];
|
|
274
|
+
//#endregion
|
|
207
275
|
//#region src/timeline.d.ts
|
|
208
276
|
/**
|
|
209
277
|
* This module measures a run of a group cell. It gives the first write that a primary accepted
|
|
@@ -249,6 +317,8 @@ interface GroupMeasured {
|
|
|
249
317
|
readonly errors: readonly ErrorOnTheWay[];
|
|
250
318
|
/** These are the delays of the stamps of the observer after the writes of the Sentinels, for a calibration. */
|
|
251
319
|
readonly lags?: readonly Quantity[];
|
|
320
|
+
/** This is what a recovery drill measured, for a drill only. */
|
|
321
|
+
readonly recovery?: RecoveryMeasured;
|
|
252
322
|
}
|
|
253
323
|
/** This function gives the time of each stage of a timeline from an instant: the first announcement of each, after the instant. */
|
|
254
324
|
export declare const stagesOf: (timeline: readonly SentinelEvent[], from: number) => Partial<Record<Stage, Quantity>>;
|
|
@@ -435,6 +505,8 @@ interface Verdict {
|
|
|
435
505
|
readonly median: Quantity | null;
|
|
436
506
|
/** This interval is the order-statistic interval of the median at 95 %, or the whole range for fewer than six runs. */
|
|
437
507
|
readonly medianInterval: Interval | null;
|
|
508
|
+
/** This time is the slowest reply of a cell that measures a distribution. A closed loop hides the sends in a stall, thus a quantile is a lower bound, and this maximum is not. */
|
|
509
|
+
readonly slowest?: Quantity;
|
|
438
510
|
/** This record is the sum of what reordering did in each counted run of a measurement-only cell. */
|
|
439
511
|
readonly reordering?: Reordering;
|
|
440
512
|
/** This record is the time of the proxy of a calibration cell, in each direction. */
|
|
@@ -761,6 +833,378 @@ export declare const jitterOf: (cell: Cell, run: Run) => Jitter;
|
|
|
761
833
|
*/
|
|
762
834
|
export declare const requestOf: (events: readonly ProbeEvent[]) => RequestReading | null;
|
|
763
835
|
//#endregion
|
|
836
|
+
//#region src/fabric.d.ts
|
|
837
|
+
/**
|
|
838
|
+
* A fabric is a routed network between the client and the target, on layer E3 (docs/S7.md). Four
|
|
839
|
+
* routers of FRRouting, two leaves and two spines, run real BGP over veth pairs that containerlab
|
|
840
|
+
* makes. The client hangs off leaf1 and the target off leaf2. The path between them goes through
|
|
841
|
+
* spine1 by a weight, and spine2 holds the other path. A cell silences spine1, and the routes of
|
|
842
|
+
* the leaves move to spine2 when a detector of the routers fires.
|
|
843
|
+
*
|
|
844
|
+
* This file holds the plan of the fabric as pure functions, and `openFabric` that starts it. A lab
|
|
845
|
+
* opens a fabric with `Topology.fabric`. Thus the client, the target, the prober and the verdict
|
|
846
|
+
* stay the same as on layer E1. The fabric needs a Linux host with containerlab and sudo.
|
|
847
|
+
*/
|
|
848
|
+
/** This image is FRRouting 10.7.1, pinned by digest. */
|
|
849
|
+
export declare const FRR_IMAGE = "quay.io/frrouting/frr:10.7.1@sha256:e995beaa50fdc9edb35eadcfefa29b7f062cc06f2b812613789b68fa541554d2";
|
|
850
|
+
/** This device is the side of the fabric in the client and in the target. Docker keeps eth0. */
|
|
851
|
+
export declare const FABRIC_DEVICE = "eth1";
|
|
852
|
+
/** This address is the client on its network behind leaf1. */
|
|
853
|
+
export declare const FABRIC_CLIENT = "10.1.0.2";
|
|
854
|
+
/** This address is the target on its network behind leaf2. */
|
|
855
|
+
export declare const FABRIC_TARGET = "10.2.0.2";
|
|
856
|
+
/** A router is one box of the fabric, as data. */
|
|
857
|
+
interface Router {
|
|
858
|
+
readonly name: string;
|
|
859
|
+
readonly as: number;
|
|
860
|
+
readonly id: string;
|
|
861
|
+
readonly interfaces: Readonly<Record<string, string>>;
|
|
862
|
+
readonly neighbors: ReadonlyArray<{
|
|
863
|
+
readonly address: string;
|
|
864
|
+
readonly as: number;
|
|
865
|
+
readonly weight?: number;
|
|
866
|
+
}>;
|
|
867
|
+
/** This prefix is the network behind a leaf, which its BGP advertises. */
|
|
868
|
+
readonly network?: string;
|
|
869
|
+
/** This prefix is the network behind the other leaf. A move is a change of its route. */
|
|
870
|
+
readonly remote?: string;
|
|
871
|
+
}
|
|
872
|
+
/** These are the routers. Each leaf prefers spine1 by a weight of 100, thus the path of each run is known. */
|
|
873
|
+
export declare const ROUTERS: readonly Router[];
|
|
874
|
+
/** This text is the `daemons` file of each router: BGP and BFD, on top of what FRRouting always starts. */
|
|
875
|
+
export declare const DAEMONS: string;
|
|
876
|
+
/**
|
|
877
|
+
* This function gives the configuration of a router. Graceful restart is off: after a hold expiry,
|
|
878
|
+
* a helper can keep the stale routes, and the move that a cell measures does not come.
|
|
879
|
+
* `maximum-paths 1` keeps one path, thus a move is one change of one route.
|
|
880
|
+
*/
|
|
881
|
+
export declare const frrConf: (router: Router, fabric: Fabric) => string;
|
|
882
|
+
/**
|
|
883
|
+
* This function gives the topology file of containerlab. The client and the target are containers
|
|
884
|
+
* of the lab, and the fabric adds a device to each. Each link has the MTU of a Docker network, thus
|
|
885
|
+
* a segment is as long as on layer E1. The default of containerlab is 9500. The management network
|
|
886
|
+
* belongs to the lab, and Docker chooses its subnet.
|
|
887
|
+
*/
|
|
888
|
+
export declare const topologyOf: (lab: string, dir: string, client: string, target: string) => string;
|
|
889
|
+
/** A route line is one line of `ip -ts -o monitor route`, with its time on the wall clock in ms. */
|
|
890
|
+
interface RouteLine {
|
|
891
|
+
readonly wall: number;
|
|
892
|
+
readonly deleted: boolean;
|
|
893
|
+
readonly prefix: string;
|
|
894
|
+
readonly via: string | null;
|
|
895
|
+
readonly dev: string | null;
|
|
896
|
+
}
|
|
897
|
+
/** This function reads a line of `ip -ts -o monitor route`, or it gives null for another line. The clock of a container is UTC. */
|
|
898
|
+
export declare const routeLine: (text: string) => RouteLine | null;
|
|
899
|
+
/** A clock pair is one instant on the monotonic clock in ns and on the wall clock in ms. */
|
|
900
|
+
interface ClockPair {
|
|
901
|
+
readonly mono: number;
|
|
902
|
+
readonly wall: number;
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* This function takes a time on the wall clock to the monotonic clock. The harness runs on the host
|
|
906
|
+
* of the containers, thus `process.hrtime` reads the CLOCK_MONOTONIC of the injector and the
|
|
907
|
+
* prober. The error of the pair is approximately 1 ms, the step of `Date.now`.
|
|
908
|
+
*/
|
|
909
|
+
export declare const monotonicAt: (wall: number, pair: ClockPair) => number;
|
|
910
|
+
/** This function gives the state of the BGP sessions from `show bgp neighbors json`. */
|
|
911
|
+
export declare const sessionsOf: (json: string) => {
|
|
912
|
+
readonly up: number;
|
|
913
|
+
readonly established: number;
|
|
914
|
+
};
|
|
915
|
+
/** These are the views of a leaf that tell if a run can start on it. */
|
|
916
|
+
interface LeafViews {
|
|
917
|
+
readonly neighbors: string;
|
|
918
|
+
/** This text is the kernel's route to the far network, from `ip -o route show`. */
|
|
919
|
+
readonly route: string;
|
|
920
|
+
/** This text is `show bgp ipv4 unicast PREFIX json`. */
|
|
921
|
+
readonly paths: string;
|
|
922
|
+
/** This text is `show bfd peers json`, or null when the fabric has no BFD. */
|
|
923
|
+
readonly bfd: string | null;
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* This function tells what a leaf still lacks before a run, or it gives null. The two sessions must
|
|
927
|
+
* be up and the route must be on spine1. Spine2 must hold the other path. Without these, the fault
|
|
928
|
+
* of a run acts on another path, or nothing can take over.
|
|
929
|
+
*/
|
|
930
|
+
export declare const leafLacks: (views: LeafViews) => string | null;
|
|
931
|
+
/**
|
|
932
|
+
* This function gives the later move of the leaves after an instant: for each leaf, the first route
|
|
933
|
+
* to its far network that leaves spine1. It gives null when a leaf has no move. The later move ends
|
|
934
|
+
* the outage in the two directions.
|
|
935
|
+
*/
|
|
936
|
+
export declare const laterMove: (routes: readonly RunRoute[], after: number) => number | null;
|
|
937
|
+
/** A fabric lab is the open fabric of a lab. */
|
|
938
|
+
interface FabricLab {
|
|
939
|
+
/** These are the lines of the route monitors of the leaves, on the monotonic clock. */
|
|
940
|
+
readonly routes: readonly RunRoute[];
|
|
941
|
+
/** This method drops each packet of spine1 in one commit, and the links stay up. */
|
|
942
|
+
silence(): Promise<{
|
|
943
|
+
t0: number;
|
|
944
|
+
t1: number;
|
|
945
|
+
}>;
|
|
946
|
+
/** This method ends a silence. */
|
|
947
|
+
clear(): Promise<{
|
|
948
|
+
t0: number;
|
|
949
|
+
t1: number;
|
|
950
|
+
}>;
|
|
951
|
+
/** This method waits until each leaf is on spine1 with each session up. */
|
|
952
|
+
ready(): Promise<void>;
|
|
953
|
+
/** This method gives the count of established sessions of each leaf so far. */
|
|
954
|
+
sessions(): Promise<Readonly<Record<string, number>>>;
|
|
955
|
+
/** This method gives the record of the fabric for a manifest. */
|
|
956
|
+
manifest(): FabricManifest;
|
|
957
|
+
/** This method destroys the routers. */
|
|
958
|
+
close(): Promise<void>;
|
|
959
|
+
}
|
|
960
|
+
/** These are the parts of a lab that a fabric uses. */
|
|
961
|
+
interface FabricParts {
|
|
962
|
+
readonly fabric: Fabric;
|
|
963
|
+
readonly image: string;
|
|
964
|
+
readonly client: StartedTestContainer;
|
|
965
|
+
readonly server: StartedTestContainer;
|
|
966
|
+
readonly admin: StartedTestContainer;
|
|
967
|
+
readonly injector: StartedTestContainer;
|
|
968
|
+
readonly opened: StartedTestContainer[];
|
|
969
|
+
readonly output: (container: StartedTestContainer, argv: string[]) => Promise<string>;
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* This function deploys the routers of a lab and joins the client and the target to them. It also
|
|
973
|
+
* starts the sidecars: the injector of spine1 and a route monitor on each leaf. The caller stops the
|
|
974
|
+
* sidecars with the other containers of the lab, and it calls `close` first.
|
|
975
|
+
*/
|
|
976
|
+
export declare const openFabric: (parts: FabricParts) => Promise<FabricLab>;
|
|
977
|
+
//#endregion
|
|
978
|
+
//#region src/image.d.ts
|
|
979
|
+
/** These are the names of the images that the harness ships. */
|
|
980
|
+
export declare const SHIPPED_NAMES: readonly [Shipped, ...Shipped[]];
|
|
981
|
+
/** This function gives the source of a shipped image. */
|
|
982
|
+
export declare const shippedSource: (name: Shipped) => ImageSource;
|
|
983
|
+
/** This function gives the version of the package of the harness, from its package.json. */
|
|
984
|
+
export declare const harnessVersion: () => string;
|
|
985
|
+
/**
|
|
986
|
+
* These are the clients that the harness ships, by their names (`Client`): the image of each, and
|
|
987
|
+
* its command. A cell that names a client gets this image and this command.
|
|
988
|
+
*/
|
|
989
|
+
export declare const SHIPPED_CLIENTS: Readonly<Record<Client, ClientImage>>;
|
|
990
|
+
/** These are the names of the clients that the harness ships. */
|
|
991
|
+
export declare const CLIENT_NAMES: readonly [Client, ...Client[]];
|
|
992
|
+
/** This function gives the command of a program of a subject by its role. It fails when the subject has no such program. */
|
|
993
|
+
export declare const programOf: (subject: Subject, role: string) => readonly string[];
|
|
994
|
+
/**
|
|
995
|
+
* This function gives the client of a subject for a cell (`Cell.client`): the image of the subject,
|
|
996
|
+
* with the command of a program. A client that the harness ships goes by its name, thus its records
|
|
997
|
+
* stay the same.
|
|
998
|
+
*/
|
|
999
|
+
export declare const subjectClient: (subject: Subject, role?: string) => Client | ClientImage;
|
|
1000
|
+
/** This pattern matches an image pinned by digest: a name, a tag or none, then `@sha256:` and 64 hex digits. */
|
|
1001
|
+
export declare const PINNED: RegExp;
|
|
1002
|
+
/** This pattern matches the repository of a tag that the harness builds. Its parts are lower case, with `/` between them. */
|
|
1003
|
+
export declare const REPOSITORY: RegExp;
|
|
1004
|
+
/** This function tells if a path stays in its context: relative, with `/` between its parts, and no `..`. */
|
|
1005
|
+
export declare const inContext: (path: string) => boolean;
|
|
1006
|
+
/**
|
|
1007
|
+
* This function gives the problems of the source of an image, as data. A pinned image names a
|
|
1008
|
+
* digest. A build names a repository, a context, and paths that stay in the context. A shipped image
|
|
1009
|
+
* is one that the harness ships.
|
|
1010
|
+
*/
|
|
1011
|
+
export declare const imageProblems: (source: ImageSource) => string[];
|
|
1012
|
+
/**
|
|
1013
|
+
* This function gives the problems of a subject, as data. A subject has a name and a base that a
|
|
1014
|
+
* digest pins. Its image source has no problems, and each of its programs is a command.
|
|
1015
|
+
*/
|
|
1016
|
+
export declare const subjectProblems: (subject: Subject) => string[];
|
|
1017
|
+
/**
|
|
1018
|
+
* This function gives each `FROM` of a Dockerfile that no digest pins. A `FROM` of an earlier stage
|
|
1019
|
+
* by its name, or of `scratch`, needs no digest. A base from an `ARG` has no digest that the harness
|
|
1020
|
+
* can read, thus it is in the list too.
|
|
1021
|
+
*/
|
|
1022
|
+
export declare const unpinnedBases: (dockerfile: string) => string[];
|
|
1023
|
+
/**
|
|
1024
|
+
* This function gives each base of a Dockerfile, in the sequence of the file. A base is the image of
|
|
1025
|
+
* a `FROM` that is not `scratch` or an earlier stage by its name.
|
|
1026
|
+
*/
|
|
1027
|
+
export declare const basesOf: (dockerfile: string) => string[];
|
|
1028
|
+
/**
|
|
1029
|
+
* This function gives each manifest of packages in a context (`package.json`, `Cargo.toml`) that
|
|
1030
|
+
* has no lockfile in its folder or in a folder above it. The paths are the paths in the context.
|
|
1031
|
+
*/
|
|
1032
|
+
export declare const unlockedManifests: (paths: readonly string[]) => string[];
|
|
1033
|
+
/**
|
|
1034
|
+
* An image plan tells how the harness gets the image of a source. It is a pull of an image by its
|
|
1035
|
+
* name, or a build of a context. A build has its tag, its Dockerfile, and each file with its path.
|
|
1036
|
+
*/
|
|
1037
|
+
type ImagePlan = {
|
|
1038
|
+
readonly kind: "pull";
|
|
1039
|
+
readonly image: string;
|
|
1040
|
+
} | {
|
|
1041
|
+
readonly kind: "build";
|
|
1042
|
+
readonly tag: string;
|
|
1043
|
+
readonly dockerfile: string;
|
|
1044
|
+
readonly files: ReadonlyArray<{
|
|
1045
|
+
readonly file: string;
|
|
1046
|
+
readonly at: string;
|
|
1047
|
+
}>;
|
|
1048
|
+
/** This record tells what the image holds, for the manifest of a run. */
|
|
1049
|
+
readonly record: BuildRecord;
|
|
1050
|
+
};
|
|
1051
|
+
/**
|
|
1052
|
+
* A build record tells what an image that the harness builds holds, for the manifest of a run. The
|
|
1053
|
+
* tag is a sha256 of each file of the context. The bases are pinned by digest, and each lockfile
|
|
1054
|
+
* has its sha256. Thus the record pins each program of the image. The versions are the part that a
|
|
1055
|
+
* person reads.
|
|
1056
|
+
*/
|
|
1057
|
+
interface BuildRecord {
|
|
1058
|
+
readonly tag: string;
|
|
1059
|
+
/** These are the bases of its Dockerfile, each pinned by digest (`basesOf`). */
|
|
1060
|
+
readonly bases: readonly string[];
|
|
1061
|
+
/** These are the lockfiles of its context by their path, each with the sha256 of its content (`locksOf`). */
|
|
1062
|
+
readonly locks: Readonly<Record<string, string>>;
|
|
1063
|
+
/** These are the versions of the packages that its manifests name directly, by their names (`versionsOf`). */
|
|
1064
|
+
readonly versions: Readonly<Record<string, string>>;
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* This function gives the plan of the image of a source. A stock image by its name, or a pinned
|
|
1068
|
+
* image, is a pull. A build or a shipped image is a build. Its tag is its name, then 12 digits of a
|
|
1069
|
+
* sha256. The sha256 reads the path of the Dockerfile, and the path and the content of each file.
|
|
1070
|
+
* Thus a changed program cannot operate as an old one.
|
|
1071
|
+
*
|
|
1072
|
+
* A build fails before it starts on a problem of its source. It also fails on a `FROM` that no
|
|
1073
|
+
* digest pins, and on a manifest of packages without a lockfile.
|
|
1074
|
+
*/
|
|
1075
|
+
export declare const planOf: (source: string | ImageSource) => ImagePlan;
|
|
1076
|
+
/**
|
|
1077
|
+
* This function gives an image that a lab can start, from its source. It is the name of a stock
|
|
1078
|
+
* image or of a pinned image, which the lab pulls, or the tag of a build. A build goes through the CLI
|
|
1079
|
+
* of Docker.
|
|
1080
|
+
*/
|
|
1081
|
+
export declare const imageOf: (source: string | ImageSource) => Promise<string>;
|
|
1082
|
+
/**
|
|
1083
|
+
* This function gives the build record of the image of a source, for the manifest of a run. A
|
|
1084
|
+
* stock image by its name, or a pinned image, is a pull, and it has no build record.
|
|
1085
|
+
*/
|
|
1086
|
+
export declare const buildRecordOf: (source: string | ImageSource) => BuildRecord | undefined;
|
|
1087
|
+
/** This function gives the image of the harness: the prober, the TCP client, the injector and the namespace admin. */
|
|
1088
|
+
export declare const harnessImage: () => Promise<string>;
|
|
1089
|
+
/** This function gives the image of the Node client. */
|
|
1090
|
+
export declare const nodeClientImage: () => Promise<string>;
|
|
1091
|
+
/** This function gives the image of the router. */
|
|
1092
|
+
export declare const routerImage: () => Promise<string>;
|
|
1093
|
+
/** This function gives the image of the Go HTTP client. */
|
|
1094
|
+
export declare const goHttpImage: () => Promise<string>;
|
|
1095
|
+
/** This function gives the image of the Node HTTP clients. */
|
|
1096
|
+
export declare const nodeHttpImage: () => Promise<string>;
|
|
1097
|
+
/** This function gives the image of the MongoDB client. */
|
|
1098
|
+
export declare const mongoClientImage: () => Promise<string>;
|
|
1099
|
+
/** This function gives the image of the PostgreSQL client. */
|
|
1100
|
+
export declare const pgClientImage: () => Promise<string>;
|
|
1101
|
+
/** This function gives the image of the client of HikariCP over pgjdbc. */
|
|
1102
|
+
export declare const hikariClientImage: () => Promise<string>;
|
|
1103
|
+
/** This function gives the image of the RabbitMQ client: amqplib, with the client and the admin of a cluster cell. */
|
|
1104
|
+
export declare const amqpClientImage: () => Promise<string>;
|
|
1105
|
+
/** This function gives the image of the gRPC client of the harness: grpc-js 1.14.6 on Node 24.21.0, with its client. */
|
|
1106
|
+
export declare const grpcClientImage: () => Promise<string>;
|
|
1107
|
+
/**
|
|
1108
|
+
* This function gives the source of the image that a target operates. It is the image of its
|
|
1109
|
+
* subject (`Target.subject`), or its stock image.
|
|
1110
|
+
*/
|
|
1111
|
+
export declare const targetSourceOf: (target: Target) => string | ImageSource;
|
|
1112
|
+
/** This function gives the image that a target operates: the image of its subject, or its stock image. */
|
|
1113
|
+
export declare const targetImageOf: (target: Target) => Promise<string>;
|
|
1114
|
+
//#endregion
|
|
1115
|
+
//#region src/substrate.d.ts
|
|
1116
|
+
/**
|
|
1117
|
+
* A layer is a rung of the laboratory (`docs/S7.md`). E1 is containers on one kernel, and E2 is a
|
|
1118
|
+
* cluster of containers on one kernel. A lab with `Topology.fabric` writes E3: routers in containers.
|
|
1119
|
+
* A lab in a guest of QEMU writes E4 (`substrateHere`). The other layers do not have a runner at this
|
|
1120
|
+
* time.
|
|
1121
|
+
*/
|
|
1122
|
+
type Layer = "E0" | "E1" | "E2" | "E3" | "E4" | "E5" | "E6";
|
|
1123
|
+
/** A cloud is where the runner operates. GitHub can schedule a standard Linux job on Azure or on AWS. */
|
|
1124
|
+
type Cloud = "azure" | "aws" | "unknown";
|
|
1125
|
+
/** A host is what a process reads about its own machine. */
|
|
1126
|
+
interface Host {
|
|
1127
|
+
/** This text is the kernel release. */
|
|
1128
|
+
readonly kernel: string | null;
|
|
1129
|
+
/** This number is `CONFIG_HZ` from the configuration of the kernel, or null without that file. */
|
|
1130
|
+
readonly hz: number | null;
|
|
1131
|
+
/** This text is the DMI system vendor, for example `Microsoft Corporation`, or null without that file. */
|
|
1132
|
+
readonly vendor: string | null;
|
|
1133
|
+
/** This value tells if `/dev/kvm` exists. A later VM layer needs it. */
|
|
1134
|
+
readonly kvm: boolean;
|
|
1135
|
+
/** This text is `$ImageOS $ImageVersion` of a hosted runner, or null elsewhere. */
|
|
1136
|
+
readonly image: string | null;
|
|
1137
|
+
}
|
|
1138
|
+
/**
|
|
1139
|
+
* A substrate tells where a record comes from. The rules of comparison in `docs/S7.md` read it: no
|
|
1140
|
+
* statistic pools two layers, two kernels or two clouds. The digest of each image stays in the
|
|
1141
|
+
* manifest. A value is null in a record from before this block.
|
|
1142
|
+
*/
|
|
1143
|
+
interface Substrate {
|
|
1144
|
+
readonly layer: Layer;
|
|
1145
|
+
readonly cloud: Cloud;
|
|
1146
|
+
readonly vendor: string | null;
|
|
1147
|
+
readonly kernel: string | null;
|
|
1148
|
+
readonly hz: number | null;
|
|
1149
|
+
readonly kvm: boolean | null;
|
|
1150
|
+
readonly image: string | null;
|
|
1151
|
+
}
|
|
1152
|
+
/** GitHub announced Linux jobs on AWS on this date. Each earlier hosted job ran on Azure. */
|
|
1153
|
+
export declare const AWS_FROM = "2026-10-28";
|
|
1154
|
+
/** This function gives the cloud of a DMI vendor. A kernel name does not tell: one image can start on each cloud. */
|
|
1155
|
+
export declare const cloudOf: (vendor: string | null) => Cloud;
|
|
1156
|
+
/** This function reads the host. `root` and `env` are for tests. */
|
|
1157
|
+
export declare const readHost: (root?: string, env?: Readonly<Record<string, string | undefined>>, kernel?: string) => Host;
|
|
1158
|
+
/** This function gives the substrate of a layer on a host. */
|
|
1159
|
+
export declare const substrateOn: (layer: Layer, host?: Host) => Substrate;
|
|
1160
|
+
/**
|
|
1161
|
+
* This function gives the substrate of a lab at this place. A guest cannot read its own runner: its
|
|
1162
|
+
* DMI vendor is QEMU, and `ImageOS` is not set. Thus the runner writes its host to `LAB_RUNNER`, and
|
|
1163
|
+
* the guest keeps only its own kernel and HZ. A value of that variable makes the layer E4.
|
|
1164
|
+
*/
|
|
1165
|
+
export declare const substrateHere: (layer: Layer, host?: Host, env?: Readonly<Record<string, string | undefined>>) => Substrate;
|
|
1166
|
+
/** A CPU reading is two counters of `/proc/stat`, in ticks of the clock. */
|
|
1167
|
+
interface CpuTime {
|
|
1168
|
+
/** This count is the time that the host gave to another guest while this one had work. */
|
|
1169
|
+
readonly steal: number;
|
|
1170
|
+
/** This count is the sum of all states of each CPU. */
|
|
1171
|
+
readonly total: number;
|
|
1172
|
+
}
|
|
1173
|
+
/** This function reads the CPU time of this machine, or gives null without `/proc/stat`. `root` is for tests. */
|
|
1174
|
+
export declare const readCpu: (root?: string) => CpuTime | null;
|
|
1175
|
+
/**
|
|
1176
|
+
* This function gives the share of the CPU time between two readings that the host took. The share
|
|
1177
|
+
* goes from zero to one. It is null if no tick passed. A guest sees only the host above it. On a hosted
|
|
1178
|
+
* runner that host is itself a guest, and this number does not show the contention of the layer below it.
|
|
1179
|
+
*/
|
|
1180
|
+
export declare const stealShare: (before: CpuTime, after: CpuTime) => number | null;
|
|
1181
|
+
/** A part of a record that can hold a substrate: a manifest of the harness, or the fields of a kind manifest. */
|
|
1182
|
+
interface SubstrateSource {
|
|
1183
|
+
readonly substrate?: Substrate;
|
|
1184
|
+
readonly kernel?: string;
|
|
1185
|
+
readonly hz?: string | null;
|
|
1186
|
+
}
|
|
1187
|
+
/**
|
|
1188
|
+
* This function reads the substrate of a record, the upgrade of a record from before this block.
|
|
1189
|
+
* Nothing rewrites such a record. It reads as the given layer. Its cloud is Azure if the record is
|
|
1190
|
+
* from before `AWS_FROM`, and unknown after that date, because its runner did not record the cloud.
|
|
1191
|
+
*/
|
|
1192
|
+
export declare const substrateOf: (source: SubstrateSource, at: string, layer?: Layer) => Substrate;
|
|
1193
|
+
/**
|
|
1194
|
+
* This function tells if a statistic can pool two substrates. They must have one layer, one kernel
|
|
1195
|
+
* and one cloud. An unknown value does not refuse a pair, because an old record cannot tell. The
|
|
1196
|
+
* reader of such a pair says so with `substrateKey`.
|
|
1197
|
+
*/
|
|
1198
|
+
export declare const comparable: (a: Substrate, b: Substrate) => boolean;
|
|
1199
|
+
/** This function gives the one-line name of a substrate, for a summary. */
|
|
1200
|
+
export declare const substrateKey: (substrate: Substrate) => string;
|
|
1201
|
+
/**
|
|
1202
|
+
* This function gives the first two substrates that a statistic cannot pool, or undefined. It
|
|
1203
|
+
* examines each pair. An unknown value matches Azure and AWS, thus one comparison with the first
|
|
1204
|
+
* substrate can miss a pair.
|
|
1205
|
+
*/
|
|
1206
|
+
export declare const unpoolable: (substrates: readonly Substrate[]) => readonly [Substrate, Substrate] | undefined;
|
|
1207
|
+
//#endregion
|
|
764
1208
|
//#region src/lab.d.ts
|
|
765
1209
|
/**
|
|
766
1210
|
* This time is the interval of the listing of a router, when its hop does not set one. A listing
|
|
@@ -829,6 +1273,10 @@ interface Manifest {
|
|
|
829
1273
|
readonly hzFrom?: "config" | "measured";
|
|
830
1274
|
readonly boot_id: string;
|
|
831
1275
|
readonly docker: string;
|
|
1276
|
+
/** This block tells the layer, the cloud and the kernel of the record. A record from before it reads through `substrateOf`. */
|
|
1277
|
+
readonly substrate?: Substrate;
|
|
1278
|
+
/** This record is the fabric of a cell with `Topology.fabric`. */
|
|
1279
|
+
readonly fabric?: FabricManifest;
|
|
832
1280
|
/** This record is the target, and its settings as it read them back. */
|
|
833
1281
|
readonly target: {
|
|
834
1282
|
readonly image: string;
|
|
@@ -843,11 +1291,20 @@ interface Manifest {
|
|
|
843
1291
|
readonly files?: Readonly<Record<string, string>>;
|
|
844
1292
|
/** This line is the first line of a target that writes them: a server that tells its settings as it reads them. */
|
|
845
1293
|
readonly first?: ProbeEvent;
|
|
1294
|
+
/** This record tells what the image of a target holds when the harness builds it: the image of a subject (`buildRecordOf`). */
|
|
1295
|
+
readonly build?: BuildRecord;
|
|
846
1296
|
};
|
|
1297
|
+
/**
|
|
1298
|
+
* This record is the harness: its image, the id of that image and its Alpine packages. It also
|
|
1299
|
+
* has the version of the package of the harness, and the build of its image. The record of a
|
|
1300
|
+
* cell gives the commit of the code that operated.
|
|
1301
|
+
*/
|
|
847
1302
|
readonly harness: {
|
|
848
1303
|
readonly image: string;
|
|
849
1304
|
readonly id: string;
|
|
850
1305
|
readonly packages: string[];
|
|
1306
|
+
readonly version?: string;
|
|
1307
|
+
readonly build?: BuildRecord;
|
|
851
1308
|
};
|
|
852
1309
|
/**
|
|
853
1310
|
* This record is the client of each run: the TCP client of the harness, a driver, or an image that
|
|
@@ -857,6 +1314,7 @@ interface Manifest {
|
|
|
857
1314
|
readonly kind: Client | "image";
|
|
858
1315
|
readonly image: string;
|
|
859
1316
|
readonly source?: ImageSource;
|
|
1317
|
+
readonly build?: BuildRecord;
|
|
860
1318
|
};
|
|
861
1319
|
/** These are the namespaces that the prober watched, by inode. */
|
|
862
1320
|
readonly netns: {
|
|
@@ -1014,6 +1472,8 @@ interface Lab {
|
|
|
1014
1472
|
* independent of the run before it.
|
|
1015
1473
|
*/
|
|
1016
1474
|
forget(): Promise<void>;
|
|
1475
|
+
/** This part is the routed fabric of a lab with `Topology.fabric`. */
|
|
1476
|
+
readonly fabric?: FabricLab;
|
|
1017
1477
|
/** This method freezes the target with the cgroup freezer: its process stops, and its kernel continues to answer. */
|
|
1018
1478
|
freeze(): Promise<void>;
|
|
1019
1479
|
thaw(): Promise<void>;
|
|
@@ -1080,6 +1540,20 @@ export declare const hzOf: (first: {
|
|
|
1080
1540
|
now: number;
|
|
1081
1541
|
jiffies: number;
|
|
1082
1542
|
}) => string | null;
|
|
1543
|
+
/** This function gives the build record of a source as a part of a manifest: `{ build }`, or nothing for an image that the harness pulls. */
|
|
1544
|
+
export declare const buildOf: (source: Parameters<typeof buildRecordOf>[0]) => {
|
|
1545
|
+
readonly build?: BuildRecord;
|
|
1546
|
+
};
|
|
1547
|
+
/** This function gives the version of the harness and the build of its image, as a part of the harness record of a manifest. */
|
|
1548
|
+
export declare const harnessRecord: () => {
|
|
1549
|
+
readonly version: string;
|
|
1550
|
+
readonly build?: BuildRecord;
|
|
1551
|
+
};
|
|
1552
|
+
/**
|
|
1553
|
+
* This function gives the record of the client of a run that the harness ships, for a manifest:
|
|
1554
|
+
* its kind, its image, and its build.
|
|
1555
|
+
*/
|
|
1556
|
+
export declare const shippedClientRecord: (kind: Client, image: string) => Manifest["client"];
|
|
1083
1557
|
/** This function gives the device of a route from its line in `ip -o route get`: "10.0.0.2 dev eth0 src …". */
|
|
1084
1558
|
export declare const deviceOf: (route: string) => string;
|
|
1085
1559
|
/**
|
|
@@ -1104,111 +1578,60 @@ export declare const deviceOf: (route: string) => string;
|
|
|
1104
1578
|
*/
|
|
1105
1579
|
export declare const openLab: (target: Target, kind?: Client | ClientImage, topology?: Topology) => Promise<Lab>;
|
|
1106
1580
|
//#endregion
|
|
1107
|
-
//#region src/
|
|
1108
|
-
/** These are the names of the images that the harness ships. */
|
|
1109
|
-
export declare const SHIPPED_NAMES: readonly [Shipped, ...Shipped[]];
|
|
1581
|
+
//#region src/locks.d.ts
|
|
1110
1582
|
/**
|
|
1111
|
-
*
|
|
1112
|
-
*
|
|
1583
|
+
* This module reads the lockfiles of a build context for the manifest of a run. A lockfile pins each
|
|
1584
|
+
* package that a build installs, thus its sha256 pins the packages that the image holds. The
|
|
1585
|
+
* versions of the packages that each manifest names directly are the part that a person reads.
|
|
1113
1586
|
*/
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
/**
|
|
1120
|
-
* This function gives the client of a subject for a cell (`Cell.client`): the image of the subject,
|
|
1121
|
-
* with the command of a program. A client that the harness ships goes by its name, thus its records
|
|
1122
|
-
* stay the same.
|
|
1123
|
-
*/
|
|
1124
|
-
export declare const subjectClient: (subject: Subject, role?: string) => Client | ClientImage;
|
|
1125
|
-
/** This pattern matches an image pinned by digest: a name, a tag or none, then `@sha256:` and 64 hex digits. */
|
|
1126
|
-
export declare const PINNED: RegExp;
|
|
1127
|
-
/** This pattern matches the repository of a tag that the harness builds. Its parts are lower case, with `/` between them. */
|
|
1128
|
-
export declare const REPOSITORY: RegExp;
|
|
1129
|
-
/** This function tells if a path stays in its context: relative, with `/` between its parts, and no `..`. */
|
|
1130
|
-
export declare const inContext: (path: string) => boolean;
|
|
1131
|
-
/**
|
|
1132
|
-
* This function gives the problems of the source of an image, as data. A pinned image names a
|
|
1133
|
-
* digest. A build names a repository, a context, and paths that stay in the context. A shipped image
|
|
1134
|
-
* is one that the harness ships.
|
|
1135
|
-
*/
|
|
1136
|
-
export declare const imageProblems: (source: ImageSource) => string[];
|
|
1137
|
-
/**
|
|
1138
|
-
* This function gives the problems of a subject, as data. A subject has a name and a base that a
|
|
1139
|
-
* digest pins. Its image source has no problems, and each of its programs is a command.
|
|
1140
|
-
*/
|
|
1141
|
-
export declare const subjectProblems: (subject: Subject) => string[];
|
|
1142
|
-
/**
|
|
1143
|
-
* This function gives each `FROM` of a Dockerfile that no digest pins. A `FROM` of an earlier stage
|
|
1144
|
-
* by its name, or of `scratch`, needs no digest. A base from an `ARG` has no digest that the harness
|
|
1145
|
-
* can read, thus it is in the list too.
|
|
1146
|
-
*/
|
|
1147
|
-
export declare const unpinnedBases: (dockerfile: string) => string[];
|
|
1148
|
-
/**
|
|
1149
|
-
* This function gives each manifest of packages in a context (`package.json`, `Cargo.toml`) that
|
|
1150
|
-
* has no lockfile in its folder or in a folder above it. The paths are the paths in the context.
|
|
1151
|
-
*/
|
|
1152
|
-
export declare const unlockedManifests: (paths: readonly string[]) => string[];
|
|
1153
|
-
/**
|
|
1154
|
-
* An image plan tells how the harness gets the image of a source. It is a pull of an image by its
|
|
1155
|
-
* name, or a build of a context. A build has its tag, its Dockerfile, and each file with its path.
|
|
1156
|
-
*/
|
|
1157
|
-
type ImagePlan = {
|
|
1158
|
-
readonly kind: "pull";
|
|
1159
|
-
readonly image: string;
|
|
1160
|
-
} | {
|
|
1161
|
-
readonly kind: "build";
|
|
1162
|
-
readonly tag: string;
|
|
1163
|
-
readonly dockerfile: string;
|
|
1164
|
-
readonly files: ReadonlyArray<{
|
|
1165
|
-
readonly file: string;
|
|
1166
|
-
readonly at: string;
|
|
1167
|
-
}>;
|
|
1168
|
-
};
|
|
1169
|
-
/**
|
|
1170
|
-
* This function gives the plan of the image of a source. A stock image by its name, or a pinned
|
|
1171
|
-
* image, is a pull. A build or a shipped image is a build. Its tag is its name, then 12 digits of a
|
|
1172
|
-
* sha256. The sha256 reads the path of the Dockerfile, and the path and the content of each file.
|
|
1173
|
-
* Thus a changed program cannot operate as an old one.
|
|
1174
|
-
*
|
|
1175
|
-
* A build fails before it starts on a problem of its source. It also fails on a `FROM` that no
|
|
1176
|
-
* digest pins, and on a manifest of packages without a lockfile.
|
|
1177
|
-
*/
|
|
1178
|
-
export declare const planOf: (source: string | ImageSource) => ImagePlan;
|
|
1179
|
-
/**
|
|
1180
|
-
* This function gives an image that a lab can start, from its source. It is the name of a stock
|
|
1181
|
-
* image or of a pinned image, which the lab pulls, or the tag of a build. A build goes through the CLI
|
|
1182
|
-
* of Docker.
|
|
1183
|
-
*/
|
|
1184
|
-
export declare const imageOf: (source: string | ImageSource) => Promise<string>;
|
|
1185
|
-
/** This function gives the image of the harness: the prober, the TCP client, the injector and the namespace admin. */
|
|
1186
|
-
export declare const harnessImage: () => Promise<string>;
|
|
1187
|
-
/** This function gives the image of the Node client. */
|
|
1188
|
-
export declare const nodeClientImage: () => Promise<string>;
|
|
1189
|
-
/** This function gives the image of the router. */
|
|
1190
|
-
export declare const routerImage: () => Promise<string>;
|
|
1191
|
-
/** This function gives the image of the Go HTTP client. */
|
|
1192
|
-
export declare const goHttpImage: () => Promise<string>;
|
|
1193
|
-
/** This function gives the image of the Node HTTP clients. */
|
|
1194
|
-
export declare const nodeHttpImage: () => Promise<string>;
|
|
1195
|
-
/** This function gives the image of the MongoDB client. */
|
|
1196
|
-
export declare const mongoClientImage: () => Promise<string>;
|
|
1197
|
-
/** This function gives the image of the PostgreSQL client. */
|
|
1198
|
-
export declare const pgClientImage: () => Promise<string>;
|
|
1199
|
-
/** This function gives the image of the client of HikariCP over pgjdbc. */
|
|
1200
|
-
export declare const hikariClientImage: () => Promise<string>;
|
|
1201
|
-
/** This function gives the image of the RabbitMQ client: amqplib, with the client and the admin of a cluster cell. */
|
|
1202
|
-
export declare const amqpClientImage: () => Promise<string>;
|
|
1203
|
-
/** This function gives the image of the gRPC client of the harness: grpc-js 1.14.6 on Node 24.21.0, with its client. */
|
|
1204
|
-
export declare const grpcClientImage: () => Promise<string>;
|
|
1587
|
+
/** A context file is a file of a build context: its path in the context, and its content. */
|
|
1588
|
+
interface ContextFile {
|
|
1589
|
+
readonly at: string;
|
|
1590
|
+
readonly content: Buffer | string;
|
|
1591
|
+
}
|
|
1205
1592
|
/**
|
|
1206
|
-
*
|
|
1207
|
-
*
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1593
|
+
* These are the names of the lockfiles that the harness records. A `go.mod` is the lockfile of a Go
|
|
1594
|
+
* module, because its `require` lines give exact versions. For them, Go selects the same packages
|
|
1595
|
+
* each time, and its checksum database examines each package.
|
|
1596
|
+
*/
|
|
1597
|
+
export declare const LOCK_NAMES: ReadonlySet<string>;
|
|
1598
|
+
/** This function gives each lockfile of a context by its path, with the sha256 of its content in hex. */
|
|
1599
|
+
export declare const locksOf: (files: readonly ContextFile[]) => Record<string, string>;
|
|
1600
|
+
/** This function gives the version of each direct dependency of an npm lockfile (lockfileVersion 2 or 3). */
|
|
1601
|
+
export declare const npmVersions: (lock: string) => Record<string, string>;
|
|
1602
|
+
/**
|
|
1603
|
+
* This function gives the version of each direct dependency of the root package of a Cargo.lock: the
|
|
1604
|
+
* package that the Cargo.toml beside it names. An entry of a dependency list is a name, or a name
|
|
1605
|
+
* and a version when the lock holds two versions of that name.
|
|
1606
|
+
*/
|
|
1607
|
+
export declare const cargoVersions: (lock: string, manifest: string) => Record<string, string>;
|
|
1608
|
+
/** This function gives the version of each direct requirement of a go.mod. A requirement that is `// indirect` is not direct. */
|
|
1609
|
+
export declare const goVersions: (mod: string) => Record<string, string>;
|
|
1610
|
+
/** This function gives the version of each jar of a list of jars by their SHA-256: `<hex> HikariCP-7.1.0.jar` gives HikariCP 7.1.0. */
|
|
1611
|
+
export declare const jarVersions: (list: string) => Record<string, string>;
|
|
1612
|
+
/**
|
|
1613
|
+
* This function gives the version of each package that the manifests of a context name directly,
|
|
1614
|
+
* by its name. It reads each npm lockfile, Cargo.lock, go.mod and list of jars. A package of a
|
|
1615
|
+
* workspace in the context is a package of the image too, with the version of its package.json.
|
|
1616
|
+
* Such a package has a name and a version, and it is not private. The record has the sha256 of
|
|
1617
|
+
* the lockfile of a pnpm, yarn or bun workspace (`locksOf`). This function does not read versions
|
|
1618
|
+
* from such a lockfile.
|
|
1619
|
+
*/
|
|
1620
|
+
export declare const versionsOf: (files: readonly ContextFile[]) => Record<string, string>;
|
|
1621
|
+
//#endregion
|
|
1622
|
+
//#region src/pins.d.ts
|
|
1623
|
+
/**
|
|
1624
|
+
* This function gives each problem of a manifest that stops it from pinning the programs of its
|
|
1625
|
+
* run. An empty list means that the manifest pins each program.
|
|
1626
|
+
* - the target: an image by its digest, or the build of a subject with its build record and its base
|
|
1627
|
+
* by digest.
|
|
1628
|
+
* - the harness: the version of its package, and the build record of its image.
|
|
1629
|
+
* - the client: an image by its digest, or a build with its build record.
|
|
1630
|
+
* - each hop: an image by its digest, or the tag of a build and the id of its image.
|
|
1631
|
+
*/
|
|
1632
|
+
export declare const manifestProblems: (manifest: Manifest) => string[];
|
|
1633
|
+
/** This function gives the problem of the commit of a record: no commit, or a text that is not a commit of git. */
|
|
1634
|
+
export declare const commitProblems: (commit: string | undefined) => string[];
|
|
1212
1635
|
//#endregion
|
|
1213
1636
|
//#region src/group.d.ts
|
|
1214
1637
|
/**
|
|
@@ -1455,6 +1878,12 @@ interface ReplicaSetLab {
|
|
|
1455
1878
|
signal(part: string, signal: "KILL" | "STOP" | "CONT", at?: number): Promise<Stamp>;
|
|
1456
1879
|
/** This method starts the server of a member again, after a fin. */
|
|
1457
1880
|
restart(member: string): Promise<void>;
|
|
1881
|
+
/** This method runs a command in the box of a member, and gives its output. */
|
|
1882
|
+
exec(member: string, argv: string[]): Promise<string>;
|
|
1883
|
+
/** This method runs a script of the shell on a member, against its own server only, and gives its output. Another port reads a server with no set. */
|
|
1884
|
+
script(member: string, script: string, port?: number): Promise<string>;
|
|
1885
|
+
/** This method runs a command on the backup host of a drill, and gives its output. A lab without that host refuses it. */
|
|
1886
|
+
vault(argv: string[]): Promise<string>;
|
|
1458
1887
|
/** This method sends replSetStepDown to the primary. */
|
|
1459
1888
|
stepDown(primary: string): Promise<Stamp>;
|
|
1460
1889
|
/** This method removes the TCP metrics of the client namespace: each run starts from a kernel that keeps nothing. */
|
|
@@ -1478,8 +1907,9 @@ export declare const STEP_DOWN: {
|
|
|
1478
1907
|
* - an injector sidecar for each member, in its network and process namespaces.
|
|
1479
1908
|
* - a client that holds its own network namespace, with a privileged sidecar for its sysctls.
|
|
1480
1909
|
* - the prober, which watches the namespace of the client.
|
|
1910
|
+
* - a backup host for a recovery drill: the stock image, for its tools, with no server.
|
|
1481
1911
|
*/
|
|
1482
|
-
export declare const openReplicaSetLab: (set: ReplicaSet) => Promise<ReplicaSetLab>;
|
|
1912
|
+
export declare const openReplicaSetLab: (set: ReplicaSet, backups?: boolean) => Promise<ReplicaSetLab>;
|
|
1483
1913
|
/** This function gives the arguments of the client of a replica set cell: each member, and the stream of writes. */
|
|
1484
1914
|
export declare const replicaSetArgs: (cell: Cell, members: Readonly<Record<string, RunPart>>) => string[];
|
|
1485
1915
|
/**
|
|
@@ -1497,6 +1927,18 @@ export declare const replicaSetArgs: (cell: Cell, members: Readonly<Record<strin
|
|
|
1497
1927
|
*/
|
|
1498
1928
|
export declare const replicaSetOnce: (lab: ReplicaSetLab, cell: Cell, environment: number, index: number) => Promise<Run>;
|
|
1499
1929
|
//#endregion
|
|
1930
|
+
//#region src/drill.d.ts
|
|
1931
|
+
/**
|
|
1932
|
+
* This function does one run of a recovery drill:
|
|
1933
|
+
* - The set converges, and it loses its writes. The tenants get their data, and a hash reads it.
|
|
1934
|
+
* - The client writes until its stream is steady. A control stops it here.
|
|
1935
|
+
* - The backups go, each at its interval. The fault comes at the age of the newest backup.
|
|
1936
|
+
* - An election continues the same client. A restore stops the client, and it starts a second one.
|
|
1937
|
+
* - The set converges again. The writes that it then holds tell which writes it kept, and a second
|
|
1938
|
+
* hash tells if the tenants have the same data.
|
|
1939
|
+
*/
|
|
1940
|
+
export declare const drillOnce: (lab: ReplicaSetLab, cell: Cell, environment: number, index: number) => Promise<Run>;
|
|
1941
|
+
//#endregion
|
|
1500
1942
|
//#region src/cluster.d.ts
|
|
1501
1943
|
/**
|
|
1502
1944
|
* This module is the lab of a cluster of RabbitMQ with one quorum queue. The members of the queue
|
|
@@ -1715,5 +2157,5 @@ export declare const spread: (runs: number, environments: number) => number[];
|
|
|
1715
2157
|
*/
|
|
1716
2158
|
export declare const runCell: (cell: Cell, say?: (line: string) => void) => Promise<CellResult>;
|
|
1717
2159
|
//#endregion
|
|
1718
|
-
export { type Agent, type BuildImage, type CallReading, type Cell, type CellResult, type Client, type ClientImage, type Cluster, type ClusterClientAt, type ClusterLab, type ClusterStage, type Crossings, type Cut, type Decision, type DriverBand, type DriverSocket, type DriverStep, type DriverStepTime, type ErrorOnTheWay, type Fault, type FaultPlace, type FaultSide, type Group, type GroupClient, type GroupLab, type GroupMeasured, type GroupNetworkFault, type GroupPlace, type GroupPrediction, type GroupReading, type GroupRole, type GroupVerdict, type GroupView, type Hop, type HopEvent, type HopPlace, type HopSignal, type HopWrite, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type KernelRecord, type Lab, type LineMatch, type Manifest, type ManifestHop, type Measured, type MemberLine, type MiddleboxEvent, type MiddleboxExpectation, type MiddleboxForm, type NetworkFault, type NodeLine, type Observer, type Outcome, type Pairing, type PinnedImage, type Prediction, type Probe, type ProbeEvent, type ProgramEvent, type ProxyHop, type ProxyTime, type ReconnectReading, type ReconnectVerdict, type Reconnects, type Recovers, type Reference, type Reordering, type ReplicaSet, type ReplicaSetLab, type ReplicaSetStage, type Replies, type RequestPrediction, type RequestReading, type RouterHop, type RttRange, type Run, type RunGroup, type RunPart, type RunTopology, type SentinelEvent, type SentinelStage, type Shipped, type ShippedImage, type SocketPlace, type Spread, type Stage, type StageBand, type StageVerdict, type Stamp, type Status, type StatusRow, type Subject, type Target, type Topology, type Toxic, type Verdict, type WallStamp, type Writes, type WsProbe, isHopPlace, latestEndOf };
|
|
2160
|
+
export { type Agent, type BuildImage, type BuildRecord, type CallReading, type Cell, type CellResult, type Client, type ClientImage, type ClockPair, type Cloud, type Cluster, type ClusterClientAt, type ClusterLab, type ClusterStage, type ContextFile, type Crossings, type Cut, type Decision, type Drill, type DriverBand, type DriverSocket, type DriverStep, type DriverStepTime, type ErrorOnTheWay, type Fabric, type FabricLab, type FabricManifest, type FabricParts, type Fault, type FaultPlace, type FaultSide, type Group, type GroupClient, type GroupLab, type GroupMeasured, type GroupNetworkFault, type GroupPlace, type GroupPrediction, type GroupReading, type GroupRole, type GroupVerdict, type GroupView, type Hop, type HopEvent, type HopPlace, type HopSignal, type HopWrite, type Host, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type KernelRecord, type Lab, type Layer, type LeafViews, type LineMatch, type Manifest, type ManifestHop, type Measured, type MemberLine, type MiddleboxEvent, type MiddleboxExpectation, type MiddleboxForm, type NetworkFault, type NodeLine, type Observer, type OplogRead, type OplogTime, type Outcome, type Pairing, type PinnedImage, type Prediction, type Probe, type ProbeEvent, type ProgramEvent, type ProxyHop, type ProxyTime, type ReconnectReading, type ReconnectVerdict, type Reconnects, type Recovers, type RecoveryMeasured, type Reference, type Reordering, type ReplicaSet, type ReplicaSetLab, type ReplicaSetStage, type Replies, type RequestPrediction, type RequestReading, type RouteLine, type RouterHop, type RttRange, type Run, type RunBackup, type RunDrill, type RunFabric, type RunGroup, type RunPart, type RunRoute, type RunTopology, type SentinelEvent, type SentinelStage, type Shipped, type ShippedImage, type SocketPlace, type Spread, type Stage, type StageBand, type StageVerdict, type Stamp, type Status, type StatusRow, type Subject, type Substrate, type SubstrateSource, type Target, type Topology, type Toxic, type Verdict, type WallStamp, type Writes, type WsProbe, isHopPlace, latestEndOf };
|
|
1719
2161
|
//# sourceMappingURL=index.d.ts.map
|