NorskManager class
Signature:
export declare class NorskManager
Properties
| Property | Type | Description |
|---|---|---|
The daemon’s hello: its wire-protocol version, build label and the protocol skew against this SDK. Set alongside |
||
Norsk Runtime version information |
Methods
| Method | Modifiers | Description |
|---|---|---|
abortMigration(jobId, sourceRole, targetRole, reason, migrationId) |
Abort an in-flight migration. Manager dispatches |
|
Add a member at run time: a Manager whose node name no config.yaml names. The cluster records that it expects |
||
Tell this Manager where workers reach the norsk-mgr beside it (its public URL); every worker is told the whole cluster’s list. Answered by the member it is sent to, never forwarded. |
||
Append a caller-supplied event to the durable audit log — for norsk-mgr-origin actions that don’t pass through another RPC. The daemon assigns the seq and chains it. |
||
Close down the Norsk connection |
||
Worker-facing call: the worker presents its registration token and tells Manager where to dial back. On success Manager raises Online on its provider bus and dials the worker; on Unauthenticated the token is unknown (or has been deregistered). Most consumers won’t call this directly — |
||
Stops a running job |
||
|
Connect to the Norsk Manager |
|
Spawn a new EC2 instance running the worker image, and make it available for picking up jobs |
||
Create a bundle (AutoManager v1). The bundle is passed in raw PB form — auto-manager (or any other consumer) is expected to convert its own typed Bundle to PB before calling. Returns the assigned bundleId so the caller can correlate later events. |
||
Spawn a worker as a Cloud Hypervisor microVM on one of the Manager’s host agents, and make it available for picking up jobs |
||
Create a new job |
||
Spawn a new OCI instance running the worker image, and make it available for picking up jobs |
||
Delete a bundle (AutoManager v1). |
||
Deletes a job |
||
Remove a cluster slot. If a worker is currently connected on this slot, its gRPC stream is closed and any running jobs are stopped. The token is invalidated. |
||
Cloud facts for a machine type: vCPU / memory / architectures, from the Manager’s instance-type cache for |
||
Provides a stream of the activity that is happening on the server-side. Reacting to these events is essential for the creation of client-side management logic. |
||
The Big Red Button: make THIS member a one-member cluster keeping its state, at the next generation, when the cluster has lost its quorum. Rejects with FAILED_PRECONDITION while this member can reach a primary, on a witness, and with no store. On success the Manager restarts itself (the connection drops); the former members rejoin as they come back. |
||
The most recent audit-log entries (newest first), plus whether the daemon’s hash chain verified on its last boot. |
||
This Manager member’s OWN cluster event log: what happened to it (role changes and why, lease failures, members joining or retiring, takeovers settling, …). Never another member’s; a reader wanting the cluster’s whole picture asks every member and merges by time. |
||
The discovery fleet in force, secrets included, or
|
||
Whether leases are paused, and every lease held now. |
||
What idle expiry applies to a node: |
||
Every store’s schema version, and what this boot did to the store: a restore of an unreadable database from its latest backup, a migration (with the pre-upgrade backup it took first). |
||
Search for jobs by id |
||
Search for jobs by tag/date/etc. See JobSearchSettings |
||
Write to the Manager’s key/value store, all or nothing. Each write may name the revision it read ( |
||
One key of the Manager’s key/value store (decision daemon-kv), or undefined when absent. See |
||
Every key of a namespace under |
||
Leave the quorum: this member’s copy is discarded at its next boot and it runs as a follower only until it has joined a peer that carries a generation or a cluster of more than one. For the hosts an operator can still reach when forceStandalone is pressed elsewhere. The Manager restarts itself on success (the connection drops). |
||
List all registered cluster slots (active + inactive). Includes the tokens — visible to operators so they can re-copy on demand. |
||
Every instance type a provider offers, each with the regions that offer it, for picking one rather than typing it. |
||
Return a list a all the nodes the manager knows about. |
||
Security groups dev-ops marked selectable for workers (tagged |
||
Record a durable terminal-failed verdict on a job (AutoManager writeback when it gives up: restart ceiling exceeded / bronze drop). The job is marked terminally failed and persisted so it is not re-placed after a restart. |
||
notifyMigrationCutoverApply(targetJobKey, migrationId, payload) |
Tell the target worker "the source stopped output at |
|
notifyMigrationCutoverReady(sourceJobKey, migrationId, payload) |
Tell the source worker "the target is ready at |
|
The propose step (Phase F): ask the SOURCE what state it would hand over, before any target has been placed. The source’s answer — a payload, or a refusal — comes back asynchronously on the event stream as |
||
Lease-protected jobs (protocol 1.6): pause leases for a single Manager’s maintenance. Workers keep their lease-protected jobs without refreshing, and no such job whose holder was lost starts again until |
||
Pre-warm a node (Phase G, warm nodes): tell its worker to pull these image refs now, so a later job start there finds them local. Returns as soon as the worker has been told — the per-ref outcome arrives asynchronously on the event stream as A failure on one ref never fails the others; each ref’s result says for itself. |
||
Operator-initiated retention prune of the audit log. Clears entries strictly older than |
||
Publish norsk-mgr’s role-store replica (norsk-ctl design |
||
Publish the deployment’s discovery fleet: every replica’s address, the leaf token, and the tier secret node tokens are minted from. The Manager keeps it and sends each connected node, and each node at its hello, its own access (every replica address, the leaf token and a node token minted for it); the tier secret never reaches a node. Refused (INVALID_ARGUMENT) when the tier secret is empty or equals the leaf token, or an address is not host:port. The first tier secret and leaf token published STAY IN FORCE: a later publish carrying different ones keeps them, and the reply says so ( |
||
Pre-register a cluster slot. Returns a |
||
Re-read the Manager’s overrides file (cloud regions and worker image version tables) and apply it to the running providers, with no Manager restart. Call after writing the file. |
||
Retire a Manager from its cluster: remove the member on |
||
Resume leases; every grace then runs from now. |
||
One step of rotating the discovery fleet’s tier secret, without a moment when any node’s token is refused: - Each norsk-mgr runs its replica with the step it reads, so wait for every replica to have taken one before the next. A step out of order is refused (FAILED_PRECONDITION), as is one before any fleet has been published. Returns the fleet in force after the step. Protocol 1.7. |
||
Set (or, with |
||
Reassign a cluster slot to a different pool. Empty string = unassign. If the slot is currently active, Manager cycles Stopping/Terminated/ Online so the updated |
||
Give ONE node its own grace period before the empty-node reaper terminates it, overriding the daemon-wide value. Pass 0 to clear the override and go back to the daemon-wide value. The setting is daemon-owned and persisted: it survives a Manager restart, which is exactly when a node deliberately kept warm would otherwise be reaped. |
||
Merge tags onto a node: a key given here replaces its value, keys not given are untouched. The daemon persists the edit and re-applies it when it rediscovers the node after a restart, pushes it to the provider, and announces the node’s new metadata as a |
||
Activate a dormant (start_mode = "manual") bundle job. Manager removes the dormant tag and re-emits jobUpdated; placement picks the job up via the normal flow. See §10.2 of the AutoManager design. |
||
Start a job on a node |
||
Start an instance that was provisioned with |
||
Stop a bundle job and keep it down: the daemon stops every running instance and re-stamps the dormant tag ( |
||
Stop a job running on a node |
||
Forcibly stop a node |
||
Update a bundle (AutoManager v1). Same convention as createBundle — caller passes raw PB. |
||
Update a job |