Skip to main content
Version: 0.4.0

What a unit arrives with

What a Plugin unit is given before it speaks, what it is deliberately not given, the order of its first acts, and the one window that bounds them.

What the launch supplies​

Five environment variables, and nothing else.

VariableCarriesFor
YOKE_PLUGINthe plugin's namespaced identitythe name the Registry authorises and the Manifest declares
YOKE_UNITthis copy's identitythe name everything about this copy is keyed by
YOKE_SOCKETthe path of the instance's plugin channelwhere the unit registers and opens its Session
YOKE_BINDthe path this unit bindsits own socket, derived by the Core from the unit's identity
YOKE_TOKENthe bootstrap tokenproof that this process was launched by this Core, for this unit, just now
  • The environment belongs to the process and disappears with it; a token written to a file would outlive the launch it proves.
  • A deployment may not set a variable in the YOKE_ prefix. It is refused before anything runs, with unit.env.reserved.
  • There is no configuration file to find, no discovery step and no default path. Every path is derived from the instance.

The other two kinds are handed less. A unit that runs to completion receives YOKE_UNIT alone: nothing connects to an exit status, so it has no socket to bind, no token to present and no Manifest. A managed interface receives YOKE_UNIT and, in YOKE_SOCKET, the address of the channel that names it. A bootstrap token is issued for a Plugin unit's launch and no other.

What it is not given​

Not givenBecause
its authorised scopeit is the answer to registration, not an input to it
any view of the Registrya unit sees policy only as its own grant
the identities or addresses of other unitsunits never address each other
a Session identityadmission assigns it
the Core's configurationit is not the unit's concern
which incarnation it isa number a process states about itself would be a claim doing the work of an observation

A unit knows who it is, where to reach the Core, and — once admitted — what it was granted.

The order of the first acts​

Bind before registering. A unit that registers first is admitted and unreachable for a while: admission may probe the socket, the supervisor assumes an admitted unit answers, and a dependent may already be waiting on it.

#The unitThe Core
1reads the environment—
2binds YOKE_BIND— ; the socket's existence is what admission may probe
3registers on YOKE_SOCKET, presenting YOKE_TOKENdecides, in nine ordered stages (Admission)
4reads the answer: its granted scope and its heartbeat termshas computed both
5opens the Session; the first envelope carries the identity it was givenresolves the identity, or closes the stream (The Session)
6starts sending health on the assigned intervaljudges liveness against the terms it set
7serves commands, answers queries, emits only on activated streamsactivates and stops streams, creating each transport

Opening the Session (5) is a separate call from registering (3). A unit admitted with a narrowed scope may choose not to go on, and a unit that dies between the two stays distinguishable from one that was refused.

An SDK performs these steps in this order on the author's behalf.

The startup window​

One number, three uses. The default is 30s.

UseBound
the bootstrap tokenit expires at the end of the window
registrationit must complete within the window
a dependencya unit waiting for this one to become ready gives up at the same bound
  • A unit whose initialisation is slow should register first and do the rest afterwards; registration itself is cheap.
  • The window is set per unit where the deployment is described, with the deployment's value as the default. It is never set in a Manifest: a program does not declare how long its own credential lasts.

The identifying code​

A Plugin presents an identifying code, and it is checked before the process exists.

UnitThe code is
on the hosta digest of the executable, computed at launch through the descriptor that is then executed
in a containerthe image digest, which the engine verifies before running anything

The code identifies the binary, not its declaration: the case it exists for is a Manifest left untouched and the executable replaced.