@nrwl/nx-cloud 14.1.0 → 14.1.2-beta.2
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/lib/core/api/error-reporter.api.js +36 -1
- package/lib/core/api/run-group.api.js +65 -1
- package/lib/core/models/run-context.model.d.ts +86 -0
- package/lib/core/models/run-context.model.js +19 -0
- package/lib/core/models/run-context.model.js.map +1 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +138 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js.map +1 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +169 -1
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +113 -1
- package/lib/core/runners/cloud-enabled/cloud-run.api.js +166 -1
- package/lib/core/runners/distributed-agent/distributed-agent.api.js +79 -1
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js +240 -1
- package/lib/core/runners/distributed-execution/distributed-execution.api.js +131 -1
- package/lib/core/runners/distributed-execution/distributed-execution.api.js.map +1 -1
- package/lib/core/runners/distributed-execution/distributed-execution.runner.d.ts +0 -11
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js +206 -1
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js.map +1 -1
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.d.ts +2 -0
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js +37 -0
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js.map +1 -0
- package/lib/core/runners/distributed-execution/task-graph-creator.d.ts +15 -0
- package/lib/core/runners/distributed-execution/task-graph-creator.js +77 -0
- package/lib/core/runners/distributed-execution/task-graph-creator.js.map +1 -0
- package/lib/utilities/nx-imports.js +2 -4
- package/lib/utilities/nx-imports.js.map +1 -1
- package/lib/utilities/serializer-overrides.d.ts +2 -0
- package/lib/utilities/serializer-overrides.js +40 -0
- package/lib/utilities/serializer-overrides.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1,240 @@
|
|
|
1
|
-
const a5_0x89d6=['inherit','API\x20Response','throw','Executing:\x20\x27','--configuration=','createNoNewMessagesTimeout','projectName','./node_modules/.cache/nx','DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE','wait','existsSync','Fetching\x20tasks...','projects','Duplicate\x20Agent\x20ID\x20Detected','SIGINT','Critical\x20Error\x20in\x20Agent:\x20\x22','readdirSync','join','unlinkSync','parse','npx\x20nx\x20run-many\x20--target=','error','Waiter','configuration','number\x20of\x20tasks:\x20','__esModule','writeFileSync','retryDuring:\x20','\x20--parallel\x20--max-parallel=','params','includes','taskId','child_process','catch','error:\x20','env','executionId','../../../utilities/environment','VERBOSE_LOGGING','target','./distributed-agent.api','assign','CIRCLECI','length','toString','message','criticalErrorMessage','../../../utilities/metric-logger','printRunGroupError','NX_AGENT_NAME','mkdirSync','We\x20have\x20detected\x20another\x20agent\x20with\x20this\x20ID\x20running\x20in\x20this\x20workspace.\x20This\x20should\x20not\x20happen.','../../../utilities/waiter','getRunGroup','next','done','We\x20have\x20detected\x20other\x20agents\x20running\x20in\x20this\x20workspace.\x20This\x20can\x20cause\x20unexpected\x20behavior.','true','completed','forEach','map','completeRunGroupWithError','default','\x20--projects=','apply','execSync','retryDuring','options','readFileSync','This\x20can\x20also\x20be\x20a\x20false\x20positive\x20caused\x20by\x20agents\x20that\x20did\x20not\x20shut\x20down\x20correctly.','CIRCLE_STAGE','value','/tasks-hashes-','find','Waiting...','End\x20all\x20currently\x20running\x20agents,\x20run\x20\x22npx\x20nx-cloud\x20clean-up-agents\x22,\x20and\x20try\x20again.','push','completedStatusCode','completedTasks','/lockfiles','executionId:\x20','cacheDirectory','note','tasks',').\x20Tasks\x20hashes\x20haven\x27t\x20been\x20recorded.','completed:\x20','.lock','Starting\x20an\x20agent\x20for\x20running\x20Nx\x20tasks','../../../utilities/create-no-new-messages-timeout','then','__awaiter','Error:','Distributed\x20Execution\x20Terminated','If\x20you\x20believe\x20this\x20is\x20the\x20case,\x20run\x20\x22npx\x20nx-cloud\x20clean-up-agents\x22.','submitRunMetrics','exit','Command\x20execution\x20failed\x20(distributed\x20task\x20execution:\x20','random','startAgent'];(function(_0xc13509,_0x89d6c){const _0x36c500=function(_0x1e7f07){while(--_0x1e7f07){_0xc13509['push'](_0xc13509['shift']());}};_0x36c500(++_0x89d6c);}(a5_0x89d6,0x96));const a5_0x36c5=function(_0xc13509,_0x89d6c){_0xc13509=_0xc13509-0x0;let _0x36c500=a5_0x89d6[_0xc13509];return _0x36c500;};'use strict';var __awaiter=this&&this[a5_0x36c5('0x27')]||function(_0x19c977,_0x58dba5,_0x16fce4,_0x29ac84){function _0x93b79e(_0x2e3ed2){return _0x2e3ed2 instanceof _0x16fce4?_0x2e3ed2:new _0x16fce4(function(_0x1f31ac){_0x1f31ac(_0x2e3ed2);});}return new(_0x16fce4||(_0x16fce4=Promise))(function(_0x2c6963,_0x1e158f){function _0x3e99d6(_0x42ecd8){try{_0x178137(_0x29ac84[a5_0x36c5('0x3')](_0x42ecd8));}catch(_0x36bc15){_0x1e158f(_0x36bc15);}}function _0x2e26b9(_0x64387a){try{_0x178137(_0x29ac84[a5_0x36c5('0x32')](_0x64387a));}catch(_0x306799){_0x1e158f(_0x306799);}}function _0x178137(_0x14bef6){_0x14bef6[a5_0x36c5('0x4')]?_0x2c6963(_0x14bef6['value']):_0x93b79e(_0x14bef6[a5_0x36c5('0x14')])['then'](_0x3e99d6,_0x2e26b9);}_0x178137((_0x29ac84=_0x29ac84[a5_0x36c5('0xd')](_0x19c977,_0x58dba5||[]))['next']());});};Object['defineProperty'](exports,a5_0x36c5('0x49'),{'value':!![]});exports[a5_0x36c5('0x2f')]=void 0x0;const child_process_1=require(a5_0x36c5('0x50'));const stripJsonComments=require('strip-json-comments');const distributed_agent_api_1=require(a5_0x36c5('0x58'));const waiter_1=require(a5_0x36c5('0x1'));const environment_1=require(a5_0x36c5('0x55'));const print_run_group_error_1=require('../../error/print-run-group-error');const create_no_new_messages_timeout_1=require(a5_0x36c5('0x25'));const fs_1=require('fs');const metric_logger_1=require(a5_0x36c5('0x5f'));const {output,workspaceRoot}=require('../../../utilities/nx-imports');function executeTasks(_0x6656c2,_0x3d9c2d){return __awaiter(this,void 0x0,void 0x0,function*(){let _0x2d897a=0x0;let _0xacf5cf=null;const _0x1f9879=(0x0,create_no_new_messages_timeout_1[a5_0x36c5('0x35')])();const _0x2fee4b=new waiter_1[(a5_0x36c5('0x46'))]();let _0x3b2098=[];const _0x43d700=new Date();let _0x260ca6=![];while(!![]){if(environment_1[a5_0x36c5('0x56')]){output['note']({'title':a5_0x36c5('0x3b')});}_0xacf5cf=yield _0x3d9c2d[a5_0x36c5('0x20')](_0xacf5cf?_0xacf5cf['executionId']:null,_0x2d897a,_0x3b2098);if(environment_1[a5_0x36c5('0x56')]){output['note']({'title':a5_0x36c5('0x31'),'bodyLines':[a5_0x36c5('0x22')+_0xacf5cf[a5_0x36c5('0x7')],a5_0x36c5('0x4b')+_0xacf5cf[a5_0x36c5('0xf')],a5_0x36c5('0x1d')+_0xacf5cf['executionId'],a5_0x36c5('0x48')+_0xacf5cf[a5_0x36c5('0x20')][a5_0x36c5('0x5b')],a5_0x36c5('0x52')+_0xacf5cf[a5_0x36c5('0x5e')],'maxParallel:\x20'+_0xacf5cf['maxParallel']]});}if(_0xacf5cf[a5_0x36c5('0x5e')]){output[a5_0x36c5('0x45')]({'title':a5_0x36c5('0x29'),'bodyLines':[a5_0x36c5('0x28'),_0xacf5cf[a5_0x36c5('0x5e')]]});process['exit'](0x0);}if((_0xacf5cf===null||_0xacf5cf===void 0x0?void 0x0:_0xacf5cf[a5_0x36c5('0xf')])&&(_0xacf5cf===null||_0xacf5cf===void 0x0?void 0x0:_0xacf5cf[a5_0x36c5('0xf')])!==0x0&&!_0x260ca6&&new Date()['getTime']()-_0x43d700['getTime']()>_0xacf5cf[a5_0x36c5('0xf')]){yield _0x2fee4b['wait']();continue;}if(_0xacf5cf[a5_0x36c5('0x7')])return;_0x1f9879(_0xacf5cf[a5_0x36c5('0x20')][a5_0x36c5('0x9')](_0x2d3857=>_0x2d3857[a5_0x36c5('0x4f')])['join'](''));if(!_0xacf5cf[a5_0x36c5('0x54')]){if(environment_1['VERBOSE_LOGGING']){output['note']({'title':a5_0x36c5('0x17')});}yield _0x2fee4b[a5_0x36c5('0x39')]();_0x2d897a=0x0;_0x3b2098=[];continue;}_0x2fee4b['reset']();_0x260ca6=!![];const _0x148b27=invokeTasksUsingRunMany(_0x6656c2,_0xacf5cf[a5_0x36c5('0x54')],_0xacf5cf[a5_0x36c5('0x20')],_0xacf5cf['maxParallel']);_0x2d897a=_0x148b27[a5_0x36c5('0x1a')];_0x3b2098=_0x148b27[a5_0x36c5('0x1b')];}});}function readCompletedTasks(_0x413497,_0x354d1c){const _0x48b3d1=a5_0x36c5('0x2d')+_0x354d1c+a5_0x36c5('0x21');let _0xa784d5;try{const _0x2ce51d=_0x413497[a5_0x36c5('0x1e')]||a5_0x36c5('0x37');const _0x323ddb=_0x2ce51d+a5_0x36c5('0x15')+_0x354d1c;_0xa784d5=JSON[a5_0x36c5('0x43')]((0x0,fs_1[a5_0x36c5('0x11')])(_0x323ddb)[a5_0x36c5('0x5c')]());(0x0,fs_1[a5_0x36c5('0x42')])(_0x323ddb);}catch(_0x5c906d){throw new Error(_0x48b3d1);}if(_0xa784d5[a5_0x36c5('0x5b')]==0x0){throw new Error(_0x48b3d1);}return _0xa784d5;}function invokeTasksUsingRunMany(_0x514b27,_0x8fd273,_0xf411f,_0x11be60){let _0x24d509=0x0;const _0x3fe061=[];for(const _0x20b709 of groupByTarget(_0xf411f)){const _0x4624cb=_0x20b709['configuration']?a5_0x36c5('0x34')+_0x20b709[a5_0x36c5('0x47')]:'';const _0x1f92e6=_0x11be60>0x1?a5_0x36c5('0x4c')+_0x11be60:'';const _0x311655=a5_0x36c5('0x44')+_0x20b709[a5_0x36c5('0x57')]+'\x20'+_0x4624cb+a5_0x36c5('0xc')+_0x20b709['projects'][a5_0x36c5('0x41')](',')+'\x20'+_0x20b709[a5_0x36c5('0x4d')]+_0x1f92e6;if(environment_1[a5_0x36c5('0x56')]){output[a5_0x36c5('0x1f')]({'title':a5_0x36c5('0x33')+_0x311655+'\x27'});}try{(0x0,child_process_1[a5_0x36c5('0xe')])(_0x311655,{'stdio':[a5_0x36c5('0x30'),a5_0x36c5('0x30'),'inherit'],'env':Object[a5_0x36c5('0x59')](Object[a5_0x36c5('0x59')]({},process[a5_0x36c5('0x53')]),{'NX_CACHE_FAILURES':a5_0x36c5('0x6'),'NX_CLOUD_DISTRIBUTED_EXECUTION_ID':_0x8fd273})});}catch(_0x20d5cd){if(_0x20d5cd['status']===environment_1[a5_0x36c5('0x38')]){throw _0x20d5cd;}else{_0x24d509=0x1;}}finally{_0x3fe061[a5_0x36c5('0x19')](...readCompletedTasks(_0x514b27,_0x8fd273));}}return{'completedStatusCode':_0x24d509,'completedTasks':_0x3fe061};}function groupByTarget(_0x36f880){const _0x143452=[];_0x36f880[a5_0x36c5('0x8')](_0x413012=>{const _0x55c388=_0x143452[a5_0x36c5('0x16')](_0x5c84e8=>_0x5c84e8[a5_0x36c5('0x57')]===_0x413012['target']&&_0x5c84e8[a5_0x36c5('0x47')]===_0x413012['configuration']);if(_0x55c388){_0x55c388[a5_0x36c5('0x3c')][a5_0x36c5('0x19')](_0x413012['projectName']);}else{_0x143452[a5_0x36c5('0x19')]({'target':_0x413012['target'],'projects':[_0x413012[a5_0x36c5('0x36')]],'params':_0x413012[a5_0x36c5('0x4d')],'configuration':_0x413012['configuration']});}});return _0x143452;}function getAgentName(){if(process[a5_0x36c5('0x53')][a5_0x36c5('0x61')]!==undefined){return process[a5_0x36c5('0x53')][a5_0x36c5('0x61')];}else if(process['env'][a5_0x36c5('0x5a')]!==undefined){return process[a5_0x36c5('0x53')][a5_0x36c5('0x13')];}else{return'Agent\x20'+Math['floor'](Math[a5_0x36c5('0x2e')]()*0x186a0);}}function createAgentLockfile(_0x36e717,_0x3bb4a4){const _0x35fc70=_0x36e717[a5_0x36c5('0x1e')]||a5_0x36c5('0x37');const _0x94a0b0=_0x35fc70+a5_0x36c5('0x1c');const _0x3469d3=_0x94a0b0+'/'+_0x3bb4a4+'.lock';if(!(0x0,fs_1[a5_0x36c5('0x3a')])(_0x94a0b0)){(0x0,fs_1[a5_0x36c5('0x62')])(_0x94a0b0,{'recursive':!![]});}const _0x568c5a=(0x0,fs_1[a5_0x36c5('0x40')])(_0x94a0b0);if(_0x568c5a[a5_0x36c5('0x5b')]){if(_0x568c5a[a5_0x36c5('0x4e')](_0x3bb4a4+a5_0x36c5('0x23'))){output['error']({'title':a5_0x36c5('0x3d'),'bodyLines':[a5_0x36c5('0x0'),'',a5_0x36c5('0x18')]});process[a5_0x36c5('0x2c')](0x1);}output['warn']({'title':'Other\x20Nx\x20Cloud\x20Agents\x20Detected','bodyLines':[a5_0x36c5('0x5'),'',a5_0x36c5('0x12'),a5_0x36c5('0x2a')]});}(0x0,fs_1[a5_0x36c5('0x4a')])(_0x3469d3,'');process['on'](a5_0x36c5('0x2c'),_0x141b5c=>cleanupAgentLockfile(_0x3469d3,_0x141b5c));process['on'](a5_0x36c5('0x3e'),()=>cleanupAgentLockfile(_0x3469d3,0x0));}function cleanupAgentLockfile(_0x85378c,_0xdfd025){if((0x0,fs_1[a5_0x36c5('0x3a')])(_0x85378c)){(0x0,fs_1[a5_0x36c5('0x42')])(_0x85378c);process[a5_0x36c5('0x2c')](_0xdfd025);}}function startAgent(){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x4dafd3=(0x0,environment_1[a5_0x36c5('0x2')])();if(!_0x4dafd3){(0x0,print_run_group_error_1[a5_0x36c5('0x60')])();return process[a5_0x36c5('0x2c')](0x1);}output[a5_0x36c5('0x1f')]({'title':a5_0x36c5('0x24')});const _0x374309=JSON['parse'](stripJsonComments((0x0,fs_1[a5_0x36c5('0x11')])(workspaceRoot+'/nx.json')[a5_0x36c5('0x5c')]()))['tasksRunnerOptions'][a5_0x36c5('0xb')][a5_0x36c5('0x10')];const _0x570143=getAgentName();createAgentLockfile(_0x374309,_0x570143);const _0x245b80=new distributed_agent_api_1['DistributedAgentApi'](_0x374309,_0x4dafd3,_0x570143);return executeTasks(_0x374309,_0x245b80)[a5_0x36c5('0x26')](_0x523d16=>__awaiter(this,void 0x0,void 0x0,function*(){yield(0x0,metric_logger_1[a5_0x36c5('0x2b')])(_0x374309);return _0x523d16;}))[a5_0x36c5('0x51')](_0xe5e02e=>__awaiter(this,void 0x0,void 0x0,function*(){yield _0x245b80[a5_0x36c5('0xa')](a5_0x36c5('0x3f')+_0xe5e02e[a5_0x36c5('0x5d')]+'\x22');throw _0xe5e02e;}));});}exports['startAgent']=startAgent;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.startAgent = void 0;
|
|
13
|
+
const child_process_1 = require("child_process");
|
|
14
|
+
const stripJsonComments = require("strip-json-comments");
|
|
15
|
+
const distributed_agent_api_1 = require("./distributed-agent.api");
|
|
16
|
+
const waiter_1 = require("../../../utilities/waiter");
|
|
17
|
+
const environment_1 = require("../../../utilities/environment");
|
|
18
|
+
const print_run_group_error_1 = require("../../error/print-run-group-error");
|
|
19
|
+
const create_no_new_messages_timeout_1 = require("../../../utilities/create-no-new-messages-timeout");
|
|
20
|
+
const fs_1 = require("fs");
|
|
21
|
+
const metric_logger_1 = require("../../../utilities/metric-logger");
|
|
22
|
+
const { output, workspaceRoot } = require('../../../utilities/nx-imports');
|
|
23
|
+
function executeTasks(options, api) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
let completedStatusCode = 0;
|
|
26
|
+
let apiResponse = null;
|
|
27
|
+
const failIfSameTasksIn30Mins = (0, create_no_new_messages_timeout_1.createNoNewMessagesTimeout)();
|
|
28
|
+
const waiter = new waiter_1.Waiter();
|
|
29
|
+
let completedTasks = [];
|
|
30
|
+
const startTime = new Date();
|
|
31
|
+
let executedAnyTasks = false;
|
|
32
|
+
while (true) {
|
|
33
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
34
|
+
output.note({
|
|
35
|
+
title: 'Fetching tasks...',
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
apiResponse = yield api.tasks(apiResponse ? apiResponse.executionId : null, completedStatusCode, completedTasks);
|
|
39
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
40
|
+
output.note({
|
|
41
|
+
title: 'API Response',
|
|
42
|
+
bodyLines: [
|
|
43
|
+
`completed: ${apiResponse.completed}`,
|
|
44
|
+
`retryDuring: ${apiResponse.retryDuring}`,
|
|
45
|
+
`executionId: ${apiResponse.executionId}`,
|
|
46
|
+
`number of tasks: ${apiResponse.tasks.length}`,
|
|
47
|
+
`error: ${apiResponse.criticalErrorMessage}`,
|
|
48
|
+
`maxParallel: ${apiResponse.maxParallel}`,
|
|
49
|
+
],
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (apiResponse.criticalErrorMessage) {
|
|
53
|
+
output.error({
|
|
54
|
+
title: 'Distributed Execution Terminated',
|
|
55
|
+
bodyLines: ['Error:', apiResponse.criticalErrorMessage],
|
|
56
|
+
});
|
|
57
|
+
process.exit(0);
|
|
58
|
+
}
|
|
59
|
+
// run group is completed but it might be a rerun
|
|
60
|
+
// we will try several times before going further and
|
|
61
|
+
// completed the response
|
|
62
|
+
// we only do it if we haven't executed any tasks
|
|
63
|
+
if ((apiResponse === null || apiResponse === void 0 ? void 0 : apiResponse.retryDuring) &&
|
|
64
|
+
(apiResponse === null || apiResponse === void 0 ? void 0 : apiResponse.retryDuring) !== 0 &&
|
|
65
|
+
!executedAnyTasks &&
|
|
66
|
+
new Date().getTime() - startTime.getTime() > apiResponse.retryDuring) {
|
|
67
|
+
yield waiter.wait();
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (apiResponse.completed)
|
|
71
|
+
return;
|
|
72
|
+
failIfSameTasksIn30Mins(apiResponse.tasks.map((t) => t.taskId).join(''));
|
|
73
|
+
if (!apiResponse.executionId) {
|
|
74
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
75
|
+
output.note({
|
|
76
|
+
title: 'Waiting...',
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
yield waiter.wait();
|
|
80
|
+
completedStatusCode = 0;
|
|
81
|
+
completedTasks = [];
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
waiter.reset();
|
|
85
|
+
executedAnyTasks = true;
|
|
86
|
+
const r = invokeTasksUsingRunMany(options, apiResponse.executionId, apiResponse.tasks, apiResponse.maxParallel);
|
|
87
|
+
completedStatusCode = r.completedStatusCode;
|
|
88
|
+
completedTasks = r.completedTasks;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function readCompletedTasks(options, distributedExecutionId) {
|
|
93
|
+
const errorMessage = `Command execution failed (distributed task execution: ${distributedExecutionId}). Tasks hashes haven\'t been recorded.`;
|
|
94
|
+
let completedTasks;
|
|
95
|
+
try {
|
|
96
|
+
const cacheDirectory = options.cacheDirectory || './node_modules/.cache/nx';
|
|
97
|
+
const taskHashesFile = `${cacheDirectory}/tasks-hashes-${distributedExecutionId}`;
|
|
98
|
+
completedTasks = JSON.parse((0, fs_1.readFileSync)(taskHashesFile).toString());
|
|
99
|
+
// remove it such that if the next command crashes we don't read an obsolete file
|
|
100
|
+
(0, fs_1.unlinkSync)(taskHashesFile);
|
|
101
|
+
}
|
|
102
|
+
catch (e) {
|
|
103
|
+
throw new Error(errorMessage);
|
|
104
|
+
}
|
|
105
|
+
if (completedTasks.length == 0) {
|
|
106
|
+
throw new Error(errorMessage);
|
|
107
|
+
}
|
|
108
|
+
return completedTasks;
|
|
109
|
+
}
|
|
110
|
+
function invokeTasksUsingRunMany(options, executionId, tasks, maxParallel) {
|
|
111
|
+
let completedStatusCode = 0;
|
|
112
|
+
const completedTasks = [];
|
|
113
|
+
for (const g of groupByTarget(tasks)) {
|
|
114
|
+
const config = g.configuration ? `--configuration=${g.configuration}` : ``;
|
|
115
|
+
const parallel = maxParallel > 1 ? ` --parallel --max-parallel=${maxParallel}` : ``;
|
|
116
|
+
// TODO use pnpx or yarn when needed
|
|
117
|
+
const command = `npx nx run-many --target=${g.target} ${config} --projects=${g.projects.join(',')} ${g.params}${parallel}`;
|
|
118
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
119
|
+
output.note({
|
|
120
|
+
title: `Executing: '${command}'`,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
try {
|
|
124
|
+
(0, child_process_1.execSync)(command, {
|
|
125
|
+
stdio: ['inherit', 'inherit', 'inherit'],
|
|
126
|
+
env: Object.assign(Object.assign({}, process.env), { NX_CACHE_FAILURES: 'true', NX_CLOUD_DISTRIBUTED_EXECUTION_ID: executionId }),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
catch (e) {
|
|
130
|
+
if (e.status === environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE) {
|
|
131
|
+
throw e;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
completedStatusCode = 1;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
finally {
|
|
138
|
+
completedTasks.push(...readCompletedTasks(options, executionId));
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return { completedStatusCode, completedTasks };
|
|
142
|
+
}
|
|
143
|
+
function groupByTarget(tasks) {
|
|
144
|
+
const res = [];
|
|
145
|
+
tasks.forEach((t) => {
|
|
146
|
+
const r = res.find((rr) => rr.target === t.target && rr.configuration === t.configuration);
|
|
147
|
+
if (r) {
|
|
148
|
+
r.projects.push(t.projectName);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
res.push({
|
|
152
|
+
target: t.target,
|
|
153
|
+
projects: [t.projectName],
|
|
154
|
+
params: t.params,
|
|
155
|
+
configuration: t.configuration,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
return res;
|
|
160
|
+
}
|
|
161
|
+
function getAgentName() {
|
|
162
|
+
if (process.env.NX_AGENT_NAME !== undefined) {
|
|
163
|
+
return process.env.NX_AGENT_NAME;
|
|
164
|
+
}
|
|
165
|
+
else if (process.env.CIRCLECI !== undefined) {
|
|
166
|
+
return process.env.CIRCLE_STAGE;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
return `Agent ${Math.floor(Math.random() * 100000)}`;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function createAgentLockfile(options, agentName) {
|
|
173
|
+
const cacheDirectory = options.cacheDirectory || './node_modules/.cache/nx';
|
|
174
|
+
const lockFileDirectory = `${cacheDirectory}/lockfiles`;
|
|
175
|
+
const lockFilePath = `${lockFileDirectory}/${agentName}.lock`;
|
|
176
|
+
if (!(0, fs_1.existsSync)(lockFileDirectory)) {
|
|
177
|
+
(0, fs_1.mkdirSync)(lockFileDirectory, { recursive: true });
|
|
178
|
+
}
|
|
179
|
+
// Check for other agents' lockfiles and warn if exist
|
|
180
|
+
const lockFiles = (0, fs_1.readdirSync)(lockFileDirectory);
|
|
181
|
+
if (lockFiles.length) {
|
|
182
|
+
// Check to make sure the current agent name is not in use (only 1/100000 ^ 2 chance of this)
|
|
183
|
+
if (lockFiles.includes(`${agentName}.lock`)) {
|
|
184
|
+
output.error({
|
|
185
|
+
title: 'Duplicate Agent ID Detected',
|
|
186
|
+
bodyLines: [
|
|
187
|
+
'We have detected another agent with this ID running in this workspace. This should not happen.',
|
|
188
|
+
'',
|
|
189
|
+
'End all currently running agents, run "npx nx-cloud clean-up-agents", and try again.',
|
|
190
|
+
],
|
|
191
|
+
});
|
|
192
|
+
process.exit(1);
|
|
193
|
+
}
|
|
194
|
+
output.warn({
|
|
195
|
+
title: 'Other Nx Cloud Agents Detected',
|
|
196
|
+
bodyLines: [
|
|
197
|
+
'We have detected other agents running in this workspace. This can cause unexpected behavior.',
|
|
198
|
+
'',
|
|
199
|
+
'This can also be a false positive caused by agents that did not shut down correctly.',
|
|
200
|
+
'If you believe this is the case, run "npx nx-cloud clean-up-agents".',
|
|
201
|
+
],
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
(0, fs_1.writeFileSync)(lockFilePath, '');
|
|
205
|
+
process.on('exit', (code) => cleanupAgentLockfile(lockFilePath, code));
|
|
206
|
+
process.on('SIGINT', () => cleanupAgentLockfile(lockFilePath, 0));
|
|
207
|
+
}
|
|
208
|
+
function cleanupAgentLockfile(lockFilePath, code) {
|
|
209
|
+
if ((0, fs_1.existsSync)(lockFilePath)) {
|
|
210
|
+
(0, fs_1.unlinkSync)(lockFilePath);
|
|
211
|
+
process.exit(code);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
function startAgent() {
|
|
215
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
const runGroup = (0, environment_1.getRunGroup)();
|
|
217
|
+
if (!runGroup) {
|
|
218
|
+
(0, print_run_group_error_1.printRunGroupError)();
|
|
219
|
+
return process.exit(1);
|
|
220
|
+
}
|
|
221
|
+
output.note({
|
|
222
|
+
title: 'Starting an agent for running Nx tasks',
|
|
223
|
+
});
|
|
224
|
+
const options = JSON.parse(stripJsonComments((0, fs_1.readFileSync)(`${workspaceRoot}/nx.json`).toString())).tasksRunnerOptions.default.options;
|
|
225
|
+
const agentName = getAgentName();
|
|
226
|
+
createAgentLockfile(options, agentName);
|
|
227
|
+
const api = new distributed_agent_api_1.DistributedAgentApi(options, runGroup, agentName);
|
|
228
|
+
return executeTasks(options, api)
|
|
229
|
+
.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
230
|
+
yield (0, metric_logger_1.submitRunMetrics)(options);
|
|
231
|
+
return res;
|
|
232
|
+
}))
|
|
233
|
+
.catch((e) => __awaiter(this, void 0, void 0, function* () {
|
|
234
|
+
yield api.completeRunGroupWithError(`Critical Error in Agent: "${e.message}"`);
|
|
235
|
+
throw e;
|
|
236
|
+
}));
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
exports.startAgent = startAgent;
|
|
240
|
+
//# sourceMappingURL=distributed-agent.impl.js.map
|
|
@@ -1 +1,131 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.createStartRequest = exports.DistributedExecutionApi = void 0;
|
|
13
|
+
const axios_1 = require("../../../utilities/axios");
|
|
14
|
+
const environment_1 = require("../../../utilities/environment");
|
|
15
|
+
const metric_logger_1 = require("../../../utilities/metric-logger");
|
|
16
|
+
const serializer_overrides_1 = require("../../../utilities/serializer-overrides");
|
|
17
|
+
const { output, unparse } = require('../../../utilities/nx-imports');
|
|
18
|
+
class DistributedExecutionApi {
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.apiAxiosInstance = (0, axios_1.createApiAxiosInstance)(options);
|
|
21
|
+
}
|
|
22
|
+
start(params) {
|
|
23
|
+
var _a;
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const recorder = (0, metric_logger_1.createMetricRecorder)('dteStart');
|
|
26
|
+
let resp;
|
|
27
|
+
try {
|
|
28
|
+
resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/start', params));
|
|
29
|
+
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
33
|
+
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
34
|
+
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
35
|
+
throw e;
|
|
36
|
+
}
|
|
37
|
+
if (!resp.data.enabled) {
|
|
38
|
+
throw new Error(`Workspace is disabled. Cannot perform distributed task executions.`);
|
|
39
|
+
}
|
|
40
|
+
if (resp.data.error) {
|
|
41
|
+
throw new Error(resp.data.error);
|
|
42
|
+
}
|
|
43
|
+
return resp.data.id;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
status(id) {
|
|
47
|
+
var _a;
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const recorder = (0, metric_logger_1.createMetricRecorder)('dteStatus');
|
|
50
|
+
try {
|
|
51
|
+
const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/status', {
|
|
52
|
+
id,
|
|
53
|
+
}));
|
|
54
|
+
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
55
|
+
return resp.data;
|
|
56
|
+
}
|
|
57
|
+
catch (e) {
|
|
58
|
+
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
59
|
+
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
60
|
+
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
61
|
+
output.error({
|
|
62
|
+
title: e.message,
|
|
63
|
+
});
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
completeRunGroupWithError(runGroup, error) {
|
|
69
|
+
var _a;
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const recorder = (0, metric_logger_1.createMetricRecorder)('completeRunGroup');
|
|
72
|
+
try {
|
|
73
|
+
const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/complete-run-group', {
|
|
74
|
+
runGroup: runGroup,
|
|
75
|
+
criticalErrorMessage: error,
|
|
76
|
+
}), 3);
|
|
77
|
+
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
78
|
+
}
|
|
79
|
+
catch (e) {
|
|
80
|
+
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
81
|
+
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
82
|
+
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.DistributedExecutionApi = DistributedExecutionApi;
|
|
88
|
+
function createStartRequest(runGroup, task, options) {
|
|
89
|
+
const tasksToExecute = task.map((arr) => {
|
|
90
|
+
return arr.map((t) => {
|
|
91
|
+
return {
|
|
92
|
+
taskId: t.id,
|
|
93
|
+
hash: t.hash,
|
|
94
|
+
projectName: t.target.project,
|
|
95
|
+
target: t.target.target,
|
|
96
|
+
configuration: t.target.configuration || null,
|
|
97
|
+
params: (0, serializer_overrides_1.serializeOverrides)(t),
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
const request = {
|
|
102
|
+
command: (0, environment_1.parseCommand)(),
|
|
103
|
+
branch: (0, environment_1.getBranch)(),
|
|
104
|
+
runGroup,
|
|
105
|
+
tasks: tasksToExecute,
|
|
106
|
+
maxParallel: calculateMaxParallel(options),
|
|
107
|
+
};
|
|
108
|
+
if (environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT) {
|
|
109
|
+
request.agentCount = environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT;
|
|
110
|
+
}
|
|
111
|
+
if (!environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_STOP_AGENTS_ON_FAILURE) {
|
|
112
|
+
request.stopAgentsOnFailure = false;
|
|
113
|
+
}
|
|
114
|
+
return request;
|
|
115
|
+
}
|
|
116
|
+
exports.createStartRequest = createStartRequest;
|
|
117
|
+
function calculateMaxParallel(options) {
|
|
118
|
+
if (options.parallel === 'false' || options.parallel === false) {
|
|
119
|
+
return 1;
|
|
120
|
+
}
|
|
121
|
+
else if (options.parallel === 'true' || options.parallel === true) {
|
|
122
|
+
return Number(options.maxParallel || 3);
|
|
123
|
+
}
|
|
124
|
+
else if (options.parallel === undefined) {
|
|
125
|
+
return options.maxParallel ? Number(options.maxParallel) : 3;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
return Number(options.parallel) || 3;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=distributed-execution.api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distributed-execution.api.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/distributed-execution/distributed-execution.api.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,oDAGkC;AAClC,gEAKwC;AACxC,oEAI0C;
|
|
1
|
+
{"version":3,"file":"distributed-execution.api.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/distributed-execution/distributed-execution.api.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,oDAGkC;AAClC,gEAKwC;AACxC,oEAI0C;AAE1C,kFAA6E;AAE7E,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAErE,MAAa,uBAAuB;IAGlC,YAAY,OAA+B;QACzC,IAAI,CAAC,gBAAgB,GAAG,IAAA,8BAAsB,EAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IAEK,KAAK,CAAC,MAAW;;;YACrB,MAAM,QAAQ,GAAG,IAAA,oCAAoB,EAAC,UAAU,CAAC,CAAC;YAClD,IAAI,IAAI,CAAC;YAET,IAAI;gBACF,IAAI,GAAG,MAAM,IAAA,0BAAkB,EAAC,GAAG,EAAE,CACnC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,EAAE,MAAM,CAAC,CACjE,CAAC;gBACF,QAAQ,CAAC,YAAY,CAAC,IAAA,kCAAkB,EAAC,IAAI,CAAC,CAAC,CAAC;aACjD;YAAC,OAAO,CAAM,EAAE;gBACf,QAAQ,CAAC,YAAY,CACnB,CAAA,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,cAAc,0CAAE,QAAQ;oBACzB,CAAC,CAAC,IAAA,kCAAkB,EAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC;oBAC/C,CAAC,CAAC,yCAAyB,CAC9B,CAAC;gBACF,MAAM,CAAC,CAAC;aACT;YAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;gBACtB,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE,CAAC;aACH;YACD,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;gBACnB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aAClC;YACD,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;;KACrB;IAEK,MAAM,CAAC,EAAU;;;YACrB,MAAM,QAAQ,GAAG,IAAA,oCAAoB,EAAC,WAAW,CAAC,CAAC;YAEnD,IAAI;gBACF,MAAM,IAAI,GAAG,MAAM,IAAA,0BAAkB,EAAC,GAAG,EAAE,CACzC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,6BAA6B,EAAE;oBACxD,EAAE;iBACH,CAAC,CACH,CAAC;gBACF,QAAQ,CAAC,YAAY,CAAC,IAAA,kCAAkB,EAAC,IAAI,CAAC,CAAC,CAAC;gBAEhD,OAAO,IAAI,CAAC,IAAI,CAAC;aAClB;YAAC,OAAO,CAAM,EAAE;gBACf,QAAQ,CAAC,YAAY,CACnB,CAAA,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,cAAc,0CAAE,QAAQ;oBACzB,CAAC,CAAC,IAAA,kCAAkB,EAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC;oBAC/C,CAAC,CAAC,yCAAyB,CAC9B,CAAC;gBAEF,MAAM,CAAC,KAAK,CAAC;oBACX,KAAK,EAAE,CAAC,CAAC,OAAO;iBACjB,CAAC,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACjB;;KACF;IAEK,yBAAyB,CAC7B,QAAgB,EAChB,KAAa;;;YAEb,MAAM,QAAQ,GAAG,IAAA,oCAAoB,EAAC,kBAAkB,CAAC,CAAC;YAE1D,IAAI;gBACF,MAAM,IAAI,GAAG,MAAM,IAAA,0BAAkB,EACnC,GAAG,EAAE,CACH,IAAI,CAAC,gBAAgB,CAAC,IAAI,CACxB,yCAAyC,EACzC;oBACE,QAAQ,EAAE,QAAQ;oBAClB,oBAAoB,EAAE,KAAK;iBAC5B,CACF,EACH,CAAC,CACF,CAAC;gBAEF,QAAQ,CAAC,YAAY,CAAC,IAAA,kCAAkB,EAAC,IAAI,CAAC,CAAC,CAAC;aACjD;YAAC,OAAO,CAAM,EAAE;gBACf,QAAQ,CAAC,YAAY,CACnB,CAAA,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,cAAc,0CAAE,QAAQ;oBACzB,CAAC,CAAC,IAAA,kCAAkB,EAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC;oBAC/C,CAAC,CAAC,yCAAyB,CAC9B,CAAC;aACH;;KACF;CACF;AA1FD,0DA0FC;AAED,SAAgB,kBAAkB,CAChC,QAAgB,EAChB,IAAc,EACd,OAA+B;IAE/B,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACtC,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACnB,OAAO;gBACL,MAAM,EAAE,CAAC,CAAC,EAAE;gBACZ,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO;gBAC7B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM;gBACvB,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,IAAI,IAAI;gBAC7C,MAAM,EAAE,IAAA,yCAAkB,EAAC,CAAC,CAAC;aAC9B,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG;QACd,OAAO,EAAE,IAAA,0BAAY,GAAE;QACvB,MAAM,EAAE,IAAA,uBAAS,GAAE;QACnB,QAAQ;QACR,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,oBAAoB,CAAC,OAAO,CAAC;KACpC,CAAC;IACT,IAAI,wDAA0C,EAAE;QAC9C,OAAO,CAAC,UAAU,GAAG,wDAA0C,CAAC;KACjE;IACD,IAAI,CAAC,mEAAqD,EAAE;QAC1D,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC;KACrC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAhCD,gDAgCC;AAED,SAAS,oBAAoB,CAAC,OAAY;IACxC,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,EAAE;QAC9D,OAAO,CAAC,CAAC;KACV;SAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,MAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI,EAAE;QACnE,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC;KACzC;SAAM,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE;QACzC,OAAO,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC9D;SAAM;QACL,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;KACtC;AACH,CAAC"}
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import { Task } from '../../models/run-context.model';
|
|
2
1
|
export declare const nxCloudDistributedTasksRunner: any;
|
|
3
|
-
export declare class TaskGraphCreator {
|
|
4
|
-
private readonly projectGraph;
|
|
5
|
-
private readonly defaultTargetDependencies;
|
|
6
|
-
constructor(projectGraph: any, defaultTargetDependencies: Record<string, any[]>);
|
|
7
|
-
createTaskGraph(tasks: Task[]): any;
|
|
8
|
-
private addTaskDependencies;
|
|
9
|
-
private addDependencies;
|
|
10
|
-
private findTask;
|
|
11
|
-
private addTaskToGraph;
|
|
12
|
-
}
|