isothrum-runner 2.1.2

The Isothrum runner: executes the run manifest Isoloom writes next to a target's files (lifecycle, state and locks, drivers, checks, events).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Isothrum run status",
  "description": "A run as it stands.",
  "type": "object",
  "properties": {
    "state": {
      "description": "Where it stands. While an operation holds the run: the moving state it is in (`starting`\nthrough an `up`), else, before it records one or for an operation that leaves the run as\nit was meanwhile (an `update`: `ready`), the state the run's record holds.",
      "$ref": "#/$defs/RunState"
    },
    "live": {
      "description": "Whether the machines and outputs were read from the engine now. False while an operation\nholds the run (in this process or another), whose tools a read would contend with (Vagrant\nrefuses to read a VM's state while a `vagrant up` provisions it): they are then as the\nrunner last read them (none before it ever did), and the outputs the engine itself gives\nare left out.",
      "type": "boolean",
      "default": true
    },
    "provider": {
      "description": "The Vagrant provider it uses, when it has one.",
      "anyOf": [
        {
          "$ref": "#/$defs/Provider"
        },
        {
          "type": "null"
        }
      ]
    },
    "machines": {
      "description": "Every machine of the manifest.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/MachineStatus"
      }
    },
    "networks": {
      "description": "The run's networks.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/NetworkView"
      }
    },
    "outputs": {
      "description": "Its outputs, each filled from what was read. While not [`Status::live`], an output the\nengine itself gives (a Terraform output) has only its default, if any.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/OutputValue"
      }
    },
    "message": {
      "description": "The run's message, filled, once the run is ready.",
      "type": [
        "string",
        "null"
      ]
    },
    "native": {
      "description": "The hypervisor's own app that shows the run's running VMs in a window of its own\n([`crate::Running::native_console`]), and what of it this computer needs; none where the\nrun's provider has none (vagrant-qemu), or for a run of containers.",
      "anyOf": [
        {
          "$ref": "#/$defs/NativeApp"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "state",
    "machines",
    "networks",
    "outputs"
  ],
  "$defs": {
    "RunState": {
      "description": "Where a run stands.",
      "oneOf": [
        {
          "description": "Being started.",
          "type": "string",
          "const": "starting"
        },
        {
          "description": "Up, every member machine running.",
          "type": "string",
          "const": "ready"
        },
        {
          "description": "Something of it exists, but not every member machine runs (a failed start, a machine down).",
          "type": "string",
          "const": "failed"
        },
        {
          "description": "Being parked.",
          "type": "string",
          "const": "parking"
        },
        {
          "description": "Parked: stopped, what it created kept.",
          "type": "string",
          "const": "parked"
        },
        {
          "description": "Being resumed.",
          "type": "string",
          "const": "resuming"
        },
        {
          "description": "Being removed.",
          "type": "string",
          "const": "stopping"
        },
        {
          "description": "Nothing of it exists.",
          "type": "string",
          "const": "absent"
        }
      ]
    },
    "Provider": {
      "description": "A Vagrant provider (`vagrant up --provider`).",
      "oneOf": [
        {
          "description": "VirtualBox.",
          "type": "string",
          "const": "virtualbox"
        },
        {
          "description": "VMware Workstation or Fusion.",
          "type": "string",
          "const": "vmware_desktop"
        },
        {
          "description": "Hyper-V.",
          "type": "string",
          "const": "hyperv"
        },
        {
          "description": "Parallels Desktop.",
          "type": "string",
          "const": "parallels"
        },
        {
          "description": "libvirt (KVM).",
          "type": "string",
          "const": "libvirt"
        },
        {
          "description": "QEMU.",
          "type": "string",
          "const": "qemu"
        },
        {
          "description": "UTM.",
          "type": "string",
          "const": "utm"
        },
        {
          "description": "An ESXi server.",
          "type": "string",
          "const": "vmware_esxi"
        }
      ]
    },
    "MachineStatus": {
      "description": "One machine of the manifest, as it stands.",
      "type": "object",
      "properties": {
        "name": {
          "description": "Its name.",
          "type": "string"
        },
        "role": {
          "description": "What it is for.",
          "$ref": "#/$defs/Role"
        },
        "state": {
          "description": "Its state.",
          "$ref": "#/$defs/MachineState"
        },
        "addresses": {
          "description": "Its static addresses, by network.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "published": {
          "description": "Its published ports.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PublishedPort"
          }
        },
        "console": {
          "description": "Its graphical console under the run's provider, as the manifest offers it (`none` and\nwhy where there is none); `None` when the manifest says nothing (a container).",
          "anyOf": [
            {
              "$ref": "#/$defs/ConsoleOffer"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "name",
        "role",
        "state",
        "addresses",
        "published"
      ]
    },
    "Role": {
      "description": "What a machine is to the run.",
      "oneOf": [
        {
          "description": "One of the environment's own machines: one the spec describes.",
          "type": "string",
          "const": "member"
        },
        {
          "description": "A one-shot that must exit 0 (an `init:` script).",
          "type": "string",
          "const": "job"
        },
        {
          "description": "Isoloom's plumbing (the controller, probes, route keepers): never shown, never counted as down.",
          "type": "string",
          "const": "infra"
        },
        {
          "description": "The user's seat, or its stand-in.",
          "type": "string",
          "const": "access"
        },
        {
          "description": "An observer (`tools:`).",
          "type": "string",
          "const": "tool"
        },
        {
          "description": "A check runner (Compose profile `check`).",
          "type": "string",
          "const": "check"
        }
      ]
    },
    "MachineState": {
      "description": "A machine's state, as its engine reports it.",
      "oneOf": [
        {
          "description": "Running.",
          "type": "string",
          "const": "running"
        },
        {
          "description": "Running, but failing its health check.",
          "type": "string",
          "const": "unhealthy"
        },
        {
          "description": "Exited with this code (a job that finished, or a machine that died).",
          "type": "object",
          "properties": {
            "exited": {
              "type": "integer",
              "format": "int32"
            }
          },
          "required": [
            "exited"
          ],
          "additionalProperties": false
        },
        {
          "description": "Created or stopped, not running.",
          "type": "string",
          "const": "stopped"
        },
        {
          "description": "Not there.",
          "type": "string",
          "const": "absent"
        },
        {
          "description": "Something else, as the engine says it.",
          "type": "object",
          "properties": {
            "unknown": {
              "type": "string"
            }
          },
          "required": [
            "unknown"
          ],
          "additionalProperties": false
        },
        {
          "description": "Not read: another process acts on it (Vagrant's lock on the machine, held by a `vagrant\nup` that isn't this runner's), so its state is whatever that action leaves.",
          "type": "string",
          "const": "busy"
        }
      ]
    },
    "PublishedPort": {
      "description": "A published port: where a machine's port answers on the host.",
      "type": "object",
      "properties": {
        "port": {
          "description": "The machine's port.",
          "type": "integer",
          "format": "uint16",
          "minimum": 0,
          "maximum": 65535
        },
        "protocol": {
          "description": "`tcp` or `udp`.",
          "$ref": "#/$defs/Protocol"
        },
        "host_port": {
          "description": "The host port.",
          "type": "integer",
          "format": "uint16",
          "minimum": 0,
          "maximum": 65535
        }
      },
      "required": [
        "port",
        "protocol",
        "host_port"
      ]
    },
    "Protocol": {
      "description": "A port's transport protocol.",
      "oneOf": [
        {
          "description": "TCP.",
          "type": "string",
          "const": "tcp"
        },
        {
          "description": "UDP.",
          "type": "string",
          "const": "udp"
        }
      ]
    },
    "ConsoleOffer": {
      "description": "What a status says of a machine's graphical console under the run's provider: its protocol,\nor `none` and why ([`isoloom_manifest::Console`]'s, as the manifest says it).",
      "type": "object",
      "properties": {
        "protocol": {
          "description": "`vnc`, `rdp`, or `none`.",
          "$ref": "#/$defs/ConsoleProtocol"
        },
        "note": {
          "description": "Why there is none, or what it needs (an extension pack).",
          "type": [
            "string",
            "null"
          ]
        },
        "unavailable": {
          "description": "Why it can't be shown now, as the status found it on a running machine: its hypervisor\ngives it no display (a VM started without one), or it doesn't answer where the hypervisor\nsays. None when it answers, or wasn't looked at: the machine doesn't run, it has none, or\nit is reached through an SSH tunnel or Proxmox's API, which a status doesn't open.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "protocol"
      ]
    },
    "ConsoleProtocol": {
      "description": "The protocol a graphical console speaks.",
      "oneOf": [
        {
          "description": "VNC (RFB).",
          "type": "string",
          "const": "vnc"
        },
        {
          "description": "Microsoft's Remote Desktop Protocol.",
          "type": "string",
          "const": "rdp"
        },
        {
          "description": "No graphical console: the console's `note` says why.",
          "type": "string",
          "const": "none"
        }
      ]
    },
    "NetworkView": {
      "description": "A network of the run.",
      "type": "object",
      "properties": {
        "name": {
          "description": "Its name in the spec.",
          "type": "string"
        },
        "cidr": {
          "description": "Its block.",
          "type": "string"
        },
        "internet": {
          "description": "Whether it reaches the internet.",
          "type": "boolean"
        },
        "native": {
          "description": "Its name where the target created it (`web-portal_backend`), when known.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "cidr",
        "internet"
      ]
    },
    "OutputValue": {
      "description": "An output's value. A sensitive one shows as `***` wherever it is written out (its JSON, its\n`Debug`, an event); the runner keeps the value itself for its own use (a guest delivery's\naddress, masking it in what tools print).",
      "type": "object",
      "properties": {
        "name": {
          "description": "Its name.",
          "type": "string"
        },
        "role": {
          "description": "What it is for (`entry`: where a user starts, the address to open).",
          "$ref": "#/$defs/OutputRole"
        },
        "sensitive": {
          "description": "Whether the value is sensitive.",
          "type": "boolean"
        },
        "value": {
          "description": "Its value, when it can be read; `***` when it is sensitive.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "role",
        "sensitive"
      ]
    },
    "OutputRole": {
      "description": "What the embedder does with an output.",
      "oneOf": [
        {
          "description": "Where to start: the address a user opens first.",
          "type": "string",
          "const": "entry"
        },
        {
          "description": "An address.",
          "type": "string",
          "const": "address"
        },
        {
          "description": "Anything else worth showing.",
          "type": "string",
          "const": "info"
        }
      ]
    },
    "NativeApp": {
      "description": "The hypervisor's own app that shows a running VM's screen in a window of its own, and what of\nit this computer must have (any one of `needs`).",
      "type": "object",
      "properties": {
        "name": {
          "description": "Its name as its maker writes it (`VirtualBox`, `VMware Fusion`): what a button names.",
          "type": "string"
        },
        "needs": {
          "description": "What opens it, best first: the program or app [`NativeConsole::ways`] runs, in the same\norder.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/NativeNeed"
          }
        }
      },
      "required": [
        "name",
        "needs"
      ]
    },
    "NativeNeed": {
      "description": "What of a hypervisor's app must be on this computer for a way to open it.",
      "oneOf": [
        {
          "description": "A program, by its name on `PATH` or its full path.",
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "program"
            },
            "at": {
              "type": "string"
            }
          },
          "required": [
            "kind",
            "at"
          ]
        },
        {
          "description": "A macOS app bundle.",
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "mac_app"
            },
            "at": {
              "type": "string"
            }
          },
          "required": [
            "kind",
            "at"
          ]
        },
        {
          "description": "The default browser (a web console).",
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "browser"
            }
          },
          "required": [
            "kind"
          ]
        }
      ]
    }
  }
}