@orchestraworks/worker 0.0.152 → 0.0.154
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/docs/REFERENCE.md +41 -36
- package/package.json +6 -6
package/docs/REFERENCE.md
CHANGED
|
@@ -22,8 +22,9 @@ The worker exposes no API of its own. Every route it calls is the platform's.
|
|
|
22
22
|
| `stream/` | the queue: every placement message and every prompt, steer and cancel pulled off this machine's work consumer, the ACP client that opens a session's harness conversation and runs its turns, each turn's events batched to the platform and published live, and the answer every placement message is owed |
|
|
23
23
|
| `mount/` | the volumes the launch declares, placed on the lanes that mount them: the home volume first, because anything written under a mount point before the mount is hidden by it |
|
|
24
24
|
| `network/` | the transparent redirect the launch describes, as the worker's own nftables table written over netlink with no program from the image: what the worker's own uid reaches directly, and what every uid on the machine reaches through the egress edge |
|
|
25
|
-
| `shim/` | the in-guest transparent proxy: the listener the redirect lands on, the recovery of the destination each connection was actually for, the hop to the egress edge under the machine-identity proof, the WinDivert half that is the Windows redirect
|
|
25
|
+
| `shim/` | the in-guest transparent proxy: the listener the redirect lands on, the recovery of the destination each connection was actually for, the hop to the egress edge under the machine-identity proof, and the WinDivert half that is the Windows redirect |
|
|
26
26
|
| `egress/` | what puts that proxy in place on the virtual-machine lanes: the edge's certificate authority in this machine's trust store, the inbound firewall rule Windows needs, the redirect itself, and the state line an operator reads off the machine's console |
|
|
27
|
+
| `oneworker/` | the one-worker lock: the fixed loopback port whose bind stops a second worker on the machine |
|
|
27
28
|
| `ingress/` | the machine's half of the preview tunnel: the connection this worker holds open to the preview gateway, the challenge and the signed upgrade that authenticate it, and the loopback pipe that carries each viewer request to a port this machine declared and refuses every other |
|
|
28
29
|
| `termination/` | the cloud's notice that this machine is being reclaimed, delivered to the broker so the next status report carries it |
|
|
29
30
|
| `paths/` | which native place a logical path denotes, and when two logical paths denote one place — pinned against the platform's own answer by committed vectors |
|
|
@@ -48,12 +49,12 @@ Each `ORCHESTRA_` machine variable this page names also has a former `SFDK_` spe
|
|
|
48
49
|
work consumer and reports on the cadence.
|
|
49
50
|
|
|
50
51
|
Before any of that, `run` starts what the launch describes: it places the declared volumes, puts
|
|
51
|
-
the in-guest egress in place where the launch names an intercept set,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
the in-guest egress in place where the launch names an intercept set, takes the one-worker lock, and —
|
|
53
|
+
on a machine the cloud can reclaim — watches for the notice that it is going away. Each is started
|
|
54
|
+
only where it is described: a launch that names no volumes places none, and one that names no
|
|
55
|
+
intercept set installs no redirect. If one of those duties is installed and then dies, `run` ends
|
|
56
|
+
rather than serving a machine the platform counts as healthy with no route off it; the service
|
|
57
|
+
manager starts the worker again.
|
|
57
58
|
|
|
58
59
|
`--service` is how the process is hosted rather than what it does: on Windows it hands the body to
|
|
59
60
|
the service control manager, which kills a service that does not answer its handshake, and on the
|
|
@@ -82,17 +83,31 @@ Each `ORCHESTRA_` machine variable this page names also has a former `SFDK_` spe
|
|
|
82
83
|
forms fill the installer seam in `cmd/worker/install.go`; a build with none refuses rather than
|
|
83
84
|
reporting an install it did not perform.
|
|
84
85
|
|
|
85
|
-
**An install
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
86
|
+
**An install stops the running worker when it changes what the service reads.** When `--service` is not
|
|
87
|
+
`none`, the install may stop the worker service in its scope, and the service an earlier release
|
|
88
|
+
registered. It stops them in three cases. A named family, or the pinned Node the families run on, needs
|
|
89
|
+
installing. An enrollment token, or its file, is in its environment. The service definition it writes
|
|
90
|
+
differs from the one on disk, or, for a `worker`, the bootstrap file does. A file it cannot read counts
|
|
91
|
+
as different. On Windows the definition never counts as different: a changed one takes effect at the
|
|
92
|
+
next start. Otherwise it leaves the service as it is. A running service installs and runs harnesses
|
|
93
|
+
from the same root, and nothing else keeps the two apart. Only a fresh start redeems an enrollment
|
|
94
|
+
token, and the install waits for the registration that start makes. On macOS, launchd also loads a
|
|
95
|
+
changed property list only after a stop. A definition that counts as different, or a changed bootstrap
|
|
96
|
+
file, stops the service, so it does not keep running on the old ones. A `worker` then starts again at
|
|
97
|
+
once.
|
|
98
|
+
|
|
99
|
+
The stop keeps each service's definition, and the install prints `the worker service is stopped while
|
|
100
|
+
this install runs`. The service starts again only after the whole install succeeds, and then at the
|
|
101
|
+
time its role sets, below. When the stop fails, the install changes nothing. When a later step fails,
|
|
102
|
+
or a signal interrupts the install after the stop, the service stays stopped and the error says so. For
|
|
103
|
+
a `worker`, run `worker install` again to start it. A signal during the stop itself gives an error that
|
|
104
|
+
says the service may still be stopping. A signal before the stop ends the install quietly, with nothing
|
|
105
|
+
stopped and nothing changed.
|
|
106
|
+
|
|
107
|
+
**An install that would change nothing does not stop the worker service.** A running service keeps
|
|
108
|
+
its open turns. The install prints `this install changes nothing under <root> and does not stop the
|
|
109
|
+
worker service; an upgraded worker runs after the service restarts`. A worker upgraded at the same path
|
|
110
|
+
leaves the definition as it is, so the running service keeps the program it started with.
|
|
96
111
|
|
|
97
112
|
**`--service` says which session the worker is registered in, and neither of its two values needs any
|
|
98
113
|
privilege.** `user` registers it in the invoking account's own session: a launch agent under
|
|
@@ -381,8 +396,7 @@ service, which answers the evidence that call presents. Nothing is uid-wide, so
|
|
|
381
396
|
stays intercepted and this worker's own content pulls meet the platform's rule at the edge.
|
|
382
397
|
|
|
383
398
|
The redirect takes its Windows form on Windows and its nftables form everywhere else, whatever the
|
|
384
|
-
substrate. A
|
|
385
|
-
lane's redirect and runs its own shim, which reads the token from the loopback feed below. A Launcher
|
|
399
|
+
substrate. A launch that names no intercept set runs only the certificate step. A Launcher
|
|
386
400
|
machine, a Launcher pod included, names an intercept set: where `install-machine --egress-redirect`
|
|
387
401
|
wrote the file `egress-redirect` under the worker root this worker installs the redirect itself, and
|
|
388
402
|
where it did not, as on an image built before that file existed, the worker binds the local egress port
|
|
@@ -407,24 +421,15 @@ because the metadata service is never reached through a proxy. Where a redirect
|
|
|
407
421
|
names are left out of the environment each harness and the setup script are handed, so the agent's
|
|
408
422
|
calls reach the redirect, which carries them to the edge.
|
|
409
423
|
|
|
410
|
-
## The
|
|
424
|
+
## The one-worker lock
|
|
411
425
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
carry, not a placed value — and the shim connects with retry.
|
|
426
|
+
On every machine the worker listens on `127.0.0.1:7788`, so that a second worker started on the same
|
|
427
|
+
machine finds the port held and stops. The port is a constant, not a placed value, and
|
|
428
|
+
`orchestra outpost up` checks the same port to refuse a second outpost on one machine.
|
|
416
429
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
{"generation": 7, "token": "<the machine token>", "expiresAt": "2026-09-12T10:15:00.123456Z"}
|
|
421
|
-
```
|
|
422
|
-
|
|
423
|
-
On connect the worker writes the generation this machine holds now, and one line per rotation after
|
|
424
|
-
that. It writes nothing else on that socket and never reads from it, and it listens on loopback and
|
|
425
|
-
nowhere else. A worker restart drops the connection; the shim reconnects and is fed the current
|
|
426
|
-
generation again. The broker credential co-issued beside the token never crosses this channel, and
|
|
427
|
-
neither does the holder key.
|
|
430
|
+
The worker writes nothing on that port: it closes each connection as soon as it accepts it, and a
|
|
431
|
+
completed connection is the whole answer. It listens on loopback and nowhere else. No credential
|
|
432
|
+
crosses this port: not the machine token, the broker credential or the holder key.
|
|
428
433
|
|
|
429
434
|
## Building and testing
|
|
430
435
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orchestraworks/worker",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.154",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Orchestra worker.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"docs/REFERENCE.md"
|
|
19
19
|
],
|
|
20
20
|
"optionalDependencies": {
|
|
21
|
-
"@orchestraworks/worker-linux-x64": "0.0.
|
|
22
|
-
"@orchestraworks/worker-linux-arm64": "0.0.
|
|
23
|
-
"@orchestraworks/worker-darwin-x64": "0.0.
|
|
24
|
-
"@orchestraworks/worker-darwin-arm64": "0.0.
|
|
25
|
-
"@orchestraworks/worker-win32-x64": "0.0.
|
|
21
|
+
"@orchestraworks/worker-linux-x64": "0.0.154",
|
|
22
|
+
"@orchestraworks/worker-linux-arm64": "0.0.154",
|
|
23
|
+
"@orchestraworks/worker-darwin-x64": "0.0.154",
|
|
24
|
+
"@orchestraworks/worker-darwin-arm64": "0.0.154",
|
|
25
|
+
"@orchestraworks/worker-win32-x64": "0.0.154"
|
|
26
26
|
}
|
|
27
27
|
}
|