dcp-worker 4.3.5 → 4.3.7

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/bin/dcp-task-probe +22 -20
  2. package/package.json +1 -1
@@ -16,7 +16,7 @@
16
16
  * - bank account
17
17
  * - body:
18
18
  * - newJobs: job id props
19
- * - address: job id
19
+ * - jobId: job id
20
20
  * - metrics:
21
21
  * - sliceCPUTime
22
22
  * - sliceGPUTime
@@ -379,7 +379,7 @@ async function processOptions(workerConfig)
379
379
  const value = parseValue(opthnd.optarg.slice(idx + 1), dcpConfig.worker);
380
380
  const [ confNode, prop ] = walkDotPath(dcpConfig.worker, opthnd.optarg.slice(0, idx));
381
381
 
382
- if (opthnd.option === 's')
382
+ if (opthnd.option === 'S')
383
383
  confNode[prop] = value;
384
384
  else
385
385
  {
@@ -454,6 +454,7 @@ async function probeEvaluator(workerConfig)
454
454
  }
455
455
 
456
456
  workerConfig.capabilities ||= evaluatorInfo.capabilities;
457
+ workerConfig.capabilities.KVINv9 = true;
457
458
  workerConfig.worktimes ||= evaluatorInfo.worktimes;
458
459
  }
459
460
  }
@@ -497,7 +498,6 @@ async function requestTask(dummyWorker, opts)
497
498
  request = readWorkerSnapshot().request;
498
499
  else
499
500
  request = {
500
- supervisor: dummyWorker.supervisorVersion,
501
501
  targetLoad: {
502
502
  cpu: Math.min(dummyWorker.config.maxSandboxes, dummyWorker.config.cores.cpu * dummyWorker.config.utilization.cpu) /* cpuCoreSpace */,
503
503
  gpu: Math.min(dummyWorker.config.maxSandboxes, dummyWorker.config.cores.gpu * dummyWorker.config.utilization.gpu) /* this.maxWorkingGPUs */,
@@ -510,7 +510,7 @@ async function requestTask(dummyWorker, opts)
510
510
  sandbox: dummyWorker.config.maxSandboxes,
511
511
  },
512
512
  jobQuanta: [ 1 ]/* this.quanta.calculateJobQuanta() */,
513
- capabilities: dummyWorker.config.capabilities,
513
+ capabilities: require('dcp/constants').scheduler.capabilities.toBits(dummyWorker.config.capabilities),
514
514
  paymentAddress: dummyWorker.config.paymentAddress,
515
515
  jobIds: dummyWorker.config.jobIds || [],
516
516
  minimumWage: dummyWorker.config.minimumWage,
@@ -521,6 +521,7 @@ async function requestTask(dummyWorker, opts)
521
521
  unresolvedJobs: [],
522
522
  fetchState: 1, /* normal fetch */
523
523
  worktimes: dummyWorker.config.worktimes,
524
+ seq: 0,
524
525
  };
525
526
 
526
527
  debug('dcp-task-probe:connect')('Connecting to task distributor at', tdConn.targetDescriptor.location.href);
@@ -528,7 +529,7 @@ async function requestTask(dummyWorker, opts)
528
529
  debug('dcp-task-probe:request')('Task Request:', request);
529
530
 
530
531
  const rtStart = Date.now();
531
- const tdRequest = new tdConn.Request({operation: 'requestTask', data: request});
532
+ const tdRequest = new tdConn.Request({operation: 'requestTask@3', data: request});
532
533
  tdRequest.connection.on('beforeSend', function beforeSendHandler (request) {
533
534
  /* need to delay hashing because connection might not be established yet, but we need the dcpsid */
534
535
  if (request !== tdRequest)
@@ -605,7 +606,10 @@ async function main()
605
606
  const initialWorkerConfig = {
606
607
  allowOrigins: {
607
608
  any: [],
608
- }
609
+ },
610
+ cores: {},
611
+ utilization: {},
612
+ computeGroups: [],
609
613
  };
610
614
  const opts = await processOptions(initialWorkerConfig);
611
615
  await identity.login('$login');
@@ -618,6 +622,7 @@ async function main()
618
622
  if (!opts.replay)
619
623
  await probeEvaluator(initialWorkerConfig);
620
624
  const dummyWorker = new (require('dcp/worker').DistributiveWorker)(initialWorkerConfig, function FakeSandboxConstructor(){});
625
+ dummyWorker.unref();
621
626
 
622
627
  if (opts.hasOwnProperty('showConfig'))
623
628
  {
@@ -645,15 +650,11 @@ async function main()
645
650
  process.exit(22);
646
651
  }
647
652
 
648
- const { newJobs, computeGroupJobs, computeGroupOrigins, schedulerConfig } = response.payload.body;
649
- const cgs = {}
650
- for (const cgId in computeGroupJobs)
651
- cgs[cgId] = { jobCount: computeGroupJobs[cgId].length };
652
- for (const jobId in newJobs)
653
- {
654
- for (const cg of newJobs[jobId].public.computeGroups)
655
- Object.assign(cgs[cg.opaqueId], { name: cg.name, description: cg.description });
656
- }
653
+ const { newJobs, computeGroupOrigins, schedulerConfig } = response.payload.body;
654
+ const cgs = new Map();
655
+ for (let job in newJobs)
656
+ for (let computeGroup of newJobs[job].public.computeGroups)
657
+ cgs.set(computeGroup.opaqueId, computeGroup.name);
657
658
 
658
659
  console.log('Total Jobs: ', Object.keys(task).length);
659
660
  console.log('Total Slices: ', Object.keys(task).map(jobId => task[jobId].length).reduce((a, b) => a+b, 0));
@@ -664,15 +665,16 @@ async function main()
664
665
  fmtMs(Object.keys(task).map(jobId => newJobs[jobId].metrics.sliceCPUTime).reduce((a, b) => a+b, 0) / workerConfig.cores.cpu) + ',',
665
666
  fmtMs(Object.keys(task).map(jobId => newJobs[jobId].metrics.sliceGPUTime).reduce((a, b) => a+b, 0) / workerConfig.cores.gpu));
666
667
  console.log('Task Duration: ', schedulerConfig.targetTaskDuration + 's');
667
- console.log('Compute Groups: ', Object.keys(computeGroupJobs).length);
668
+ console.log('Compute Groups: ', Array.from(cgs.values()).join(', '));
668
669
 
669
670
  if (opts.verbose)
670
671
  {
671
- for (const cgId in cgs)
672
+ if (Object.keys(computeGroupOrigins).length > 0)
673
+ console.log('Allowed origings via compute groups: ');
674
+ for (const cgId in computeGroupOrigins)
672
675
  {
673
- console.log(' -', cgId, cgs[cgId].name);
674
- if (computeGroupOrigins[cgId])
675
- console.log(' allow origins:', computeGroupOrigins[cgId]);
676
+ console.log(' -', cgId, cgs.get(cgId));
677
+ console.log(' allow origins:', computeGroupOrigins[cgId]);
676
678
  }
677
679
  }
678
680
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcp-worker",
3
- "version": "4.3.5",
3
+ "version": "4.3.7",
4
4
  "description": "Node.js Worker for Distributive Compute Platform",
5
5
  "main": "bin/dcp-worker",
6
6
  "keywords": [