isothrum-runner 3.0.2

The Isothrum runner: runs a Compose project, a Vagrantfile or a Terraform module through its own tool (lifecycle, state and locks, the format drivers, 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
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
{
  "$defs": {
    "ConsoleOffer": {
      "description": "What a status says of a machine's graphical console: its protocol, or `none` and why.",
      "properties": {
        "note": {
          "description": "Why there is none, or what it needs (an extension pack).",
          "type": [
            "string",
            "null"
          ]
        },
        "protocol": {
          "$ref": "#/$defs/ConsoleProtocol",
          "description": "`vnc`, `rdp`, or `none`."
        },
        "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). None when it can, or wasn't looked at: the\nmachine doesn't run, it has none, or it is reached through Proxmox's API, which a status\ndoesn't open.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "protocol"
      ],
      "type": "object"
    },
    "ConsoleProtocol": {
      "description": "The protocol a graphical console speaks.",
      "oneOf": [
        {
          "const": "vnc",
          "description": "VNC (RFB).",
          "type": "string"
        },
        {
          "const": "rdp",
          "description": "RDP (VirtualBox's remote display).",
          "type": "string"
        },
        {
          "const": "none",
          "description": "None the runner reaches.",
          "type": "string"
        }
      ]
    },
    "Desired": {
      "description": "What a user wants of a run: set by the commands, never by an observation.",
      "oneOf": [
        {
          "const": "running",
          "description": "Up and ready.",
          "type": "string"
        },
        {
          "const": "parked",
          "description": "Parked: stopped, what it created kept.",
          "type": "string"
        },
        {
          "const": "gone",
          "description": "Nothing of it left.",
          "type": "string"
        }
      ]
    },
    "ErrorCode": {
      "description": "The stable code of a failure, the same in the Rust API and the event stream (`error.code`).",
      "oneOf": [
        {
          "const": "project_invalid",
          "description": "The folder isn't a project Isothrum runs: it holds no Compose file, Vagrantfile or\nTerraform module, or the files of several formats with none named.",
          "type": "string"
        },
        {
          "const": "unsupported",
          "description": "The manifest needs something this runner doesn't do (a target that doesn't run on this\nhost, a delivery its driver doesn't take, an action of another driver's, a step with no\ncommand for this host), or the call asks the run for something its target can't do (a\nconsole into a Compose service with no VM, a Vagrant VM joined to another network).",
          "type": "string"
        },
        {
          "const": "io",
          "description": "A file or folder couldn't be read or written, or a socket on this computer bound.",
          "type": "string"
        },
        {
          "const": "locked",
          "description": "Another process runs an operation on this run, or holds the home's slot pick.",
          "type": "string"
        },
        {
          "const": "tool_missing",
          "description": "A tool a step runs isn't installed.",
          "type": "string"
        },
        {
          "const": "tool_failed",
          "description": "A step's tool ran and failed.",
          "type": "string"
        },
        {
          "const": "tool_unanswered",
          "description": "A tool the run needs is installed, but got no answer from its service: Docker's engine\nstopped, or quit while a step ran (the `step` says which): the message says what the tool\nsaid.",
          "type": "string"
        },
        {
          "const": "tool_too_old",
          "description": "A tool answers at a version older than the run needs.",
          "type": "string"
        },
        {
          "const": "tool_denied",
          "description": "A tool refused this account (Docker's engine its socket or named pipe): the account needs\nthe access (a group), not the tool started.",
          "type": "string"
        },
        {
          "const": "credentials_expired",
          "description": "A cloud refused the sign-in the run's tools use: a CLI or SSO session that ran out, an\nexpired token, application-default credentials gone stale, a profile never signed in.\nSigning in again fixes it; the cloud refused before Terraform changed anything.",
          "type": "string"
        },
        {
          "const": "address_pool_overlap",
          "description": "A network the run makes needs an address block another network on the engine already\nholds (Docker's `Pool overlaps with other one on this address space`).",
          "type": "string"
        },
        {
          "const": "timeout",
          "description": "A step showed no progress for its time limit, or ran to the ceiling every step stops at,\nand was stopped, with what it started (the `error` event's `detail` says which).",
          "type": "string"
        },
        {
          "const": "download_stalled",
          "description": "A download (what a step needs, fetched in a phase of its own before it: a Compose start's\nimages, a Vagrant start's boxes; or a step the manifest marks a download) showed no\nprogress for as long as a download may, and was stopped.",
          "type": "string"
        },
        {
          "const": "download_failed",
          "description": "A download couldn't be made: its tool failed (the message says why: a registry or a box\ncatalog refusing it, a name it doesn't know, the network). A failure for the network that\npasses (a connection reset, refused or timed out, a gateway's 502, 503 or 504) was tried\nagain first, up to three more times: the message is the last try's.",
          "type": "string"
        },
        {
          "const": "already_running",
          "description": "The run is already up.",
          "type": "string"
        },
        {
          "const": "running_elsewhere",
          "description": "The run is recorded on another place (server or account) than the one asked for.",
          "type": "string"
        },
        {
          "const": "port_in_use",
          "description": "A host port the run publishes is taken.",
          "type": "string"
        },
        {
          "const": "not_parkable",
          "description": "The manifest has no park steps for that mode.",
          "type": "string"
        },
        {
          "const": "nothing_to_resume",
          "description": "Nothing of the run, or not every one of its machines, is left to resume.",
          "type": "string"
        },
        {
          "const": "not_running",
          "description": "The run isn't up.",
          "type": "string"
        },
        {
          "const": "not_ready",
          "description": "A ready condition didn't hold.",
          "type": "string"
        },
        {
          "const": "secret_missing",
          "description": "A required secret or input has no value.",
          "type": "string"
        },
        {
          "const": "input_invalid",
          "description": "A value or secret that can't be handed to the tools (its name empty or holding `=`, a\nNUL in it).",
          "type": "string"
        },
        {
          "const": "run_name",
          "description": "A run name that can't name a run.",
          "type": "string"
        },
        {
          "const": "provider_refused",
          "description": "The run's Vagrant provider is missing, unknown, not on this host, refused by the run, or\nlacks its plugin, or the hypervisor lacks what it needs on this computer (virtiofsd, for a\nshared folder on Linux: the `detail`'s `need`).",
          "type": "string"
        },
        {
          "const": "elevation_failed",
          "description": "The elevation Hyper-V's commands need couldn't be had or was lost: the permission prompt\ndeclined or unanswered, the elevated session not started or ended before the operation\n(the message says which).",
          "type": "string"
        },
        {
          "const": "machine_unknown",
          "description": "A machine the run doesn't have.",
          "type": "string"
        },
        {
          "const": "machine_ambiguous",
          "description": "The run has several machines the call could mean, and it named none.",
          "type": "string"
        },
        {
          "const": "network_unknown",
          "description": "A network the run doesn't have.",
          "type": "string"
        },
        {
          "const": "adopt_refused",
          "description": "A deployment can't be taken over as a run.",
          "type": "string"
        },
        {
          "const": "cancelled",
          "description": "The operation was cut short before it ended (its future dropped: an embedder's cancel, the\ncommand line's Ctrl-C or SIGTERM); the tools it started were asked to stop, and are ended\nonce they have, or 30 seconds later.",
          "type": "string"
        },
        {
          "const": "usage",
          "description": "The embedder was asked for something that makes no sense (the command line: a run folder\nwith no manifest, a value missing or malformed), so no operation started.",
          "type": "string"
        },
        {
          "const": "no_console",
          "description": "The machine has no graphical console to reach: its target or provider gives none (the\nerror says why), it isn't running, or its hypervisor doesn't say where it is.",
          "type": "string"
        },
        {
          "const": "server_auth_failed",
          "description": "The server the run is on (Proxmox VE, ESXi) refused the run's credentials: its API\nanswered 401 or 403, or its tool said the sign-in failed (an API token revoked, a password\nchanged).",
          "type": "string"
        },
        {
          "const": "corrupt",
          "description": "A file of the runner's own (a record, a ledger entry) is there but isn't what it wrote:\nnot JSON, or another version's shape.",
          "type": "string"
        },
        {
          "const": "illegal_transition",
          "description": "The run's state machine has no such move (a park of a parked run, a resume of a ready\none), or a resource row can't move that way.",
          "type": "string"
        },
        {
          "const": "state_conflict",
          "description": "The run moved between the read and the write that would have moved it: try again.",
          "type": "string"
        },
        {
          "const": "store_version",
          "description": "The home's store was written by a newer runner.",
          "type": "string"
        },
        {
          "const": "store_corrupt",
          "description": "The home's store isn't a database this runner reads, or holds what it doesn't write.",
          "type": "string"
        },
        {
          "const": "lease_held",
          "description": "A live process holds the lease asked for.",
          "type": "string"
        }
      ]
    },
    "MachineState": {
      "description": "A machine's state, as its engine reports it.",
      "oneOf": [
        {
          "const": "running",
          "description": "Running.",
          "type": "string"
        },
        {
          "const": "unhealthy",
          "description": "Running, but failing its health check.",
          "type": "string"
        },
        {
          "additionalProperties": false,
          "description": "Exited with this code (a job that finished, or a machine that died).",
          "properties": {
            "exited": {
              "format": "int32",
              "type": "integer"
            }
          },
          "required": [
            "exited"
          ],
          "type": "object"
        },
        {
          "const": "stopped",
          "description": "Created or stopped, not running.",
          "type": "string"
        },
        {
          "const": "absent",
          "description": "Not there.",
          "type": "string"
        },
        {
          "additionalProperties": false,
          "description": "Something else, as the engine says it.",
          "properties": {
            "unknown": {
              "type": "string"
            }
          },
          "required": [
            "unknown"
          ],
          "type": "object"
        },
        {
          "const": "busy",
          "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"
        }
      ]
    },
    "MachineStatus": {
      "description": "One machine of the run, as its tool reports it.",
      "properties": {
        "address": {
          "description": "The address it is reached at itself, when its tool says one another computer reaches (a\nVM on a bridged or host-only network, a server's VM, a cloud instance); none for one\nreached only through its published ports. On ESXi, which forwards no port to this\ncomputer, a machine's ports answer at this address.",
          "type": [
            "string",
            "null"
          ]
        },
        "console": {
          "anyOf": [
            {
              "$ref": "#/$defs/ConsoleOffer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Its graphical console, as its hypervisor offers it; none for a machine with no screen to\nspeak of (a container), and while not [`Status::live`]."
        },
        "name": {
          "description": "Its name in the project (a Compose service, a Vagrant machine, a module's VM).",
          "type": "string"
        },
        "published": {
          "description": "Its published ports.",
          "items": {
            "$ref": "#/$defs/PublishedPort"
          },
          "type": "array"
        },
        "state": {
          "$ref": "#/$defs/MachineState",
          "description": "Its state."
        }
      },
      "required": [
        "name",
        "state",
        "published"
      ],
      "type": "object"
    },
    "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`).",
      "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.",
          "items": {
            "$ref": "#/$defs/NativeNeed"
          },
          "type": "array"
        }
      },
      "required": [
        "name",
        "needs"
      ],
      "type": "object"
    },
    "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.",
          "properties": {
            "at": {
              "type": "string"
            },
            "kind": {
              "const": "program",
              "type": "string"
            }
          },
          "required": [
            "kind",
            "at"
          ],
          "type": "object"
        },
        {
          "description": "A macOS app bundle.",
          "properties": {
            "at": {
              "type": "string"
            },
            "kind": {
              "const": "mac_app",
              "type": "string"
            }
          },
          "required": [
            "kind",
            "at"
          ],
          "type": "object"
        },
        {
          "description": "The default browser (a web console).",
          "properties": {
            "kind": {
              "const": "browser",
              "type": "string"
            }
          },
          "required": [
            "kind"
          ],
          "type": "object"
        }
      ]
    },
    "OutputValue": {
      "description": "An output's value (a Terraform module's output). A sensitive one shows as `***` wherever it\nis written out (its JSON, its `Debug`, an event); the runner keeps the value itself for the\nembedder ([`OutputValue::revealed`]).",
      "properties": {
        "name": {
          "description": "Its name.",
          "type": "string"
        },
        "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",
        "sensitive"
      ],
      "type": "object"
    },
    "Park": {
      "description": "How a run is parked: the manifest's `lifecycle.park.pause` or `.shutdown` steps.",
      "oneOf": [
        {
          "const": "pause",
          "description": "Suspended, memory kept where the target can (Docker: stopped).",
          "type": "string"
        },
        {
          "const": "shutdown",
          "description": "Shut down.",
          "type": "string"
        }
      ]
    },
    "Protocol": {
      "description": "A port's transport protocol.",
      "oneOf": [
        {
          "const": "tcp",
          "description": "TCP.",
          "type": "string"
        },
        {
          "const": "udp",
          "description": "UDP.",
          "type": "string"
        }
      ]
    },
    "Provider": {
      "description": "A Vagrant provider: the hypervisor `vagrant up --provider` takes. Exhaustive: whoever detects\nor offers providers (`isothrum-machine`) fails to compile until a new one has its row.",
      "oneOf": [
        {
          "const": "virtualbox",
          "description": "VirtualBox.",
          "type": "string"
        },
        {
          "const": "vmware_desktop",
          "description": "VMware Workstation or Fusion.",
          "type": "string"
        },
        {
          "const": "hyperv",
          "description": "Hyper-V.",
          "type": "string"
        },
        {
          "const": "parallels",
          "description": "Parallels Desktop.",
          "type": "string"
        },
        {
          "const": "libvirt",
          "description": "libvirt (KVM).",
          "type": "string"
        },
        {
          "const": "qemu",
          "description": "QEMU.",
          "type": "string"
        },
        {
          "const": "utm",
          "description": "UTM.",
          "type": "string"
        },
        {
          "const": "vmware_esxi",
          "description": "An ESXi server.",
          "type": "string"
        }
      ]
    },
    "PublishedPort": {
      "description": "A published port: where a machine's port answers on the host.",
      "properties": {
        "host_port": {
          "description": "The host port it is reached at, at the machine's host address.",
          "format": "uint16",
          "maximum": 65535,
          "minimum": 0,
          "type": "integer"
        },
        "port": {
          "description": "The machine's port, inside it.",
          "format": "uint16",
          "maximum": 65535,
          "minimum": 0,
          "type": "integer"
        },
        "protocol": {
          "anyOf": [
            {
              "$ref": "#/$defs/Protocol"
            },
            {
              "type": "null"
            }
          ],
          "description": "`tcp` or `udp`; `None` when the tool doesn't say (Vagrant's `port`), never guessed."
        }
      },
      "required": [
        "port",
        "host_port"
      ],
      "type": "object"
    },
    "RunState": {
      "description": "Where a run stands.",
      "oneOf": [
        {
          "const": "creating",
          "description": "Being created by an `up`.",
          "type": "string"
        },
        {
          "const": "ready",
          "description": "Up, every member machine running.",
          "type": "string"
        },
        {
          "const": "failed",
          "description": "Something of it exists, but not every member machine runs (a failed start, a machine down).",
          "type": "string"
        },
        {
          "const": "parking",
          "description": "Being parked.",
          "type": "string"
        },
        {
          "const": "parked",
          "description": "Parked: stopped, what it created kept.",
          "type": "string"
        },
        {
          "const": "resuming",
          "description": "Being resumed.",
          "type": "string"
        },
        {
          "const": "updating",
          "description": "Being brought up to date with its manifest by an `update`.",
          "type": "string"
        },
        {
          "const": "destroying",
          "description": "Being removed by a `down`.",
          "type": "string"
        },
        {
          "const": "absent",
          "description": "Nothing of it exists.",
          "type": "string"
        }
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "A run as it stands.",
  "properties": {
    "desired": {
      "anyOf": [
        {
          "$ref": "#/$defs/Desired"
        },
        {
          "type": "null"
        }
      ],
      "description": "What the user wants of the run (the last operation that set it: `up`, `park`, `down`);\nnone for a run never recorded. With `state`, whether the run is where it should be."
    },
    "failed_cause": {
      "anyOf": [
        {
          "$ref": "#/$defs/ErrorCode"
        },
        {
          "type": "null"
        }
      ],
      "description": "Why the run failed, when its recorded state is `failed`."
    },
    "live": {
      "default": true,
      "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"
    },
    "machines": {
      "description": "Every machine its tool reports.",
      "items": {
        "$ref": "#/$defs/MachineStatus"
      },
      "type": "array"
    },
    "native": {
      "anyOf": [
        {
          "$ref": "#/$defs/NativeApp"
        },
        {
          "type": "null"
        }
      ],
      "description": "The hypervisor's own app the run's VMs open in ([`crate::Running::native_console`]); none\nwhere there is none (containers, QEMU), and while not [`Status::live`]."
    },
    "outputs": {
      "description": "What the project gives back (a module's outputs), as read; none while not\n[`Status::live`].",
      "items": {
        "$ref": "#/$defs/OutputValue"
      },
      "type": "array"
    },
    "parks": {
      "description": "The ways the run can be parked, by its format and provider ([`park_modes`]): none for a\nrun never recorded, nor for a Terraform module, which is never parked. Whether it can be\nparked now is its `state`'s: a run is parked from `ready`.",
      "items": {
        "$ref": "#/$defs/Park"
      },
      "type": "array"
    },
    "provider": {
      "anyOf": [
        {
          "$ref": "#/$defs/Provider"
        },
        {
          "type": "null"
        }
      ],
      "description": "The Vagrant provider it uses, when it has one."
    },
    "state": {
      "$ref": "#/$defs/RunState",
      "description": "Where it stands. While an operation holds the run: the moving state it is in (`creating`\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."
    }
  },
  "required": [
    "state",
    "machines",
    "outputs"
  ],
  "title": "Isothrum run status",
  "type": "object"
}