Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/cluster-owner-approval-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### The guided cluster setup asks the DevNet coordinator for its own approval

After the Test stage passes, `darkbloom cluster` asks the coordinator to register a model approval for the pair (model, its artifact, prefill schedule and the installed app's version, with the account's credential). The pair then reads the coordinator's public approvals together with the account's own approvals, at setup and at every later check, and saves the match as before. On DevNet no operator adds an approval row for a new pair. Production and staging do not take the request: the setup says so on one line ("Cluster approval request: …"), and the pair serves as before. The cluster service asks the same way while the pair holds no approval (at its start and after an update) and renews the approval a week before it ends. A failed request never stops serving, and running the setup again is safe.
11 changes: 8 additions & 3 deletions docs/architecture/inference.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,14 @@ and `libs/darkbloom-cluster/Sources/DarkbloomClusterPlacement/ClusterPlacementBa
`ClusterOnboardingDriver` presents connection, pairing, model choice, startup
and a test response as five stages. Completion requires the test response to
succeed; a failed response retains the saved setup for a later retry. After
the test response succeeds, the control leader registers the pair with the
coordinator when the coordinator serves a cluster approval for this pair
(`ClusterOnboardingDriver.register`, control operation `register`). Both parts
the test response succeeds, the control leader first asks the coordinator to
register a model approval for this pair (`ClusterApprovalRequest`,
`POST /v1/cluster/owner-approvals`; only DevNet takes it, and every other
answer is one line that stops nothing). It then registers the pair with the
coordinator when the coordinator serves a cluster approval for this pair,
in its public list or in the account's own approvals
(`ClusterApprovalFetch.fetchOwned`; `ClusterOnboardingDriver.register`,
control operation `register`). Both parts
then run as coordinator-paired members
(`ClusterService.Settings.memberArguments`), which have no local API, and the
ready screen shows the registered line (`ClusterOnboardingReady.offered`,
Expand Down
6 changes: 6 additions & 0 deletions docs/developer/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,12 @@ frame (member nonce, epoch, generation, renewal payloads and a refused payload).
check the provider against them; the platform's own tests must agree. Refresh them only together with the
coordinator change, after review.

`owner_cluster_approval_vector.json` in the same folder is byte for byte the vector of the same name in the
platform repository's coordinator API tests: the `POST /v1/cluster/owner-approvals` body
the provider sends, the coordinator's 201 answer and the approval's canonical policy bytes.
`ClusterApprovalRequestTests` checks that the provider sends exactly that body and verifies the answer's
`policy_sha256`. Replace it only with the platform's file.

The `cluster-member-fixture-child` executable target (`provider-swift/Tests/ClusterMemberFixtureChild/`)
is a CPU-only stand-in for an installed owner and its native child, run by the
native-pair member control tests over the real owner pipe and key prelude. It is
Expand Down
15 changes: 11 additions & 4 deletions docs/provider/two-mac-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ start fails and says why. To serve without any coordinator, use

## Registered with the coordinator as a cluster member (DevNet)

When the coordinator's operator approval file holds a cluster approval for this
pair's model (DevNet only), the pair registers with the coordinator by itself.
On DevNet the guided setup asks the coordinator for a cluster approval for
this pair's model, and the pair registers with the coordinator by itself. An
approval the coordinator's operator added for the model is taken the same way.
Nothing is typed and no file is copied. Production and staging serve no
approvals, and the pair serves as described above. The pair
serves its owner's own requests, and public requests too once the coordinator's
Expand All @@ -121,8 +122,14 @@ split ([serving a pair](../reference/cluster-control-protocol.md#serving-a-pair)
A tensor-parallel pair registers like a pipeline one; its plan names no cut.

1. Run `darkbloom cluster` and choose a model, as in [the steps](#the-steps-once).
After the Test stage passes, the leader reads the approvals the coordinator
serves (`GET /v1/cluster/approvals`) and takes the one whose model and
After the Test stage passes, the leader asks the coordinator to register a
model approval for this pair (`POST /v1/cluster/owner-approvals`, with the
account's credential; only DevNet takes it, and any other answer is one
line that changes nothing). The cluster service asks the same way later
while the pair holds no approval, for example after an update, and renews
the approval a week before it ends. Then it reads the approvals the coordinator
serves (`GET /v1/cluster/approvals`, and the account's own approvals from
`GET /v1/cluster/owner-approvals`) and takes the one whose model and
prefill schedule match this pair's setup. A build-pinned approval must also
match the installed app's digests. A model approval names no build and must
match only the model's artifact, so it stays valid after an update
Expand Down
3 changes: 2 additions & 1 deletion docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,8 @@ pair's placement; [serving a pair](cluster-control-protocol.md#serving-a-pair)).

| Step | Rule | Source |
|---|---|---|
| Fetch | `GET <coordinator>/v1/cluster/approvals`, no query, no credential; HTTPS only (plain HTTP only to this Mac's loopback); no redirect; at most `maximumBytes = 512 * 1024` bytes and `maximumApprovals = 128` entries; `timeoutSeconds = 10`. The body is `darkbloom_cluster_catalog_v2` with `cluster_approvals`. Each entry has the fields of one of the two shapes (build-pinned or model approval); one list can hold both. One unknown, missing or malformed field refuses the whole answer. 404 (pair control off: production, staging) and every failure mean no approval. A read error after an HTTP answer is an answer that cannot be used, not "no answer" | `provider-swift/Sources/ProviderCore/Inference/Distributed/Membership/ClusterApproval/ClusterApprovalFetch.swift` (`ClusterApprovalFetch`) |
| Request | Before the Fetch, the control leader asks its coordinator to register the pair's model approval under the account: after the guided setup's Test stage, and at each cluster service check while the saved setup holds no approval, or holds an owner approval (id `owner/…`) within `renewWithinSeconds = 7 * 86_400` of its `not_after`, which it first deletes (`DELETE <coordinator>/v1/cluster/owner-approvals/{id}`; 204 or 404 go on, any other answer stops the renewal). The request is `POST <coordinator>/v1/cluster/owner-approvals` with the account credential (`Authorization: Bearer`, the saved `auth_token`) and the body `{"provider_version","model","artifact_sha256","schedule"}` in that order: the installed app's `CFBundleShortVersionString` (the `Contents/Info.plist` beside the setup's helpers), the setup's `publicModelID`, its `capability.artifactSHA256` and its prefill schedule (`1` or `2`). The coordinator's tests pin the same bytes (`provider-swift/Tests/ProviderCoreTests/Fixtures/coordinator-wire/owner_cluster_approval_vector.json`). Same URL rules as the Fetch. A 200 or 201 holds `{"approval":{…},"policy_sha256":"…"}`, read like an owner entry of the Fetch; the coordinator answers the live approval it already holds for the model and schedule, so asking again is safe. Every outcome is one line ("Cluster approval request: …") that stops nothing: 403 or 404 (production, staging, a build without `-dev.`), another 4xx (400, 409 when the account or the owner catalog is full), nothing sent (no credential, no version), or a failure (no answer, 5xx, an unreadable answer). The service asks again at its next check only after a failure (no answer, 5xx, an unreadable answer); any other outcome settles that need (asking for one, or renewing one approval) until the next service run or update, so a registered approval that this Mac then cannot save is not asked for, nor stopped for, every minute. A check that a running cluster command kept from saving asks again at the next check. A renewal is a new need. Not sent by a local-only cluster or for a setup with a pair approval saved by hand or an operator's approval | `provider-swift/Sources/ProviderCore/Inference/Distributed/Membership/ClusterApproval/ClusterApprovalRequest.swift` (`need`, `ensure`); `ClusterService.checkApproval` |
| Fetch | `GET <coordinator>/v1/cluster/approvals`, no query, no credential; with the account credential also `GET <coordinator>/v1/cluster/owner-approvals` (`{"approvals":[{"approval":{…},"policy_sha256":"…"}]}`: the account's own approvals, which the public list does not hold; each `approval` is read like a public entry and its `policy_sha256` must be the SHA-256 of the canonical policy bytes this Mac derives). Its entries join the public list; 401, 403 or 404 there means the account holds none and leaves the public answer as it is; any other failure of either request is the answer; HTTPS only (plain HTTP only to this Mac's loopback); no redirect; at most `maximumBytes = 512 * 1024` bytes and `maximumApprovals = 128` entries; `timeoutSeconds = 10`. The body is `darkbloom_cluster_catalog_v2` with `cluster_approvals`. Each entry has the fields of one of the two shapes (build-pinned or model approval); one list can hold both. One unknown, missing or malformed field refuses the whole answer. 404 (pair control off: production, staging) and every failure mean no approval. A read error after an HTTP answer is an answer that cannot be used, not "no answer" | `provider-swift/Sources/ProviderCore/Inference/Distributed/Membership/ClusterApproval/ClusterApprovalFetch.swift` (`ClusterApprovalFetch`) |
| Match | The entry whose `model` is the setup's `publicModelID`, whose `schedule` is its prefill schedule (`1` serial, `2` one-chunk lookahead), and that is still current. A model approval matches when its `artifact_sha256` is the saved setup's `capability.artifactSHA256`; no runtime facts are computed for it. A build-pinned entry matches when its eight digests all equal this Mac's own cluster runtime facts (computed at most once per check from the helpers beside the setup's worker and the setup's model folder). Latest `not_after` first, across both shapes. An entry for another build or another copy of the model does not match | `provider-swift/Sources/ProviderCore/Inference/Distributed/Membership/ClusterApproval/ClusterApprovalLifetime.swift` (`select`) |
| Check | On each Mac, against its own files: every digest of a build-pinned entry (`ClusterApprovalAttachment.mismatches`), or the artifact of a model approval (refusal: "the approval's artifact_sha256 differs from this Mac's setup"); the member's own start refusals (`requireLocalRankGranted`); the roster of this Mac's pairing (S17); `validate` below | `provider-swift/Sources/ProviderCore/Inference/Distributed/Membership/ClusterApproval/ClusterApprovalAttachment.swift` (`attachment`) |
| Save | Both parts stop. The leader checks the entry, sends it to the other Mac over the cable (service command `approval`), and saves it only after the other Mac checked and saved it. A refusal on either Mac saves it on neither. Both parts then start as cluster members | `provider-swift/Sources/ProviderCore/Inference/Distributed/Membership/ClusterApproval/ClusterApprovalSync.swift` (`run`, `receive`) |
Expand Down
Loading
Loading