feat(dvm): add dvm worker registry settings and process topology - #721
Open
Priyanshubhartistm wants to merge 4 commits into
Open
feat(dvm): add dvm worker registry settings and process topology#721Priyanshubhartistm wants to merge 4 commits into
Priyanshubhartistm wants to merge 4 commits into
Conversation
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
🦋 Changeset detectedLatest commit: 8257e7f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the worker registry and process topology needed before the relay can route NIP-90 DVM jobs to external worker processes. This is a foundation/skeleton PR - no job ingestion or IPC dispatch yet.
dvm:settings section (Dvm/DvmWorkertypes insrc/@types/settings.ts, defaultdvm: workers: []inresources/default-settings.yaml) so operators can register DVM workers (command, args, accepted job kinds, timeout), following the exact same shape as the existingmirroring.staticlist-of-configs convention.WORKER_TYPE=dvm-orchestratorprocess type into the cluster topology:App.run()forks one process per configureddvm.workers[]entry (mirroring the existingmirroring.staticfork loop), andsrc/index.ts'sgetRunner()dispatches to a new factory.DvmOrchestratorWorker(src/app/dvm-orchestrator-worker.ts) implementing the repo'sIRunnableinterface: reads its assigned config viaDVM_WORKER_INDEX, wires standardSIGINT/SIGHUP/SIGTERM/uncaughtException/unhandledRejection handling matching
MaintenanceWorker/StaticMirroringWorker, and exits non-zero if no config is found for its index. It does not spawn or dispatch jobs yet.dvm.workers[]settings inCONFIGURATION.md.Related Issue
Part of #639
Motivation and Context
Nostream has no support for Data Vending Machines (NIP-90) today. The DVM kind range (5000-6999) is used in production by real services despite the NIP's
unrecommendedstatus upstream, so the relay needs to handle these events properly. Before job routing, lifecycle tracking, or IPC dispatch can be built, the relay needs a place for operators to register available DVM workers and a process topology to run them in — that's what this PR adds. Job ingestion (trapping kind 5000-5999 events) and IPC dispatch (spawning workers, sending jobs, publishing results) are separate, independently reviewable follow-up PRs.How Has This Been Tested?
DvmOrchestratorWorker(startup with a valid config, exit(1) when no config exists for the assigned index, signal handling on SIGTERM,close()callback invocation) and fordvmOrchestratorWorkerFactory5 new tests total, following the existingMaintenanceWorker/maintenanceWorkerFactorytest conventions (Sinon-stubbedprocessEventEmitter, stubbed settings function).pnpm exec commitlint --from=upstream/main --to=HEADpnpm exec changeset status --since upstream/mainpnpm lint,pnpm check:format(touched files),pnpm check:depspnpm run build:check,pnpm run build,pnpm run verify:cli:buildpnpm run test:unit— 1505 passingpnpm run test:cli— 73 passingpnpm run cover:unit— new files at 91.66%/100% coveragepnpm run docker:test:integration— 99 scenarios / 489 steps passing (ran this despite thechange being additive, since it touches the primary process's fork loop in
app.tsand theWORKER_TYPEdispatch inindex.ts)dvm.workersdefaults to[], so nodvm-orchestratorworkers are forked and existing topology (client workers, maintenance worker, static-mirroring workers) is unaffected unless an operator explicitly configuresdvm.workers.Screenshots (if appropriate):
N/A — process topology / settings change, no UI.
Types of changes
Checklist: