@infernetprotocol/cli 0.1.82 → 0.1.83
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.
- package/commands/house-models.js +1 -1
- package/commands/start.js +13 -2
- package/lib/house-models.js +9 -7
- package/package.json +9 -9
package/commands/house-models.js
CHANGED
|
@@ -41,7 +41,7 @@ INFERNET_UNCENSORED_MODELS=0, INFERNET_HOUSE_MODELS_MAX_GB=<n>.
|
|
|
41
41
|
House models are ON by default. The daemon checks
|
|
42
42
|
https://infernetprotocol.com/house-models.json on start and every 6 hours,
|
|
43
43
|
pulls listed models that fit (RAM >= min_ram_gb, and the pull leaves at least
|
|
44
|
-
10% of the disk free, 10-50 GB), one at a time
|
|
44
|
+
10% of the disk free, 10-50 GB), one at a time (waiting up to 10 min for a running job), verifies
|
|
45
45
|
each model's digest, and removes house models that leave the list. A model you
|
|
46
46
|
pulled yourself is never removed.
|
|
47
47
|
`;
|
package/commands/start.js
CHANGED
|
@@ -1697,10 +1697,19 @@ async function runDaemon(args, ctx) {
|
|
|
1697
1697
|
const followOnly = process.env.INFERNET_AUTO_UPDATE === 'follow';
|
|
1698
1698
|
const checkForUpdate = async () => {
|
|
1699
1699
|
if (shuttingDown || isUpgrading || Date.now() < updatePausedUntil) return;
|
|
1700
|
-
// Never start an upgrade under a running job; the next check retries.
|
|
1701
|
-
if (stats.activeJobIds.size > 0) return;
|
|
1702
1700
|
const latest = followOnly ? readInstalledVersion() : await fetchLatestVersion();
|
|
1703
1701
|
if (!latest || !isNewerVersion(CURRENT_VERSION, latest)) return;
|
|
1702
|
+
// Never start an upgrade under a running job. But a node that is always
|
|
1703
|
+
// busy used to skip every check and never update (bonita sat on 0.1.77
|
|
1704
|
+
// for four releases under steady chat load), so stop taking new jobs
|
|
1705
|
+
// and upgrade on the first check after the running ones finish.
|
|
1706
|
+
if (stats.activeJobIds.size > 0) {
|
|
1707
|
+
if (!stats.draining) {
|
|
1708
|
+
stats.draining = true;
|
|
1709
|
+
process.stdout.write(`[update] v${latest} available (running v${CURRENT_VERSION}) — finishing ${stats.activeJobIds.size} running job(s) first, taking no new ones\n`);
|
|
1710
|
+
}
|
|
1711
|
+
return;
|
|
1712
|
+
}
|
|
1704
1713
|
isUpgrading = true;
|
|
1705
1714
|
|
|
1706
1715
|
if (followOnly) {
|
|
@@ -1710,6 +1719,7 @@ async function runDaemon(args, ctx) {
|
|
|
1710
1719
|
const ok = await pullLatestBinary();
|
|
1711
1720
|
if (!ok) {
|
|
1712
1721
|
process.stderr.write('[update] installer failed — will retry next check\n');
|
|
1722
|
+
stats.draining = false;
|
|
1713
1723
|
isUpgrading = false;
|
|
1714
1724
|
return;
|
|
1715
1725
|
}
|
|
@@ -1721,6 +1731,7 @@ async function runDaemon(args, ctx) {
|
|
|
1721
1731
|
if (!isNewerVersion(CURRENT_VERSION, installed)) {
|
|
1722
1732
|
updatePausedUntil = Date.now() + UPDATE_PAUSE_MS;
|
|
1723
1733
|
process.stderr.write(`[update] installer left v${installed} here (latest v${latest}); not restarting, next try in ${UPDATE_PAUSE_MS / 3_600_000}h\n`);
|
|
1734
|
+
stats.draining = false;
|
|
1724
1735
|
isUpgrading = false;
|
|
1725
1736
|
return;
|
|
1726
1737
|
}
|
package/lib/house-models.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* house-models.json), served at https://infernetprotocol.com/house-models.json.
|
|
8
8
|
* Adding a model is a PR to that file. The daemon fetches it on start and every
|
|
9
9
|
* few hours, pulls each listed model that fits this machine into Ollama (one at
|
|
10
|
-
* a time,
|
|
10
|
+
* a time, preferring idle moments), verifies the pulled model's digest and
|
|
11
11
|
* size against the manifest, and removes house models that leave the manifest.
|
|
12
12
|
* Pulled models show up in served_models like any other Ollama model.
|
|
13
13
|
*
|
|
@@ -383,8 +383,10 @@ export function ramGb() {
|
|
|
383
383
|
|
|
384
384
|
/**
|
|
385
385
|
* Fetch the manifest, plan, then remove and pull one model at a time.
|
|
386
|
-
*
|
|
387
|
-
*
|
|
386
|
+
* Before each pull it waits up to `busyWaitMs` (10 min) for the node to be
|
|
387
|
+
* idle (`isBusy()`), then pulls anyway: a pull is network and disk work that
|
|
388
|
+
* Ollama does beside inference, and a node that is never idle must still get
|
|
389
|
+
* its house models. Writes the state file. Returns a summary.
|
|
388
390
|
*/
|
|
389
391
|
export async function syncHouseModels({
|
|
390
392
|
settings,
|
|
@@ -392,6 +394,8 @@ export async function syncHouseModels({
|
|
|
392
394
|
host = ollamaHost(),
|
|
393
395
|
statePath = getStatePath(),
|
|
394
396
|
isBusy = () => false,
|
|
397
|
+
busyWaitMs = 10 * 60 * 1000,
|
|
398
|
+
sleep = (ms) => new Promise((r) => setTimeout(r, ms)),
|
|
395
399
|
log = () => {},
|
|
396
400
|
capacity = null,
|
|
397
401
|
manifest = null
|
|
@@ -428,10 +432,8 @@ export async function syncHouseModels({
|
|
|
428
432
|
}
|
|
429
433
|
|
|
430
434
|
for (const m of plan.pull) {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
continue;
|
|
434
|
-
}
|
|
435
|
+
const waitUntil = Date.now() + busyWaitMs;
|
|
436
|
+
while (isBusy() && Date.now() < waitUntil) await sleep(15_000);
|
|
435
437
|
log(`pulling ${m.ollama_name} (${(m.size_bytes / GB).toFixed(1)} GB)`);
|
|
436
438
|
try {
|
|
437
439
|
let lastLog = 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infernetprotocol/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.83",
|
|
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.
|
|
36
|
-
"@infernetprotocol/config": "0.1.
|
|
37
|
-
"@infernetprotocol/deploy-providers": "0.1.
|
|
38
|
-
"@infernetprotocol/engine": "0.1.
|
|
39
|
-
"@infernetprotocol/gpu": "0.1.
|
|
40
|
-
"@infernetprotocol/liquid-agent": "0.1.
|
|
41
|
-
"@infernetprotocol/rpc-adapter": "0.1.
|
|
42
|
-
"@infernetprotocol/training": "0.1.
|
|
35
|
+
"@infernetprotocol/auth": "0.1.83",
|
|
36
|
+
"@infernetprotocol/config": "0.1.83",
|
|
37
|
+
"@infernetprotocol/deploy-providers": "0.1.83",
|
|
38
|
+
"@infernetprotocol/engine": "0.1.83",
|
|
39
|
+
"@infernetprotocol/gpu": "0.1.83",
|
|
40
|
+
"@infernetprotocol/liquid-agent": "0.1.83",
|
|
41
|
+
"@infernetprotocol/rpc-adapter": "0.1.83",
|
|
42
|
+
"@infernetprotocol/training": "0.1.83"
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
45
45
|
"type": "git",
|