@mark1russell7/harness 0.16.10 → 0.16.12

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/build/index.d.ts CHANGED
@@ -799,7 +799,8 @@ interface BuildRecord {
799
799
  * Thus a changed program cannot operate as an old one.
800
800
  *
801
801
  * A build fails before it starts on a problem of its source. It also fails on a `FROM` that no
802
- * digest pins, and on a manifest of packages without a lockfile.
802
+ * digest pins, and on a manifest of packages without a lockfile. A package.json that the npm
803
+ * lockfile in its folder does not satisfy also stops it.
803
804
  */
804
805
  export declare const planOf: (source: string | ImageSource) => ImagePlan;
805
806
  /**
@@ -1354,6 +1355,9 @@ export declare const deviceOf: (route: string) => string;
1354
1355
  * - each hop of the topology, on the network of each of its sides. A hop is a router, or a stock
1355
1356
  * proxy with an injector sidecar in its namespace.
1356
1357
  * - an injector sidecar in the namespace of the target.
1358
+ * - the commands of `setup` in the target, after the target is ready and before the first hop
1359
+ * starts. A hop can connect to the target at its start, as a service to its replica set. Then it
1360
+ * sees the target in the state that the cell needs.
1357
1361
  * - the prober, a privileged container that loads the kernel program and watches the namespace of
1358
1362
  * the client, of the target and of each hop.
1359
1363
  *
@@ -1365,7 +1369,7 @@ export declare const deviceOf: (route: string) => string;
1365
1369
  * privileged sidecar adds. A router translates the address of the side of the client, thus the
1366
1370
  * target and each later hop see the router as the peer.
1367
1371
  */
1368
- export declare const openLab: (target: Target, kind?: Client | ClientImage, topology?: Topology) => Promise<Lab>;
1372
+ export declare const openLab: (target: Target, kind?: Client | ClientImage, topology?: Topology, setup?: ReadonlyArray<readonly string[]>) => Promise<Lab>;
1369
1373
  /**
1370
1374
  * This module is the lab of a replicated group: a primary and its replicas, and the Sentinels
1371
1375
  * that decide which member is the primary. It opens one environment for a group cell, and it does
@@ -2478,6 +2482,14 @@ export declare const LOCK_NAMES: ReadonlySet<string>;
2478
2482
  export declare const locksOf: (files: readonly ContextFile[]) => Record<string, string>;
2479
2483
  /** This function gives the version of each direct dependency of an npm lockfile (lockfileVersion 2 or 3). */
2480
2484
  export declare const npmVersions: (lock: string) => Record<string, string>;
2485
+ /**
2486
+ * This function gives a line for each direct dependency of a package.json that the npm lockfile
2487
+ * beside it does not satisfy. The lock does not hold the dependency, or its locked version is out
2488
+ * of the range of the manifest. `npm ci` refuses such a pair. The test is the test of npm: a loose
2489
+ * semver match, and `*` matches each version. A range that is not semver (a tag, a URL, a path, an
2490
+ * alias) is not read, and a lock of lockfileVersion 1 has no `packages`: neither gives a line.
2491
+ */
2492
+ export declare const npmDrift: (manifest: string, lock: string) => string[];
2481
2493
  /**
2482
2494
  * This function gives the version of each direct dependency of the root package of a Cargo.lock: the
2483
2495
  * package that the Cargo.toml beside it names. An entry of a dependency list is a name, or a name
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as targetSourceOf, B as CLIENT_CAPABILITIES, C as programOf, D as subjectClient, E as sources, F as goVersions, H as isHopPlace, I as jarVersions, L as locksOf, M as unpinnedBases, N as LOCK_NAMES, O as subjectProblems, P as cargoVersions, R as npmVersions, S as planOf, T as shippedSource, U as latestEndOf, V as environmentProblems, W as requestFirst, _ as kafkaClientImage, a as SHIPPED_NAMES, b as nodeHttpImage, c as buildRecordOf, d as harnessImage, f as harnessVersion, g as inContext, h as imageProblems, i as SHIPPED_CLIENTS, j as unlockedManifests, k as targetImageOf, l as goHttpImage, m as imageOf, n as PINNED, o as amqpClientImage, p as hikariClientImage, r as REPOSITORY, s as basesOf, t as CLIENT_NAMES, u as grpcClientImage, v as mongoClientImage, w as routerImage, x as pgClientImage, y as nodeClientImage, z as versionsOf } from "./image-YlflAajQ.js";
1
+ import { A as targetSourceOf, B as versionsOf, C as programOf, D as subjectClient, E as sources, F as goVersions, G as requestFirst, H as environmentProblems, I as jarVersions, L as locksOf, M as unpinnedBases, N as LOCK_NAMES, O as subjectProblems, P as cargoVersions, R as npmDrift, S as planOf, T as shippedSource, U as isHopPlace, V as CLIENT_CAPABILITIES, W as latestEndOf, _ as kafkaClientImage, a as SHIPPED_NAMES, b as nodeHttpImage, c as buildRecordOf, d as harnessImage, f as harnessVersion, g as inContext, h as imageProblems, i as SHIPPED_CLIENTS, j as unlockedManifests, k as targetImageOf, l as goHttpImage, m as imageOf, n as PINNED, o as amqpClientImage, p as hikariClientImage, r as REPOSITORY, s as basesOf, t as CLIENT_NAMES, u as grpcClientImage, v as mongoClientImage, w as routerImage, x as pgClientImage, y as nodeClientImage, z as npmVersions } from "./image-BE9H5gIv.js";
2
2
  import { LAYERS, LAYER_FACTS, LIMITS, layerOf, limitsOf } from "./layers.js";
3
3
  import { quantity, valueIn } from "@mark1russell7/quantity";
4
4
  import { median, medianInterval as medianInterval$1, quantile, quantileSorted } from "@mark1russell7/rigor-statistics";
@@ -4692,6 +4692,9 @@ const deviceOf = (route) => {
4692
4692
  * - each hop of the topology, on the network of each of its sides. A hop is a router, or a stock
4693
4693
  * proxy with an injector sidecar in its namespace.
4694
4694
  * - an injector sidecar in the namespace of the target.
4695
+ * - the commands of `setup` in the target, after the target is ready and before the first hop
4696
+ * starts. A hop can connect to the target at its start, as a service to its replica set. Then it
4697
+ * sees the target in the state that the cell needs.
4695
4698
  * - the prober, a privileged container that loads the kernel program and watches the namespace of
4696
4699
  * the client, of the target and of each hop.
4697
4700
  *
@@ -4703,7 +4706,7 @@ const deviceOf = (route) => {
4703
4706
  * privileged sidecar adds. A router translates the address of the side of the client, thus the
4704
4707
  * target and each later hop see the router as the peer.
4705
4708
  */
4706
- const openLab = async (target, kind = "tcp", topology) => {
4709
+ const openLab = async (target, kind = "tcp", topology, setup = []) => {
4707
4710
  const image = await harnessImage();
4708
4711
  const { clientImage, command, clientKind, capabilities, source } = await clientOf(kind);
4709
4712
  const hops = topology?.hops ?? [];
@@ -4746,6 +4749,7 @@ const openLab = async (target, kind = "tcp", topology) => {
4746
4749
  const server = await (target.command === void 0 ? stock : stock.withCommand([...target.command])).start();
4747
4750
  opened.push(server);
4748
4751
  const serverIp = await ipOn(server, last);
4752
+ for (const argv of setup) await output(server, [...argv]);
4749
4753
  const middlebox = [];
4750
4754
  const hopOutput = /* @__PURE__ */ new Map();
4751
4755
  const inChain = [];
@@ -4829,8 +4833,11 @@ const openLab = async (target, kind = "tcp", topology) => {
4829
4833
  throw new Error(`the hop ${hop.name} did not start: ${error instanceof Error ? error.message : String(error)}. Its last lines:\n${tail.join("\n")}`);
4830
4834
  });
4831
4835
  opened.push(box);
4832
- await join(box, clientSide);
4833
- const injector = await new GenericContainer(image).withNetworkMode(`container:${box.getId()}`).withAddedCapabilities("NET_ADMIN", "NET_RAW").start();
4836
+ const stopped = (error) => {
4837
+ throw new Error(`the hop ${hop.name} stopped after it started: ${error instanceof Error ? error.message : String(error)}. Its last lines:\n${tail.join("\n")}`);
4838
+ };
4839
+ await join(box, clientSide).catch(stopped);
4840
+ const injector = await new GenericContainer(image).withNetworkMode(`container:${box.getId()}`).withAddedCapabilities("NET_ADMIN", "NET_RAW").start().catch(stopped);
4834
4841
  opened.push(injector);
4835
4842
  inChain[at] = {
4836
4843
  hop,
@@ -9653,11 +9660,10 @@ const inEnvironment = async (cell, environment, count, say) => {
9653
9660
  if (cell.cluster !== void 0) return inClusterEnvironment(cell, environment, count, say);
9654
9661
  if (cell.kafka !== void 0) return inKafkaEnvironment(cell, environment, count, say);
9655
9662
  if (cell.pair !== void 0) return inPairEnvironment(cell, environment, count, say);
9656
- const lab = await openLab(cell.target, cell.client ?? cell.probe.driver?.name ?? "tcp", cell.topology);
9663
+ const lab = await openLab(cell.target, cell.client ?? cell.probe.driver?.name ?? "tcp", cell.topology, cell.targetSetup);
9657
9664
  try {
9658
9665
  const settings = await lab.configure(cell.targetSettings ?? {});
9659
9666
  const targetSysctls = await lab.targetSysctl(cell.targetSysctls ?? {});
9660
- if (cell.targetSetup !== void 0) await lab.setup(cell.targetSetup);
9661
9667
  if (cell.fault === "mtu-blackhole" || cell.fault === "netem") {
9662
9668
  await lab.offload(false, "target");
9663
9669
  await lab.offload(false, "client");
@@ -9898,6 +9904,6 @@ const runCell = async (cell, say = () => {}) => {
9898
9904
  target = larger;
9899
9905
  }
9900
9906
  };
9901
- export { AWS_FROM, CLIENT_CAPABILITIES, CLIENT_NAMES, CLOSED_TOLERANCE, CLOUDS, CLUSTER_STAGES, CONVERGE_MS, DAEMONS, DEBUG, DIRTY, DISK_MOUNT, DISK_RECORD_FORMAT, DISK_ROOT, DISK_SUBJECT, DROP_HANDLING, FABRIC_CLIENT, FABRIC_DEVICE, FABRIC_TARGET, FRR_IMAGE, GIVES_AWAY, HASH_SCRIPT, INJECT, INSERT, KAFKA_TAIL_MS, KEPT, LAYERS, LAYER_FACTS, LIMITS, LINGER_MS, LISTING, LOAD_FORMAT, LOAD_PATH, LOCK_NAMES, LOSS_MARGIN, MEMBER_MARKS, MONITOR_DOWN, NODE_MARKS, NOISE, PINNED, PUMP, PUMP_SLACK, QUIET_MS, RELATIVE, REPLICA_SET_STAGES, REPOSITORY, RESTART, ROUTERS, SCHEDULE_PATH, SEED_DOCUMENT, SHIPPED_CLIENTS, SHIPPED_NAMES, STAGES, STANDBY_READY, STATUS_SCRIPT, STEPS, STEP_DOWN, amqpClientImage, basesOf, bootstrapOf, brokerEnv, buildOf, buildRecordOf, callOf, cancelsOf, cargoVersions, clockOffsetOf, closeOrExit, cloudOf, clusterArgs, clusterConf, clusterCutOf, clusterHostsOf, clusterOnce, clusterStagesOf, clusterViewOf, commitProblems, commitVoid, comparable, controllerEnv, crossingsOf, cutOf, deadlineOf, delayVoids, deliveryFinding, deliveryOf, deviceOf, diskRecordProblems, diskSubjectProblems, drillOnce, drillSpan, dropFinding, dropOf, endpointAfter, envOf, environmentCounts, environmentProblems, errorsOf, estimateOf, estimateVerdict, exitOf, fieldOf, fieldsOf, firstUnanswered, folderDigest, frrConf, goHttpImage, goVersions, groupOnce, groupVerdictOf, grpcClientImage, harnessImage, harnessRecord, harnessVersion, hashOf, highestHeld, hikariClientImage, hzOf, imageOf, imagePinProblems, imageProblems, inContext, infoOf, initiateScript, isFenceLine, isHopPlace, jarVersions, jitterOf, jitterOfLines, judge, kafkaArgs, kafkaClientImage, kafkaCutOf, kafkaOnce, kafkaPauseOnce, kafkaViewOf, lagsOf, laterMove, latestEndOf, layerOf, leafLacks, leftAfter, limitsOf, loadOf, loadPlanOf, loadVerdict, locksOf, logNameOf, logTimeOf, manifestProblems, matches, measure, measureConntrack, measureDriver, measureEgress, measureGroup, measureMemory, measurePause, measurePorts, measureQueue, medianInterval, memAvailableOf, memberCommand, memberConfig, memberLineOf, mongoClientImage, monotonicAt, monotonicOf, namesGroup, nodeClientImage, nodeCommand, nodeHttpImage, nodeIdOf, nodeLineOf, nodeNameOf, nodesOnMonotonic, noiseOf, npmVersions, numbersOf, onMonotonic, openClusterLab, openDiskLab, openFabric, openGroupLab, openKafkaLab, openLab, openReplicaSetLab, openStandby, pairArgs, pairOnce, pairingOf, pairingsOf, pauseReady, peersOf, pgClientImage, pingsOf, plainOf, planOf, pongsOf, poolOf, programLines, programOf, quantileOf, readCpu, readHost, readOplog, reconnectFinding, reconnectOf, recordProblems, recoveryFindings, recoveryOf, referenceOf, reorderingOf, replicaSetArgs, replicaSetOnce, replicaSetStagesOf, requestOf, requestWords, restamped, roomNeeded, roomVoidOf, routeLine, routerImage, routesOf, runCell, runDiskFault, seedScript, sentinelConfig, sessionsOf, shippedClientRecord, shippedSource, sliceQuery, socketAt, socketOf, socketsOf, spread, spreadOf, stagesOf, standaloneCommand, standbyCommand, statusViewOf, stealShare, stepBand, stopScript, streamEnded, streamOf, streamsLoadOf, subjectClient, subjectProblems, subscriptionsOf, substrateHere, substrateKey, substrateOf, substrateOn, targetImageOf, targetSourceOf, templated, toolJsonOf, topicOf, topologyOf, toxicBody, unlockedManifests, unpinnedBases, unpoolable, verdictOf, versionsOf, viewOf, writesOf };
9907
+ export { AWS_FROM, CLIENT_CAPABILITIES, CLIENT_NAMES, CLOSED_TOLERANCE, CLOUDS, CLUSTER_STAGES, CONVERGE_MS, DAEMONS, DEBUG, DIRTY, DISK_MOUNT, DISK_RECORD_FORMAT, DISK_ROOT, DISK_SUBJECT, DROP_HANDLING, FABRIC_CLIENT, FABRIC_DEVICE, FABRIC_TARGET, FRR_IMAGE, GIVES_AWAY, HASH_SCRIPT, INJECT, INSERT, KAFKA_TAIL_MS, KEPT, LAYERS, LAYER_FACTS, LIMITS, LINGER_MS, LISTING, LOAD_FORMAT, LOAD_PATH, LOCK_NAMES, LOSS_MARGIN, MEMBER_MARKS, MONITOR_DOWN, NODE_MARKS, NOISE, PINNED, PUMP, PUMP_SLACK, QUIET_MS, RELATIVE, REPLICA_SET_STAGES, REPOSITORY, RESTART, ROUTERS, SCHEDULE_PATH, SEED_DOCUMENT, SHIPPED_CLIENTS, SHIPPED_NAMES, STAGES, STANDBY_READY, STATUS_SCRIPT, STEPS, STEP_DOWN, amqpClientImage, basesOf, bootstrapOf, brokerEnv, buildOf, buildRecordOf, callOf, cancelsOf, cargoVersions, clockOffsetOf, closeOrExit, cloudOf, clusterArgs, clusterConf, clusterCutOf, clusterHostsOf, clusterOnce, clusterStagesOf, clusterViewOf, commitProblems, commitVoid, comparable, controllerEnv, crossingsOf, cutOf, deadlineOf, delayVoids, deliveryFinding, deliveryOf, deviceOf, diskRecordProblems, diskSubjectProblems, drillOnce, drillSpan, dropFinding, dropOf, endpointAfter, envOf, environmentCounts, environmentProblems, errorsOf, estimateOf, estimateVerdict, exitOf, fieldOf, fieldsOf, firstUnanswered, folderDigest, frrConf, goHttpImage, goVersions, groupOnce, groupVerdictOf, grpcClientImage, harnessImage, harnessRecord, harnessVersion, hashOf, highestHeld, hikariClientImage, hzOf, imageOf, imagePinProblems, imageProblems, inContext, infoOf, initiateScript, isFenceLine, isHopPlace, jarVersions, jitterOf, jitterOfLines, judge, kafkaArgs, kafkaClientImage, kafkaCutOf, kafkaOnce, kafkaPauseOnce, kafkaViewOf, lagsOf, laterMove, latestEndOf, layerOf, leafLacks, leftAfter, limitsOf, loadOf, loadPlanOf, loadVerdict, locksOf, logNameOf, logTimeOf, manifestProblems, matches, measure, measureConntrack, measureDriver, measureEgress, measureGroup, measureMemory, measurePause, measurePorts, measureQueue, medianInterval, memAvailableOf, memberCommand, memberConfig, memberLineOf, mongoClientImage, monotonicAt, monotonicOf, namesGroup, nodeClientImage, nodeCommand, nodeHttpImage, nodeIdOf, nodeLineOf, nodeNameOf, nodesOnMonotonic, noiseOf, npmDrift, npmVersions, numbersOf, onMonotonic, openClusterLab, openDiskLab, openFabric, openGroupLab, openKafkaLab, openLab, openReplicaSetLab, openStandby, pairArgs, pairOnce, pairingOf, pairingsOf, pauseReady, peersOf, pgClientImage, pingsOf, plainOf, planOf, pongsOf, poolOf, programLines, programOf, quantileOf, readCpu, readHost, readOplog, reconnectFinding, reconnectOf, recordProblems, recoveryFindings, recoveryOf, referenceOf, reorderingOf, replicaSetArgs, replicaSetOnce, replicaSetStagesOf, requestOf, requestWords, restamped, roomNeeded, roomVoidOf, routeLine, routerImage, routesOf, runCell, runDiskFault, seedScript, sentinelConfig, sessionsOf, shippedClientRecord, shippedSource, sliceQuery, socketAt, socketOf, socketsOf, spread, spreadOf, stagesOf, standaloneCommand, standbyCommand, statusViewOf, stealShare, stepBand, stopScript, streamEnded, streamOf, streamsLoadOf, subjectClient, subjectProblems, subscriptionsOf, substrateHere, substrateKey, substrateOf, substrateOn, targetImageOf, targetSourceOf, templated, toolJsonOf, topicOf, topologyOf, toxicBody, unlockedManifests, unpinnedBases, unpoolable, verdictOf, versionsOf, viewOf, writesOf };
9902
9908
 
9903
9909
  //# sourceMappingURL=index.js.map