@nrwl/nx-cloud 13.2.0-beta.3 → 13.2.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/run-group.api.js +1 -65
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +1 -138
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +1 -166
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +1 -113
- package/lib/core/runners/cloud-enabled/cloud-run.api.js +1 -158
- package/lib/core/runners/distributed-agent/distributed-agent.api.js +1 -79
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js +1 -239
- package/lib/core/runners/distributed-execution/distributed-execution.api.js +1 -130
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js +1 -306
- package/package.json +4 -7
|
@@ -1,130 +1 @@
|
|
|
1
|
-
|
|
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 { output, unparse } = require('../../../utilities/nx-imports');
|
|
17
|
-
class DistributedExecutionApi {
|
|
18
|
-
constructor(options) {
|
|
19
|
-
this.apiAxiosInstance = (0, axios_1.createApiAxiosInstance)(options);
|
|
20
|
-
}
|
|
21
|
-
start(params) {
|
|
22
|
-
var _a;
|
|
23
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const recorder = (0, metric_logger_1.createMetricRecorder)('dteStart');
|
|
25
|
-
let resp;
|
|
26
|
-
try {
|
|
27
|
-
resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/start', params));
|
|
28
|
-
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
29
|
-
}
|
|
30
|
-
catch (e) {
|
|
31
|
-
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
32
|
-
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
33
|
-
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
34
|
-
throw e;
|
|
35
|
-
}
|
|
36
|
-
if (!resp.data.enabled) {
|
|
37
|
-
throw new Error(`Workspace is disabled. Cannot perform distributed task executions.`);
|
|
38
|
-
}
|
|
39
|
-
if (resp.data.error) {
|
|
40
|
-
throw new Error(resp.data.error);
|
|
41
|
-
}
|
|
42
|
-
return resp.data.id;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
status(id) {
|
|
46
|
-
var _a;
|
|
47
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
const recorder = (0, metric_logger_1.createMetricRecorder)('dteStatus');
|
|
49
|
-
try {
|
|
50
|
-
const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/status', {
|
|
51
|
-
id,
|
|
52
|
-
}));
|
|
53
|
-
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
54
|
-
return resp.data;
|
|
55
|
-
}
|
|
56
|
-
catch (e) {
|
|
57
|
-
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
58
|
-
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
59
|
-
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
60
|
-
output.error({
|
|
61
|
-
title: e.message,
|
|
62
|
-
});
|
|
63
|
-
process.exit(1);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
completeRunGroupWithError(runGroup, error) {
|
|
68
|
-
var _a;
|
|
69
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
const recorder = (0, metric_logger_1.createMetricRecorder)('completeRunGroup');
|
|
71
|
-
try {
|
|
72
|
-
const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/complete-run-group', {
|
|
73
|
-
runGroup: runGroup,
|
|
74
|
-
criticalErrorMessage: error,
|
|
75
|
-
}), 3);
|
|
76
|
-
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
77
|
-
}
|
|
78
|
-
catch (e) {
|
|
79
|
-
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
80
|
-
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
81
|
-
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
exports.DistributedExecutionApi = DistributedExecutionApi;
|
|
87
|
-
function createStartRequest(runGroup, task, options) {
|
|
88
|
-
const tasksToExecute = task.map((arr) => {
|
|
89
|
-
return arr.map((t) => {
|
|
90
|
-
return {
|
|
91
|
-
taskId: t.id,
|
|
92
|
-
hash: t.hash,
|
|
93
|
-
projectName: t.target.project,
|
|
94
|
-
target: t.target.target,
|
|
95
|
-
configuration: t.target.configuration || null,
|
|
96
|
-
params: unparse(t.overrides).join(' '),
|
|
97
|
-
};
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
const request = {
|
|
101
|
-
command: (0, environment_1.parseCommand)(),
|
|
102
|
-
branch: (0, environment_1.getBranch)(),
|
|
103
|
-
runGroup,
|
|
104
|
-
tasks: tasksToExecute,
|
|
105
|
-
maxParallel: calculateMaxParallel(options),
|
|
106
|
-
};
|
|
107
|
-
if (environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT) {
|
|
108
|
-
request.agentCount = environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT;
|
|
109
|
-
}
|
|
110
|
-
if (!environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_STOP_AGENTS_ON_FAILURE) {
|
|
111
|
-
request.stopAgentsOnFailure = false;
|
|
112
|
-
}
|
|
113
|
-
return request;
|
|
114
|
-
}
|
|
115
|
-
exports.createStartRequest = createStartRequest;
|
|
116
|
-
function calculateMaxParallel(options) {
|
|
117
|
-
if (options.parallel === 'false' || options.parallel === false) {
|
|
118
|
-
return 1;
|
|
119
|
-
}
|
|
120
|
-
else if (options.parallel === 'true' || options.parallel === true) {
|
|
121
|
-
return Number(options.maxParallel || 3);
|
|
122
|
-
}
|
|
123
|
-
else if (options.parallel === undefined) {
|
|
124
|
-
return options.maxParallel ? Number(options.maxParallel) : 3;
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
return Number(options.parallel) || 3;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=distributed-execution.api.js.map
|
|
1
|
+
const a6_0x6608=['stopAgentsOnFailure','dteStart','apiAxiosInstance','message','/nx-cloud/executions/start','NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT','map','mapRespToPerfEntry','parallel','start','/nx-cloud/executions/complete-run-group','maxParallel','getBranch','configuration','../../../utilities/metric-logger','apply','createStartRequest','overrides','recordMetric','../../../utilities/axios','true','error','createMetricRecorder','next','throw','value','__esModule','RUNNER_FAILURE_PERF_ENTRY','completeRunGroupWithError','status','axiosMultipleTries','dteStatus','completeRunGroup','enabled','done','defineProperty','NX_CLOUD_DISTRIBUTED_EXECUTION_STOP_AGENTS_ON_FAILURE','then','../../../utilities/environment','Workspace\x20is\x20disabled.\x20Cannot\x20perform\x20distributed\x20task\x20executions.','post','target','project','parseCommand','../../../utilities/nx-imports','data','hash','axiosException','agentCount','response','/nx-cloud/executions/status','exit'];(function(_0xcea6c7,_0x6608aa){const _0x1c7797=function(_0x4b9d40){while(--_0x4b9d40){_0xcea6c7['push'](_0xcea6c7['shift']());}};_0x1c7797(++_0x6608aa);}(a6_0x6608,0x9a));const a6_0x1c77=function(_0xcea6c7,_0x6608aa){_0xcea6c7=_0xcea6c7-0x0;let _0x1c7797=a6_0x6608[_0xcea6c7];return _0x1c7797;};'use strict';var __awaiter=this&&this['__awaiter']||function(_0x46f8fb,_0x3a5c87,_0x10c1f2,_0x19338a){function _0x42ec82(_0x19c485){return _0x19c485 instanceof _0x10c1f2?_0x19c485:new _0x10c1f2(function(_0x133f31){_0x133f31(_0x19c485);});}return new(_0x10c1f2||(_0x10c1f2=Promise))(function(_0x13bce8,_0x41515c){function _0x490347(_0x3cd341){try{_0x38fee0(_0x19338a[a6_0x1c77('0x19')](_0x3cd341));}catch(_0x4b288e){_0x41515c(_0x4b288e);}}function _0x4b794d(_0xbf0dbf){try{_0x38fee0(_0x19338a[a6_0x1c77('0x1a')](_0xbf0dbf));}catch(_0x2ed3fa){_0x41515c(_0x2ed3fa);}}function _0x38fee0(_0xde6dd8){_0xde6dd8[a6_0x1c77('0x24')]?_0x13bce8(_0xde6dd8[a6_0x1c77('0x1b')]):_0x42ec82(_0xde6dd8['value'])[a6_0x1c77('0x27')](_0x490347,_0x4b794d);}_0x38fee0((_0x19338a=_0x19338a[a6_0x1c77('0x11')](_0x46f8fb,_0x3a5c87||[]))[a6_0x1c77('0x19')]());});};Object[a6_0x1c77('0x25')](exports,a6_0x1c77('0x1c'),{'value':!![]});exports[a6_0x1c77('0x12')]=exports['DistributedExecutionApi']=void 0x0;const axios_1=require(a6_0x1c77('0x15'));const environment_1=require(a6_0x1c77('0x28'));const metric_logger_1=require(a6_0x1c77('0x10'));const {output,unparse}=require(a6_0x1c77('0x2e'));class DistributedExecutionApi{constructor(_0x45ccc0){this[a6_0x1c77('0x4')]=(0x0,axios_1['createApiAxiosInstance'])(_0x45ccc0);}[a6_0x1c77('0xb')](_0x30794e){var _0x317707;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x378d3e=(0x0,metric_logger_1[a6_0x1c77('0x18')])(a6_0x1c77('0x3'));let _0x2050f6;try{_0x2050f6=yield(0x0,axios_1[a6_0x1c77('0x20')])(()=>this['apiAxiosInstance']['post'](a6_0x1c77('0x6'),_0x30794e));_0x378d3e[a6_0x1c77('0x14')]((0x0,metric_logger_1['mapRespToPerfEntry'])(_0x2050f6));}catch(_0x96e210){_0x378d3e[a6_0x1c77('0x14')](((_0x317707=_0x96e210===null||_0x96e210===void 0x0?void 0x0:_0x96e210[a6_0x1c77('0x31')])===null||_0x317707===void 0x0?void 0x0:_0x317707['response'])?(0x0,metric_logger_1[a6_0x1c77('0x9')])(_0x96e210[a6_0x1c77('0x31')][a6_0x1c77('0x33')]):metric_logger_1[a6_0x1c77('0x1d')]);throw _0x96e210;}if(!_0x2050f6[a6_0x1c77('0x2f')][a6_0x1c77('0x23')]){throw new Error(a6_0x1c77('0x29'));}if(_0x2050f6[a6_0x1c77('0x2f')][a6_0x1c77('0x17')]){throw new Error(_0x2050f6[a6_0x1c77('0x2f')][a6_0x1c77('0x17')]);}return _0x2050f6[a6_0x1c77('0x2f')]['id'];});}[a6_0x1c77('0x1f')](_0x50b953){var _0x4c7822;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x433d3f=(0x0,metric_logger_1[a6_0x1c77('0x18')])(a6_0x1c77('0x21'));try{const _0x5f5b88=yield(0x0,axios_1[a6_0x1c77('0x20')])(()=>this[a6_0x1c77('0x4')]['post'](a6_0x1c77('0x0'),{'id':_0x50b953}));_0x433d3f[a6_0x1c77('0x14')]((0x0,metric_logger_1['mapRespToPerfEntry'])(_0x5f5b88));return _0x5f5b88[a6_0x1c77('0x2f')];}catch(_0x519a7c){_0x433d3f['recordMetric'](((_0x4c7822=_0x519a7c===null||_0x519a7c===void 0x0?void 0x0:_0x519a7c['axiosException'])===null||_0x4c7822===void 0x0?void 0x0:_0x4c7822['response'])?(0x0,metric_logger_1[a6_0x1c77('0x9')])(_0x519a7c[a6_0x1c77('0x31')][a6_0x1c77('0x33')]):metric_logger_1[a6_0x1c77('0x1d')]);output[a6_0x1c77('0x17')]({'title':_0x519a7c[a6_0x1c77('0x5')]});process[a6_0x1c77('0x1')](0x1);}});}[a6_0x1c77('0x1e')](_0x53c591,_0x5c62d4){var _0x3964a5;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x4c433d=(0x0,metric_logger_1['createMetricRecorder'])(a6_0x1c77('0x22'));try{const _0x24b48d=yield(0x0,axios_1['axiosMultipleTries'])(()=>this[a6_0x1c77('0x4')][a6_0x1c77('0x2a')](a6_0x1c77('0xc'),{'runGroup':_0x53c591,'criticalErrorMessage':_0x5c62d4}),0x3);_0x4c433d['recordMetric']((0x0,metric_logger_1[a6_0x1c77('0x9')])(_0x24b48d));}catch(_0x4b3b45){_0x4c433d[a6_0x1c77('0x14')](((_0x3964a5=_0x4b3b45===null||_0x4b3b45===void 0x0?void 0x0:_0x4b3b45['axiosException'])===null||_0x3964a5===void 0x0?void 0x0:_0x3964a5['response'])?(0x0,metric_logger_1[a6_0x1c77('0x9')])(_0x4b3b45[a6_0x1c77('0x31')]['response']):metric_logger_1[a6_0x1c77('0x1d')]);}});}}exports['DistributedExecutionApi']=DistributedExecutionApi;function createStartRequest(_0x114aa9,_0x4edc8a,_0x4ade37){const _0x4b3bb3=_0x4edc8a['map'](_0x1c27c5=>{return _0x1c27c5[a6_0x1c77('0x8')](_0x4b9734=>{return{'taskId':_0x4b9734['id'],'hash':_0x4b9734[a6_0x1c77('0x30')],'projectName':_0x4b9734[a6_0x1c77('0x2b')][a6_0x1c77('0x2c')],'target':_0x4b9734[a6_0x1c77('0x2b')]['target'],'configuration':_0x4b9734[a6_0x1c77('0x2b')][a6_0x1c77('0xf')]||null,'params':unparse(_0x4b9734[a6_0x1c77('0x13')])['join']('\x20')};});});const _0x44048d={'command':(0x0,environment_1[a6_0x1c77('0x2d')])(),'branch':(0x0,environment_1[a6_0x1c77('0xe')])(),'runGroup':_0x114aa9,'tasks':_0x4b3bb3,'maxParallel':calculateMaxParallel(_0x4ade37)};if(environment_1[a6_0x1c77('0x7')]){_0x44048d[a6_0x1c77('0x32')]=environment_1['NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT'];}if(!environment_1[a6_0x1c77('0x26')]){_0x44048d[a6_0x1c77('0x2')]=![];}return _0x44048d;}exports['createStartRequest']=createStartRequest;function calculateMaxParallel(_0x3d648d){if(_0x3d648d[a6_0x1c77('0xa')]==='false'||_0x3d648d[a6_0x1c77('0xa')]===![]){return 0x1;}else if(_0x3d648d[a6_0x1c77('0xa')]===a6_0x1c77('0x16')||_0x3d648d[a6_0x1c77('0xa')]===!![]){return Number(_0x3d648d['maxParallel']||0x3);}else if(_0x3d648d[a6_0x1c77('0xa')]===undefined){return _0x3d648d[a6_0x1c77('0xd')]?Number(_0x3d648d['maxParallel']):0x3;}else{return Number(_0x3d648d[a6_0x1c77('0xa')])||0x3;}}
|
|
@@ -1,306 +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.TaskGraphCreator = exports.nxCloudDistributedTasksRunner = void 0;
|
|
13
|
-
const Observable_1 = require("rxjs/internal/Observable");
|
|
14
|
-
const stripJsonComments = require("strip-json-comments");
|
|
15
|
-
const fs_1 = require("fs");
|
|
16
|
-
const distributed_execution_api_1 = require("./distributed-execution.api");
|
|
17
|
-
const file_storage_1 = require("../../file-storage/file-storage");
|
|
18
|
-
const e2e_encryption_1 = require("../../file-storage/e2e-encryption");
|
|
19
|
-
const waiter_1 = require("../../../utilities/waiter");
|
|
20
|
-
const environment_1 = require("../../../utilities/environment");
|
|
21
|
-
const print_run_group_error_1 = require("../../error/print-run-group-error");
|
|
22
|
-
const create_no_new_messages_timeout_1 = require("../../../utilities/create-no-new-messages-timeout");
|
|
23
|
-
const metric_logger_1 = require("../../../utilities/metric-logger");
|
|
24
|
-
const { output, getDependencyConfigs, getOutputs, unparse, Cache, } = require('../../../utilities/nx-imports');
|
|
25
|
-
class NoopLifeCycle {
|
|
26
|
-
scheduleTask(task) { }
|
|
27
|
-
startTask(task) { }
|
|
28
|
-
endTask(task, code) { }
|
|
29
|
-
}
|
|
30
|
-
function runDistributedExecution(api, options, context, fileStorage, cache, runGroup, tasks) {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const nxjson = JSON.parse(stripJsonComments((0, fs_1.readFileSync)('nx.json').toString()));
|
|
33
|
-
const stages = new TaskOrderer(context.projectGraph, getDefaultDependencyConfigs(nxjson, options)).splitTasksIntoStages(tasks);
|
|
34
|
-
const id = yield api.start((0, distributed_execution_api_1.createStartRequest)(runGroup, stages, options));
|
|
35
|
-
return yield processTasks(api, fileStorage, cache, options, id, tasks, context);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function processTasks(api, fileStorage, cache, options, executionId, tasks, context) {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const processedTasks = {};
|
|
41
|
-
const failIfNumberOfCompletedTasksDoesNotChangeIn30Mins = (0, create_no_new_messages_timeout_1.createNoNewMessagesTimeout)();
|
|
42
|
-
const waiter = new waiter_1.Waiter();
|
|
43
|
-
while (true) {
|
|
44
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
45
|
-
output.note({
|
|
46
|
-
title: 'Waiting...',
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
yield waiter.wait();
|
|
50
|
-
const r = yield api.status(executionId);
|
|
51
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
52
|
-
output.note({
|
|
53
|
-
title: `Status update`,
|
|
54
|
-
bodyLines: [
|
|
55
|
-
`executionId: ${executionId}`,
|
|
56
|
-
`executionStatus: ${r.executionStatus}`,
|
|
57
|
-
`number of completed tasks: ${r.completedTasks.length}`,
|
|
58
|
-
`error: ${r.criticalErrorMessage}`,
|
|
59
|
-
],
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
if (r.criticalErrorMessage) {
|
|
63
|
-
output.error({
|
|
64
|
-
title: 'Distributed Execution Terminated',
|
|
65
|
-
bodyLines: ['Error:', r.criticalErrorMessage],
|
|
66
|
-
});
|
|
67
|
-
process.exit(1);
|
|
68
|
-
}
|
|
69
|
-
failIfNumberOfCompletedTasksDoesNotChangeIn30Mins(r.completedTasks.length);
|
|
70
|
-
for (const t of r.completedTasks) {
|
|
71
|
-
if (processedTasks[t.taskId])
|
|
72
|
-
continue;
|
|
73
|
-
yield processTask(fileStorage, cache, context, options, tasks, t);
|
|
74
|
-
waiter.reset();
|
|
75
|
-
processedTasks[t.taskId] = true;
|
|
76
|
-
}
|
|
77
|
-
if (r.executionStatus === 'COMPLETED') {
|
|
78
|
-
return { commandStatus: r.commandStatus, runUrl: r.runUrl };
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
function processTask(fileStorage, cache, context, options, tasks, completedTask) {
|
|
84
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
86
|
-
output.note({
|
|
87
|
-
title: `Processing task ${completedTask.taskId}`,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
const matchingTask = tasks.find((tt) => completedTask.taskId === tt.id);
|
|
91
|
-
if (!matchingTask) {
|
|
92
|
-
throw new Error(`Found unknown task: ${completedTask.taskId}`);
|
|
93
|
-
}
|
|
94
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
95
|
-
output.note({
|
|
96
|
-
title: `Retrieving artifacts from ${completedTask.url}`,
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
yield fileStorage.retrieve(completedTask.hash, completedTask.url, options.cacheDirectory || './node_modules/.cache/nx');
|
|
100
|
-
const cachedResult = yield cache.get(Object.assign(Object.assign({}, matchingTask), { hash: completedTask.hash }));
|
|
101
|
-
const outputs = getOutputs(context.projectGraph.nodes, matchingTask);
|
|
102
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
103
|
-
output.note({
|
|
104
|
-
title: `Extracting artifacts`,
|
|
105
|
-
bodyLines: outputs,
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
yield cache.copyFilesFromCache(completedTask.hash, cachedResult, outputs);
|
|
109
|
-
output.logCommand(getCommand(matchingTask));
|
|
110
|
-
process.stdout.write(cachedResult.terminalOutput);
|
|
111
|
-
output.addVerticalSeparator();
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
function getCommand(task) {
|
|
115
|
-
const args = unparse(task.overrides || {});
|
|
116
|
-
const config = task.target.configuration
|
|
117
|
-
? `:${task.target.configuration}`
|
|
118
|
-
: '';
|
|
119
|
-
return [
|
|
120
|
-
'nx',
|
|
121
|
-
'run',
|
|
122
|
-
`${task.target.project}:${task.target.target}${config}`,
|
|
123
|
-
...args,
|
|
124
|
-
].join(' ');
|
|
125
|
-
}
|
|
126
|
-
const nxCloudDistributedTasksRunner = (tasks, options, context) => {
|
|
127
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
128
|
-
output.note({
|
|
129
|
-
title: 'Starting distributed command execution',
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
options.lifeCycle = new NoopLifeCycle();
|
|
133
|
-
const runGroup = (0, environment_1.getRunGroup)();
|
|
134
|
-
if (!runGroup) {
|
|
135
|
-
(0, print_run_group_error_1.printRunGroupError)();
|
|
136
|
-
return process.exit(1);
|
|
137
|
-
}
|
|
138
|
-
const encryption = new e2e_encryption_1.E2EEncryption(environment_1.ENCRYPTION_KEY || options.encryptionKey);
|
|
139
|
-
const fileStorage = new file_storage_1.FileStorage(encryption);
|
|
140
|
-
const cache = new Cache(options);
|
|
141
|
-
const api = new distributed_execution_api_1.DistributedExecutionApi(options);
|
|
142
|
-
runDistributedExecution(api, options, context, fileStorage, cache, runGroup, tasks)
|
|
143
|
-
.then((r) => __awaiter(void 0, void 0, void 0, function* () {
|
|
144
|
-
if (r.commandStatus === 0) {
|
|
145
|
-
output.success({
|
|
146
|
-
title: 'Successfully completed running the command.',
|
|
147
|
-
bodyLines: [`See run details at ${r.runUrl}`],
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
output.error({
|
|
152
|
-
title: 'Command execution failed.',
|
|
153
|
-
bodyLines: [`See run details at ${r.runUrl}`],
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
yield (0, metric_logger_1.submitRunMetrics)(options);
|
|
157
|
-
process.exit(r.commandStatus);
|
|
158
|
-
}))
|
|
159
|
-
.catch((e) => {
|
|
160
|
-
output.error({
|
|
161
|
-
title: 'Unable to complete a run.',
|
|
162
|
-
bodyLines: [e.message],
|
|
163
|
-
});
|
|
164
|
-
if (e.axiosException) {
|
|
165
|
-
console.log(e.axiosException);
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
console.log(e);
|
|
169
|
-
}
|
|
170
|
-
api
|
|
171
|
-
.completeRunGroupWithError(runGroup, `Main job terminated with an error: "${e.message}"`)
|
|
172
|
-
.finally(() => process.exit(1));
|
|
173
|
-
});
|
|
174
|
-
return new Observable_1.Observable(() => { });
|
|
175
|
-
};
|
|
176
|
-
exports.nxCloudDistributedTasksRunner = nxCloudDistributedTasksRunner;
|
|
177
|
-
class TaskOrderer {
|
|
178
|
-
constructor(projectGraph, defaultTargetDependencies) {
|
|
179
|
-
this.projectGraph = projectGraph;
|
|
180
|
-
this.defaultTargetDependencies = defaultTargetDependencies;
|
|
181
|
-
}
|
|
182
|
-
splitTasksIntoStages(tasks) {
|
|
183
|
-
if (tasks.length === 0)
|
|
184
|
-
return [];
|
|
185
|
-
const stages = [];
|
|
186
|
-
const taskGraph = this.createTaskGraph(tasks);
|
|
187
|
-
const notStagedTaskIds = new Set(tasks.map((t) => t.id));
|
|
188
|
-
let stageIndex = 0;
|
|
189
|
-
// Loop through tasks and try to stage them. As tasks are staged, they are removed from the loop
|
|
190
|
-
while (notStagedTaskIds.size > 0) {
|
|
191
|
-
const currentStage = (stages[stageIndex] = []);
|
|
192
|
-
for (const taskId of notStagedTaskIds) {
|
|
193
|
-
let ready = true;
|
|
194
|
-
for (const dependency of taskGraph.dependencies[taskId]) {
|
|
195
|
-
if (notStagedTaskIds.has(dependency)) {
|
|
196
|
-
// dependency has not been staged yet, this task is not ready to be staged.
|
|
197
|
-
ready = false;
|
|
198
|
-
break;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
// Some dependency still has not been staged, skip it for now, it will be processed again
|
|
202
|
-
if (!ready) {
|
|
203
|
-
continue;
|
|
204
|
-
}
|
|
205
|
-
// All the dependencies have been staged, let's stage it.
|
|
206
|
-
const task = taskGraph.tasks[taskId];
|
|
207
|
-
currentStage.push(task);
|
|
208
|
-
}
|
|
209
|
-
// Remove the entire new stage of tasks from the list
|
|
210
|
-
for (const task of currentStage) {
|
|
211
|
-
notStagedTaskIds.delete(task.id);
|
|
212
|
-
}
|
|
213
|
-
stageIndex++;
|
|
214
|
-
}
|
|
215
|
-
return stages;
|
|
216
|
-
}
|
|
217
|
-
createTaskGraph(tasks) {
|
|
218
|
-
const t = new TaskGraphCreator(this.projectGraph, this.defaultTargetDependencies);
|
|
219
|
-
return t.createTaskGraph(tasks);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
class TaskGraphCreator {
|
|
223
|
-
constructor(projectGraph, defaultTargetDependencies) {
|
|
224
|
-
this.projectGraph = projectGraph;
|
|
225
|
-
this.defaultTargetDependencies = defaultTargetDependencies;
|
|
226
|
-
}
|
|
227
|
-
createTaskGraph(tasks) {
|
|
228
|
-
const graph = {
|
|
229
|
-
roots: [],
|
|
230
|
-
tasks: {},
|
|
231
|
-
dependencies: {},
|
|
232
|
-
};
|
|
233
|
-
for (const task of tasks) {
|
|
234
|
-
this.addTaskToGraph(task, graph);
|
|
235
|
-
const dependencyConfigs = getDependencyConfigs(task.target, this.defaultTargetDependencies, this.projectGraph);
|
|
236
|
-
if (!dependencyConfigs) {
|
|
237
|
-
continue;
|
|
238
|
-
}
|
|
239
|
-
this.addTaskDependencies(task, dependencyConfigs, tasks, graph);
|
|
240
|
-
}
|
|
241
|
-
graph.roots = Object.keys(graph.dependencies).filter((k) => graph.dependencies[k].length === 0);
|
|
242
|
-
return graph;
|
|
243
|
-
}
|
|
244
|
-
addTaskDependencies(task, dependencyConfigs, tasks, graph) {
|
|
245
|
-
for (const dependencyConfig of dependencyConfigs) {
|
|
246
|
-
if (dependencyConfig.projects === 'self') {
|
|
247
|
-
for (const t of tasks) {
|
|
248
|
-
if (t.target.project === task.target.project &&
|
|
249
|
-
t.target.target === dependencyConfig.target) {
|
|
250
|
-
graph.dependencies[task.id].push(t.id);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
else if (dependencyConfig.projects === 'dependencies') {
|
|
255
|
-
const seen = new Set();
|
|
256
|
-
this.addDependencies(task.target.project, dependencyConfig.target, tasks, graph, task.id, seen);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
addDependencies(project, target, tasks, graph, taskId, seen) {
|
|
261
|
-
seen.add(project);
|
|
262
|
-
const dependencies = this.projectGraph.dependencies[project];
|
|
263
|
-
if (dependencies) {
|
|
264
|
-
const projectDependencies = dependencies.map((dependency) => dependency.target);
|
|
265
|
-
for (const projectDependency of projectDependencies) {
|
|
266
|
-
if (seen.has(projectDependency)) {
|
|
267
|
-
continue;
|
|
268
|
-
}
|
|
269
|
-
const dependency = this.findTask({ project: projectDependency, target }, tasks);
|
|
270
|
-
if (dependency) {
|
|
271
|
-
if (graph.dependencies[taskId].indexOf(dependency.id) === -1) {
|
|
272
|
-
graph.dependencies[taskId].push(dependency.id);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
else {
|
|
276
|
-
this.addDependencies(projectDependency, target, tasks, graph, taskId, seen);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
findTask({ project, target }, tasks) {
|
|
282
|
-
return tasks.find((t) => t.target.project === project && t.target.target === target);
|
|
283
|
-
}
|
|
284
|
-
addTaskToGraph(task, graph) {
|
|
285
|
-
graph.tasks[task.id] = task;
|
|
286
|
-
graph.dependencies[task.id] = [];
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
exports.TaskGraphCreator = TaskGraphCreator;
|
|
290
|
-
function getDefaultDependencyConfigs(nxJson, runnerOptions) {
|
|
291
|
-
var _a, _b;
|
|
292
|
-
const defaults = (_a = nxJson.targetDependencies) !== null && _a !== void 0 ? _a : {};
|
|
293
|
-
const strictlyOrderedTargets = runnerOptions
|
|
294
|
-
? (_b = runnerOptions.strictlyOrderedTargets) !== null && _b !== void 0 ? _b : ['build']
|
|
295
|
-
: [];
|
|
296
|
-
// Strictly Ordered Targets depend on their dependencies
|
|
297
|
-
for (const target of strictlyOrderedTargets) {
|
|
298
|
-
defaults[target] = defaults[target] || [];
|
|
299
|
-
defaults[target].push({
|
|
300
|
-
target,
|
|
301
|
-
projects: 'dependencies',
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
return defaults;
|
|
305
|
-
}
|
|
306
|
-
//# sourceMappingURL=distributed-execution.runner.js.map
|
|
1
|
+
const a7_0xc9ef=['ENCRYPTION_KEY','TaskGraphCreator','roots','runUrl','Waiting...','addVerticalSeparator','error:\x20','axiosException','__awaiter','Extracting\x20artifacts','catch','executionStatus','hash','startTask','../../error/print-run-group-error','assign','E2EEncryption','submitRunMetrics','createTaskGraph','Main\x20job\x20terminated\x20with\x20an\x20error:\x20\x22','nxCloudDistributedTasksRunner','next','self','Error:','configuration','__esModule','./distributed-execution.api','push','url','dependencies','See\x20run\x20details\x20at\x20','Distributed\x20Execution\x20Terminated','log','executionId:\x20','finally','readFileSync','findTask','success','../../../utilities/waiter','encryptionKey','Unable\x20to\x20complete\x20a\x20run.','note','nx.json','projects','projectGraph','retrieve','./node_modules/.cache/nx','../../file-storage/e2e-encryption','length','taskId','wait','target','defaultTargetDependencies','terminalOutput','../../file-storage/file-storage','message','addTaskDependencies','indexOf','find','Status\x20update','exit','nodes','keys','defineProperty','targetDependencies','getRunGroup','project','printRunGroupError','value','logCommand','VERBOSE_LOGGING','criticalErrorMessage','createNoNewMessagesTimeout','createStartRequest','then','delete','overrides','Successfully\x20completed\x20running\x20the\x20command.','error','../../../utilities/metric-logger','executionStatus:\x20','scheduleTask','lifeCycle','stdout','addDependencies','../../../utilities/environment','completeRunGroupWithError','addTaskToGraph','completedTasks','Command\x20execution\x20failed.','commandStatus','parse','reset','FileStorage','DistributedExecutionApi','Found\x20unknown\x20task:\x20','done','apply','copyFilesFromCache','endTask','strictlyOrderedTargets','build','../../../utilities/create-no-new-messages-timeout','has','map','throw'];(function(_0x24da4,_0xc9efb4){const _0x247c0c=function(_0x28ff1d){while(--_0x28ff1d){_0x24da4['push'](_0x24da4['shift']());}};_0x247c0c(++_0xc9efb4);}(a7_0xc9ef,0x64));const a7_0x247c=function(_0x24da4,_0xc9efb4){_0x24da4=_0x24da4-0x0;let _0x247c0c=a7_0xc9ef[_0x24da4];return _0x247c0c;};'use strict';var __awaiter=this&&this[a7_0x247c('0xe')]||function(_0x30935f,_0x2446cd,_0xd57e5f,_0x1ec0ad){function _0x398579(_0xad6757){return _0xad6757 instanceof _0xd57e5f?_0xad6757:new _0xd57e5f(function(_0x265d7c){_0x265d7c(_0xad6757);});}return new(_0xd57e5f||(_0xd57e5f=Promise))(function(_0x20f22e,_0x529d39){function _0x4294b0(_0x56d5cf){try{_0x2080c9(_0x1ec0ad[a7_0x247c('0x1b')](_0x56d5cf));}catch(_0x1d5f7e){_0x529d39(_0x1d5f7e);}}function _0x2f0a88(_0x93643f){try{_0x2080c9(_0x1ec0ad[a7_0x247c('0x5')](_0x93643f));}catch(_0xca1aef){_0x529d39(_0xca1aef);}}function _0x2080c9(_0x23365b){_0x23365b[a7_0x247c('0x66')]?_0x20f22e(_0x23365b[a7_0x247c('0x4a')]):_0x398579(_0x23365b[a7_0x247c('0x4a')])[a7_0x247c('0x50')](_0x4294b0,_0x2f0a88);}_0x2080c9((_0x1ec0ad=_0x1ec0ad[a7_0x247c('0x67')](_0x30935f,_0x2446cd||[]))[a7_0x247c('0x1b')]());});};Object[a7_0x247c('0x45')](exports,a7_0x247c('0x1f'),{'value':!![]});exports[a7_0x247c('0x7')]=exports[a7_0x247c('0x1a')]=void 0x0;const Observable_1=require('rxjs/internal/Observable');const stripJsonComments=require('strip-json-comments');const fs_1=require('fs');const distributed_execution_api_1=require(a7_0x247c('0x20'));const file_storage_1=require(a7_0x247c('0x3c'));const e2e_encryption_1=require(a7_0x247c('0x35'));const waiter_1=require(a7_0x247c('0x2c'));const environment_1=require(a7_0x247c('0x5b'));const print_run_group_error_1=require(a7_0x247c('0x14'));const create_no_new_messages_timeout_1=require(a7_0x247c('0x2'));const metric_logger_1=require(a7_0x247c('0x55'));const {output,getDependencyConfigs,getOutputs,unparse,Cache}=require('../../../utilities/nx-imports');class NoopLifeCycle{[a7_0x247c('0x57')](_0x456b9d){}[a7_0x247c('0x13')](_0x1243ca){}[a7_0x247c('0x69')](_0x2f44b8,_0x5ce368){}}function runDistributedExecution(_0xcba97,_0x1b640f,_0x89144b,_0x5c2fbd,_0x33fc6b,_0x1494d0,_0x3b60eb){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x56fa29=JSON[a7_0x247c('0x61')](stripJsonComments((0x0,fs_1[a7_0x247c('0x29')])(a7_0x247c('0x30'))['toString']()));const _0xb4d4d2=new TaskOrderer(_0x89144b[a7_0x247c('0x32')],getDefaultDependencyConfigs(_0x56fa29,_0x1b640f))['splitTasksIntoStages'](_0x3b60eb);const _0xd301a8=yield _0xcba97['start']((0x0,distributed_execution_api_1[a7_0x247c('0x4f')])(_0x1494d0,_0xb4d4d2,_0x1b640f));return yield processTasks(_0xcba97,_0x5c2fbd,_0x33fc6b,_0x1b640f,_0xd301a8,_0x3b60eb,_0x89144b);});}function processTasks(_0x3fbf08,_0x322dec,_0x13a70a,_0xe0f742,_0x407ad2,_0x55c02f,_0x590ed5){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x49419b={};const _0x377fc4=(0x0,create_no_new_messages_timeout_1[a7_0x247c('0x4e')])();const _0x51b5eb=new waiter_1['Waiter']();while(!![]){if(environment_1[a7_0x247c('0x4c')]){output[a7_0x247c('0x2f')]({'title':a7_0x247c('0xa')});}yield _0x51b5eb[a7_0x247c('0x38')]();const _0x6024b3=yield _0x3fbf08['status'](_0x407ad2);if(environment_1['VERBOSE_LOGGING']){output[a7_0x247c('0x2f')]({'title':a7_0x247c('0x41'),'bodyLines':[a7_0x247c('0x27')+_0x407ad2,a7_0x247c('0x56')+_0x6024b3[a7_0x247c('0x11')],'number\x20of\x20completed\x20tasks:\x20'+_0x6024b3['completedTasks'][a7_0x247c('0x36')],a7_0x247c('0xc')+_0x6024b3[a7_0x247c('0x4d')]]});}if(_0x6024b3['criticalErrorMessage']){output['error']({'title':a7_0x247c('0x25'),'bodyLines':[a7_0x247c('0x1d'),_0x6024b3[a7_0x247c('0x4d')]]});process[a7_0x247c('0x42')](0x1);}_0x377fc4(_0x6024b3[a7_0x247c('0x5e')][a7_0x247c('0x36')]);for(const _0x5d029b of _0x6024b3[a7_0x247c('0x5e')]){if(_0x49419b[_0x5d029b['taskId']])continue;yield processTask(_0x322dec,_0x13a70a,_0x590ed5,_0xe0f742,_0x55c02f,_0x5d029b);_0x51b5eb[a7_0x247c('0x62')]();_0x49419b[_0x5d029b[a7_0x247c('0x37')]]=!![];}if(_0x6024b3['executionStatus']==='COMPLETED'){return{'commandStatus':_0x6024b3['commandStatus'],'runUrl':_0x6024b3[a7_0x247c('0x9')]};}}});}function processTask(_0x3a2d32,_0x2ab294,_0x33d4fe,_0x182e70,_0x3e01ec,_0x205ff5){return __awaiter(this,void 0x0,void 0x0,function*(){if(environment_1['VERBOSE_LOGGING']){output[a7_0x247c('0x2f')]({'title':'Processing\x20task\x20'+_0x205ff5[a7_0x247c('0x37')]});}const _0x22fe79=_0x3e01ec[a7_0x247c('0x40')](_0x3e1a8b=>_0x205ff5[a7_0x247c('0x37')]===_0x3e1a8b['id']);if(!_0x22fe79){throw new Error(a7_0x247c('0x65')+_0x205ff5[a7_0x247c('0x37')]);}if(environment_1[a7_0x247c('0x4c')]){output[a7_0x247c('0x2f')]({'title':'Retrieving\x20artifacts\x20from\x20'+_0x205ff5[a7_0x247c('0x22')]});}yield _0x3a2d32[a7_0x247c('0x33')](_0x205ff5[a7_0x247c('0x12')],_0x205ff5[a7_0x247c('0x22')],_0x182e70['cacheDirectory']||a7_0x247c('0x34'));const _0x571726=yield _0x2ab294['get'](Object[a7_0x247c('0x15')](Object[a7_0x247c('0x15')]({},_0x22fe79),{'hash':_0x205ff5['hash']}));const _0x26c37e=getOutputs(_0x33d4fe[a7_0x247c('0x32')][a7_0x247c('0x43')],_0x22fe79);if(environment_1[a7_0x247c('0x4c')]){output['note']({'title':a7_0x247c('0xf'),'bodyLines':_0x26c37e});}yield _0x2ab294[a7_0x247c('0x68')](_0x205ff5[a7_0x247c('0x12')],_0x571726,_0x26c37e);output[a7_0x247c('0x4b')](getCommand(_0x22fe79));process[a7_0x247c('0x59')]['write'](_0x571726[a7_0x247c('0x3b')]);output[a7_0x247c('0xb')]();});}function getCommand(_0x3bab65){const _0x3f5e2f=unparse(_0x3bab65[a7_0x247c('0x52')]||{});const _0x4fa791=_0x3bab65['target']['configuration']?':'+_0x3bab65[a7_0x247c('0x39')][a7_0x247c('0x1e')]:'';return['nx','run',_0x3bab65[a7_0x247c('0x39')][a7_0x247c('0x48')]+':'+_0x3bab65[a7_0x247c('0x39')][a7_0x247c('0x39')]+_0x4fa791,..._0x3f5e2f]['join']('\x20');}const nxCloudDistributedTasksRunner=(_0x39cdaa,_0x59287d,_0x107c99)=>{if(environment_1[a7_0x247c('0x4c')]){output[a7_0x247c('0x2f')]({'title':'Starting\x20distributed\x20command\x20execution'});}_0x59287d[a7_0x247c('0x58')]=new NoopLifeCycle();const _0x5eeb2d=(0x0,environment_1[a7_0x247c('0x47')])();if(!_0x5eeb2d){(0x0,print_run_group_error_1[a7_0x247c('0x49')])();return process[a7_0x247c('0x42')](0x1);}const _0x2dacd6=new e2e_encryption_1[(a7_0x247c('0x16'))](environment_1[a7_0x247c('0x6')]||_0x59287d[a7_0x247c('0x2d')]);const _0x320243=new file_storage_1[(a7_0x247c('0x63'))](_0x2dacd6);const _0xd47c9=new Cache(_0x59287d);const _0x8d738=new distributed_execution_api_1[(a7_0x247c('0x64'))](_0x59287d);runDistributedExecution(_0x8d738,_0x59287d,_0x107c99,_0x320243,_0xd47c9,_0x5eeb2d,_0x39cdaa)[a7_0x247c('0x50')](_0x2ed2ac=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){if(_0x2ed2ac[a7_0x247c('0x60')]===0x0){output[a7_0x247c('0x2b')]({'title':a7_0x247c('0x53'),'bodyLines':[a7_0x247c('0x24')+_0x2ed2ac[a7_0x247c('0x9')]]});}else{output[a7_0x247c('0x54')]({'title':a7_0x247c('0x5f'),'bodyLines':[a7_0x247c('0x24')+_0x2ed2ac[a7_0x247c('0x9')]]});}yield(0x0,metric_logger_1[a7_0x247c('0x17')])(_0x59287d);process[a7_0x247c('0x42')](_0x2ed2ac[a7_0x247c('0x60')]);}))[a7_0x247c('0x10')](_0x512fb2=>{output[a7_0x247c('0x54')]({'title':a7_0x247c('0x2e'),'bodyLines':[_0x512fb2[a7_0x247c('0x3d')]]});if(_0x512fb2['axiosException']){console[a7_0x247c('0x26')](_0x512fb2[a7_0x247c('0xd')]);}else{console['log'](_0x512fb2);}_0x8d738[a7_0x247c('0x5c')](_0x5eeb2d,a7_0x247c('0x19')+_0x512fb2[a7_0x247c('0x3d')]+'\x22')[a7_0x247c('0x28')](()=>process['exit'](0x1));});return new Observable_1['Observable'](()=>{});};exports[a7_0x247c('0x1a')]=nxCloudDistributedTasksRunner;class TaskOrderer{constructor(_0x5eef82,_0x84ac3a){this['projectGraph']=_0x5eef82;this[a7_0x247c('0x3a')]=_0x84ac3a;}['splitTasksIntoStages'](_0xc04f01){if(_0xc04f01[a7_0x247c('0x36')]===0x0)return[];const _0x3a55ac=[];const _0x2f7ac0=this['createTaskGraph'](_0xc04f01);const _0x2ffa08=new Set(_0xc04f01[a7_0x247c('0x4')](_0x41df56=>_0x41df56['id']));let _0x2013f6=0x0;while(_0x2ffa08['size']>0x0){const _0x1c18a0=_0x3a55ac[_0x2013f6]=[];for(const _0x28ab49 of _0x2ffa08){let _0x2b5b82=!![];for(const _0x569ad7 of _0x2f7ac0[a7_0x247c('0x23')][_0x28ab49]){if(_0x2ffa08[a7_0x247c('0x3')](_0x569ad7)){_0x2b5b82=![];break;}}if(!_0x2b5b82){continue;}const _0x1c65ca=_0x2f7ac0['tasks'][_0x28ab49];_0x1c18a0[a7_0x247c('0x21')](_0x1c65ca);}for(const _0x2071f1 of _0x1c18a0){_0x2ffa08[a7_0x247c('0x51')](_0x2071f1['id']);}_0x2013f6++;}return _0x3a55ac;}['createTaskGraph'](_0x699c67){const _0x44112e=new TaskGraphCreator(this[a7_0x247c('0x32')],this[a7_0x247c('0x3a')]);return _0x44112e['createTaskGraph'](_0x699c67);}}class TaskGraphCreator{constructor(_0x365591,_0x2b1eff){this[a7_0x247c('0x32')]=_0x365591;this[a7_0x247c('0x3a')]=_0x2b1eff;}[a7_0x247c('0x18')](_0x5e170f){const _0x53cd1a={'roots':[],'tasks':{},'dependencies':{}};for(const _0x5d33d1 of _0x5e170f){this[a7_0x247c('0x5d')](_0x5d33d1,_0x53cd1a);const _0x213a8c=getDependencyConfigs(_0x5d33d1[a7_0x247c('0x39')],this[a7_0x247c('0x3a')],this[a7_0x247c('0x32')]);if(!_0x213a8c){continue;}this['addTaskDependencies'](_0x5d33d1,_0x213a8c,_0x5e170f,_0x53cd1a);}_0x53cd1a[a7_0x247c('0x8')]=Object[a7_0x247c('0x44')](_0x53cd1a[a7_0x247c('0x23')])['filter'](_0x5d1ed3=>_0x53cd1a[a7_0x247c('0x23')][_0x5d1ed3][a7_0x247c('0x36')]===0x0);return _0x53cd1a;}[a7_0x247c('0x3e')](_0x11150d,_0x44a519,_0x227d74,_0x108818){for(const _0x51196b of _0x44a519){if(_0x51196b[a7_0x247c('0x31')]===a7_0x247c('0x1c')){for(const _0x300986 of _0x227d74){if(_0x300986['target'][a7_0x247c('0x48')]===_0x11150d[a7_0x247c('0x39')][a7_0x247c('0x48')]&&_0x300986[a7_0x247c('0x39')][a7_0x247c('0x39')]===_0x51196b[a7_0x247c('0x39')]){_0x108818[a7_0x247c('0x23')][_0x11150d['id']][a7_0x247c('0x21')](_0x300986['id']);}}}else if(_0x51196b[a7_0x247c('0x31')]===a7_0x247c('0x23')){const _0x177434=new Set();this['addDependencies'](_0x11150d['target'][a7_0x247c('0x48')],_0x51196b[a7_0x247c('0x39')],_0x227d74,_0x108818,_0x11150d['id'],_0x177434);}}}[a7_0x247c('0x5a')](_0x272838,_0x2536f7,_0x27a58b,_0x5aac49,_0x1bbfdd,_0x317758){_0x317758['add'](_0x272838);const _0x596858=this[a7_0x247c('0x32')][a7_0x247c('0x23')][_0x272838];if(_0x596858){const _0x2a2112=_0x596858[a7_0x247c('0x4')](_0x222fc3=>_0x222fc3[a7_0x247c('0x39')]);for(const _0x45aea7 of _0x2a2112){if(_0x317758[a7_0x247c('0x3')](_0x45aea7)){continue;}const _0xc739=this[a7_0x247c('0x2a')]({'project':_0x45aea7,'target':_0x2536f7},_0x27a58b);if(_0xc739){if(_0x5aac49[a7_0x247c('0x23')][_0x1bbfdd][a7_0x247c('0x3f')](_0xc739['id'])===-0x1){_0x5aac49[a7_0x247c('0x23')][_0x1bbfdd][a7_0x247c('0x21')](_0xc739['id']);}}else{this[a7_0x247c('0x5a')](_0x45aea7,_0x2536f7,_0x27a58b,_0x5aac49,_0x1bbfdd,_0x317758);}}}}[a7_0x247c('0x2a')]({project,target},_0x4b8197){return _0x4b8197[a7_0x247c('0x40')](_0x5f3fe3=>_0x5f3fe3['target']['project']===project&&_0x5f3fe3[a7_0x247c('0x39')][a7_0x247c('0x39')]===target);}['addTaskToGraph'](_0x1692c0,_0x443958){_0x443958['tasks'][_0x1692c0['id']]=_0x1692c0;_0x443958[a7_0x247c('0x23')][_0x1692c0['id']]=[];}}exports['TaskGraphCreator']=TaskGraphCreator;function getDefaultDependencyConfigs(_0x1e3b97,_0x23a679){var _0x2e47f8,_0x4349e5;const _0x381c40=(_0x2e47f8=_0x1e3b97[a7_0x247c('0x46')])!==null&&_0x2e47f8!==void 0x0?_0x2e47f8:{};const _0x3e72d9=_0x23a679?(_0x4349e5=_0x23a679[a7_0x247c('0x0')])!==null&&_0x4349e5!==void 0x0?_0x4349e5:[a7_0x247c('0x1')]:[];for(const _0x340ff5 of _0x3e72d9){_0x381c40[_0x340ff5]=_0x381c40[_0x340ff5]||[];_0x381c40[_0x340ff5]['push']({'target':_0x340ff5,'projects':a7_0x247c('0x23')});}return _0x381c40;}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/nx-cloud",
|
|
3
|
-
"version": "13.2.
|
|
3
|
+
"version": "13.2.2",
|
|
4
4
|
"description": "Nx Cloud plugin for Nx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Monorepo",
|
|
@@ -23,11 +23,8 @@
|
|
|
23
23
|
"axios": "^0.21.1",
|
|
24
24
|
"node-machine-id": "^1.1.12",
|
|
25
25
|
"tar": "6.1.11",
|
|
26
|
-
"strip-json-comments": "^3.1.1"
|
|
27
|
-
},
|
|
28
|
-
"typings": "./index.d.ts",
|
|
29
|
-
"peerDependencies": {
|
|
30
|
-
"rxjs": "6.5.5",
|
|
26
|
+
"strip-json-comments": "^3.1.1",
|
|
31
27
|
"chalk": "4.1.0"
|
|
32
|
-
}
|
|
28
|
+
},
|
|
29
|
+
"typings": "./index.d.ts"
|
|
33
30
|
}
|