@infernetprotocol/cli 0.1.90 → 0.1.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/commands/start.js +16 -0
  2. package/package.json +9 -9
package/commands/start.js CHANGED
@@ -423,6 +423,10 @@ async function runDaemon(args, ctx) {
423
423
  }
424
424
  return {
425
425
  active_jobs: stats.activeJobIds.size,
426
+ // How many jobs this daemon runs at once. Without it the router
427
+ // guesses (1 on CPU-only nodes, 4 with a GPU) and a GPU node
428
+ // running one job at a time gets 3 queued behind it.
429
+ concurrency_cap: maxConcurrentJobs,
426
430
  load_avg_1m: Array.isArray(host.load_avg) ? +host.load_avg[0]?.toFixed(2) : null,
427
431
  ram: {
428
432
  total_gb: +totalRamGb.toFixed(2),
@@ -629,10 +633,21 @@ async function runDaemon(args, ctx) {
629
633
  // frees up.
630
634
  if (stats.activeJobIds.size >= maxConcurrentJobs) return;
631
635
  const polledAt = Date.now();
636
+ let refetch = false;
632
637
  try {
633
638
  const result = await client.pollJobs({ limit: 5 });
634
639
  stats.pollsOk += 1;
640
+ const fetchedAt = Date.now();
635
641
  for (const job of result?.jobs ?? []) {
642
+ // Jobs are awaited one by one, so after a long job the rest of
643
+ // this batch is minutes old. The control plane may have moved
644
+ // a queued job to a free node meanwhile (chat rebalancing), and
645
+ // running it here would only be refused at the first event.
646
+ // Fetch a fresh list instead.
647
+ if (Date.now() - fetchedAt > pollMs) {
648
+ refetch = true;
649
+ break;
650
+ }
636
651
  // Skip jobs already being processed by this daemon — the
637
652
  // server keeps returning 'assigned' jobs until we mark them
638
653
  // complete, so without this guard the poll loop queues the
@@ -652,6 +667,7 @@ async function runDaemon(args, ctx) {
652
667
  stats.pollsFailed += 1;
653
668
  process.stderr.write(`job poll error: ${err?.message ?? err}\n`);
654
669
  }
670
+ if (refetch && !stats.draining) await pollJobs();
655
671
  }
656
672
 
657
673
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infernetprotocol/cli",
3
- "version": "0.1.90",
3
+ "version": "0.1.92",
4
4
  "description": "GPU-node CLI / daemon for the Infernet Protocol — register a GPU server with a Supabase control plane and start earning.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,14 +32,14 @@
32
32
  "ora": "^9.4.1",
33
33
  "react": "^17.0.2",
34
34
  "react-blessed": "^0.7.2",
35
- "@infernetprotocol/auth": "0.1.90",
36
- "@infernetprotocol/config": "0.1.90",
37
- "@infernetprotocol/deploy-providers": "0.1.90",
38
- "@infernetprotocol/engine": "0.1.90",
39
- "@infernetprotocol/gpu": "0.1.90",
40
- "@infernetprotocol/liquid-agent": "0.1.90",
41
- "@infernetprotocol/rpc-adapter": "0.1.90",
42
- "@infernetprotocol/training": "0.1.90"
35
+ "@infernetprotocol/auth": "0.1.92",
36
+ "@infernetprotocol/config": "0.1.92",
37
+ "@infernetprotocol/engine": "0.1.92",
38
+ "@infernetprotocol/deploy-providers": "0.1.92",
39
+ "@infernetprotocol/gpu": "0.1.92",
40
+ "@infernetprotocol/liquid-agent": "0.1.92",
41
+ "@infernetprotocol/training": "0.1.92",
42
+ "@infernetprotocol/rpc-adapter": "0.1.92"
43
43
  },
44
44
  "repository": {
45
45
  "type": "git",