NorskManager class

The entrypoint for all Norsk Manager applications

Signature:

export declare class NorskManager

Example

const norsk = await NorskManager.connect({ url: "localhost:6790" });

Properties

Property Type Description

version

VersionInfo

Norsk Runtime version information

Methods

Method Modifiers Description

close()

Close down the Norsk connection

clusterMemberRegister(req)

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 — norsk-ctl --mode=worker --token=… --manager-url=… does it on the worker side.

completeJob(jobId)

Stops a running job

connect(settings)

static

Connect to the Norsk Manager

createAwsNode(node)

Spawn a new EC2 instance running the worker image, and make it available for picking up jobs

createBundle(bundle)

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.

createJob(job)

Create a new job

createMockNode(nodeId, tags)

Provision a node from the in-process mock provider’s URL pool (NORSK_MOCK_WORKER_URLS). Pops the next URL, raises Online with the supplied nodeId. Test-only — fails with ResourceExhausted if the pool is empty.

createOciNode(node)

Spawn a new OCI instance running the worker image, and make it available for picking up jobs

deleteBundle(bundleId)

Delete a bundle (AutoManager v1).

deleteJob(jobId)

Deletes a job

deregisterClusterNode(nodeId)

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.

eventStream(settings)

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.

jobById(id)

Search for jobs by id

jobSearch(settings)

Search for jobs by tag/date/etc. See JobSearchSettings

listClusterNodes()

List all registered cluster slots (active + inactive). Includes the tokens — visible to operators so they can re-copy on demand.

listNodes()

Return a list a all the nodes the manager knows about.

registerClusterNode(nodeName)

Pre-register a cluster slot. Returns a nodeId and a one-shot token that must be handed to a worker — the worker calls clusterMemberRegister with the token + its listen address/port + hardware info. Until the worker calls in, the slot is registered-but-inactive.

startBundleJob(bundleId, replicaIndex, jobName)

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.

startJob(jobId, role, nodeId)

Start a job on a node

stopBundleJob(bundleId, replicaIndex, jobName)

Deactivate a bundle job by re-stamping the dormant tag.

v1 caveat: this is the tag-flip half only. Runtime termination of any currently-running workload and empty-node release with linger are tracked as Phase E.5 (pre-go-live). See §10.2.1.

stopJob(jobId, role, nodeId)

Stop a job running on a node

terminateNode(nodeId)

Forcibly stop a node

updateBundle(bundle)

Update a bundle (AutoManager v1). Same convention as createBundle — caller passes raw PB.

updateJob(job)

Update a job