dcp-worker 3.2.21 → 3.2.23
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/bin/dcp-worker +10 -7
- package/etc/dcp-config.js +26 -21
- package/package.json +2 -2
package/bin/dcp-worker
CHANGED
|
@@ -43,7 +43,10 @@ async function main () {
|
|
|
43
43
|
if (!ANALYZE_UNHANDELD_REJECTION)
|
|
44
44
|
process.on('unhandledRejection', unhandledRejectionHandler);
|
|
45
45
|
|
|
46
|
-
await require('dcp-client').init(
|
|
46
|
+
await require('dcp-client').init({
|
|
47
|
+
configName: '../etc/dcp-config',
|
|
48
|
+
});
|
|
49
|
+
|
|
47
50
|
dcpConfig = require('dcp/dcp-config');
|
|
48
51
|
|
|
49
52
|
const cliArgs = require('dcp/cli')
|
|
@@ -274,9 +277,10 @@ async function startWorking(cliArgs) {
|
|
|
274
277
|
|
|
275
278
|
|
|
276
279
|
/** @type {string[]} */
|
|
277
|
-
const dcpWorkerOptions =
|
|
280
|
+
const dcpWorkerOptions = dcpConfig.worker;
|
|
281
|
+
|
|
282
|
+
Object.assign(dcpWorkerOptions, {
|
|
278
283
|
paymentAddress,
|
|
279
|
-
identity: identityKeystore,
|
|
280
284
|
maxWorkingSandboxes: cliArgs.cores,
|
|
281
285
|
cores: { cpu: TOTAL_CPU_VCORES, gpu: undefined }, /** XXXpfr @todo: Figure out how many gpus. */
|
|
282
286
|
targetLoad: { cpu: 1.0, gpu: 1.0 }, /** Use 100%: XXXpfr @todo Allow command-line override. */
|
|
@@ -285,7 +289,7 @@ async function startWorking(cliArgs) {
|
|
|
285
289
|
},
|
|
286
290
|
computeGroups: [], /* public group is implied */
|
|
287
291
|
leavePublicGroup: cliArgs.leavePublicGroup || dcpConfig.worker.leavePublicGroup,
|
|
288
|
-
};
|
|
292
|
+
});
|
|
289
293
|
|
|
290
294
|
/* cliArgs.join is the list of compute groups to join */
|
|
291
295
|
if (cliArgs.join && cliArgs.join.length)
|
|
@@ -306,12 +310,11 @@ async function startWorking(cliArgs) {
|
|
|
306
310
|
dcpWorkerOptions.priorityOnly = true;
|
|
307
311
|
}
|
|
308
312
|
if (cliArgs.allowedOrigins)
|
|
309
|
-
dcpConfig.worker.allowOrigins.any
|
|
313
|
+
dcpConfig.worker.allowOrigins.any.concat(cliArgs.allowedOrigins);
|
|
310
314
|
if (cliArgs.watchdogInterval)
|
|
311
315
|
dcpWorkerOptions.watchdogInterval = cliArgs.watchdogInterval;
|
|
312
316
|
|
|
313
|
-
|
|
314
|
-
worker = new DCPWorker(/*identityKeystore, */dcpWorkerOptions);
|
|
317
|
+
worker = new DCPWorker(identityKeystore, dcpWorkerOptions);
|
|
315
318
|
|
|
316
319
|
/**
|
|
317
320
|
* NOTE: In Supervisor2 this function is a NOOP.
|
package/etc/dcp-config.js
CHANGED
|
@@ -12,31 +12,36 @@
|
|
|
12
12
|
|
|
13
13
|
const dcpConfig =
|
|
14
14
|
{
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
listen: new URL('dcpsaw://localhost:9000/'),
|
|
18
|
-
libDir: '../libexec/evaluator', // relative to prefix
|
|
19
|
-
},
|
|
15
|
+
worker: { /******* Note: all properties passed to web; no filtering! ********/
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
trustComputeGroupOrigins: true, // trust the scheduler to give network access to origins on a per-compute-group basis
|
|
18
|
+
|
|
19
|
+
/* Allow lists permitting supervisor network access beyond DCP messages to services */
|
|
20
|
+
allowOrigins: {
|
|
21
|
+
any: [],
|
|
22
|
+
fetchWorkFunctions: [],
|
|
23
|
+
fetchArguments: [],
|
|
24
|
+
fetchData: [],
|
|
25
|
+
sendResults: [],
|
|
30
26
|
},
|
|
31
|
-
|
|
27
|
+
|
|
28
|
+
minimumWage: {
|
|
29
|
+
CPU: 0,
|
|
30
|
+
GPU: 0,
|
|
31
|
+
'in': 0,
|
|
32
|
+
out: 0,
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
computeGroups: {}, // integer-one-indexed; format is 1:{ joinKey,joinHash } or 2:{ joinKey, joinSecret }
|
|
36
|
+
jobAddresses: [], // Specific job addresses the worker may work on. If not empty, worker will only work on those jobs.
|
|
37
|
+
maxWorkingSandboxes: 1,
|
|
38
|
+
paymentAddress: null, // user must to specify
|
|
39
|
+
evaluatorOptions: {} /** @todo: add default options here. Note: right now they will be a bit off until we get localexec's evaluator a bit less special cased. */
|
|
32
40
|
},
|
|
33
|
-
|
|
41
|
+
evaluator:
|
|
34
42
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
leavePublicGroup: false,
|
|
39
|
-
allowConsoleAccess: false,
|
|
43
|
+
listen: new URL('dcpsaw://localhost:9000/'),
|
|
44
|
+
libDir: '../libexec/evaluator', // relative to prefix
|
|
40
45
|
},
|
|
41
46
|
}
|
|
42
47
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dcp-worker",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.23",
|
|
4
4
|
"description": "JavaScript portion of DCP Workers for Node.js",
|
|
5
5
|
"main": "bin/dcp-worker",
|
|
6
6
|
"keywords": [
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"blessed-contrib": "^4.11.0",
|
|
37
37
|
"bravojs": "^1.0.16",
|
|
38
38
|
"chalk": "^4.1.0",
|
|
39
|
-
"dcp-client": "^4.2.
|
|
39
|
+
"dcp-client": "^4.2.27",
|
|
40
40
|
"semver": "^7.3.8"
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|