@nrwl/nx-cloud 14.4.0-beta.1 → 14.4.1
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/nx-cloud.js +3 -3
- package/bin/nx-cloud.js.map +1 -1
- package/lib/core/api/error-reporter.api.js +1 -36
- package/lib/core/api/run-group.api.d.ts +1 -1
- package/lib/core/api/run-group.api.js +1 -65
- package/lib/core/api/run-group.api.js.map +1 -1
- package/lib/core/commands/start-ci-run.js +7 -1
- package/lib/core/commands/start-ci-run.js.map +1 -1
- package/lib/core/models/distributed-agent/tasks-api-response.model.d.ts +1 -0
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +1 -156
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +1 -176
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +1 -113
- package/lib/core/runners/cloud-enabled/cloud-run.api.js +1 -166
- package/lib/core/runners/distributed-agent/distributed-agent.api.js +1 -79
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js +1 -252
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js.map +1 -1
- package/lib/core/runners/distributed-execution/distributed-execution.api.js +1 -137
- package/lib/core/runners/distributed-execution/distributed-execution.api.js.map +1 -1
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js +1 -217
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js.map +1 -1
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js +1 -37
- package/lib/core/runners/distributed-execution/task-graph-creator.js +1 -77
- package/lib/utilities/create-unchanged-value-timeout.d.ts +4 -0
- package/lib/utilities/{create-no-new-messages-timeout.js → create-unchanged-value-timeout.js} +6 -7
- package/lib/utilities/create-unchanged-value-timeout.js.map +1 -0
- package/lib/utilities/environment.d.ts +1 -0
- package/lib/utilities/environment.js +5 -1
- package/lib/utilities/environment.js.map +1 -1
- package/package.json +4 -2
- package/tsconfig.spec.json +2 -1
- package/lib/utilities/create-no-new-messages-timeout.d.ts +0 -1
- package/lib/utilities/create-no-new-messages-timeout.js.map +0 -1
|
@@ -1,252 +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.startAgent = void 0;
|
|
13
|
-
const child_process_1 = require("child_process");
|
|
14
|
-
const fs_1 = require("fs");
|
|
15
|
-
const stripJsonComments = require("strip-json-comments");
|
|
16
|
-
const create_no_new_messages_timeout_1 = require("../../../utilities/create-no-new-messages-timeout");
|
|
17
|
-
const environment_1 = require("../../../utilities/environment");
|
|
18
|
-
const metric_logger_1 = require("../../../utilities/metric-logger");
|
|
19
|
-
const waiter_1 = require("../../../utilities/waiter");
|
|
20
|
-
const print_run_group_error_1 = require("../../error/print-run-group-error");
|
|
21
|
-
const distributed_agent_api_1 = require("./distributed-agent.api");
|
|
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 failIfSameTasksAfterTimeout = (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
|
-
failIfSameTasksAfterTimeout(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 && process.env.CIRCLE_STAGE) {
|
|
166
|
-
return process.env.CIRCLE_STAGE;
|
|
167
|
-
}
|
|
168
|
-
else if (process.env.CIRCLECI !== undefined && process.env.CIRCLE_JOB) {
|
|
169
|
-
return process.env.CIRCLE_JOB;
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
return `Agent ${Math.floor(Math.random() * 100000)}`;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
function createAgentLockfileAndSetUpListeners(api, options, agentName) {
|
|
176
|
-
const cacheDirectory = options.cacheDirectory || './node_modules/.cache/nx';
|
|
177
|
-
const lockFileDirectory = `${cacheDirectory}/lockfiles`;
|
|
178
|
-
const lockFilePath = `${lockFileDirectory}/${agentName}.lock`;
|
|
179
|
-
if (!(0, fs_1.existsSync)(lockFileDirectory)) {
|
|
180
|
-
(0, fs_1.mkdirSync)(lockFileDirectory, { recursive: true });
|
|
181
|
-
}
|
|
182
|
-
// Check for other agents' lockfiles and warn if exist
|
|
183
|
-
const lockFiles = (0, fs_1.readdirSync)(lockFileDirectory);
|
|
184
|
-
if (lockFiles.length) {
|
|
185
|
-
// Check to make sure the current agent name is not in use (only 1/100000 ^ 2 chance of this)
|
|
186
|
-
if (lockFiles.includes(`${agentName}.lock`)) {
|
|
187
|
-
output.error({
|
|
188
|
-
title: 'Duplicate Agent ID Detected',
|
|
189
|
-
bodyLines: [
|
|
190
|
-
'We have detected another agent with this ID running in this workspace. This should not happen.',
|
|
191
|
-
'',
|
|
192
|
-
'End all currently running agents, run "npx nx-cloud clean-up-agents", and try again.',
|
|
193
|
-
],
|
|
194
|
-
});
|
|
195
|
-
process.exit(1);
|
|
196
|
-
}
|
|
197
|
-
output.warn({
|
|
198
|
-
title: 'Other Nx Cloud Agents Detected',
|
|
199
|
-
bodyLines: [
|
|
200
|
-
'We have detected other agents running in this workspace. This can cause unexpected behavior.',
|
|
201
|
-
'',
|
|
202
|
-
'This can also be a false positive caused by agents that did not shut down correctly.',
|
|
203
|
-
'If you believe this is the case, run "npx nx-cloud clean-up-agents".',
|
|
204
|
-
],
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
(0, fs_1.writeFileSync)(lockFilePath, '');
|
|
208
|
-
process.on('exit', (code) => {
|
|
209
|
-
cleanupAgentLockfile(lockFilePath, code);
|
|
210
|
-
});
|
|
211
|
-
process.on('SIGTERM', () => __awaiter(this, void 0, void 0, function* () {
|
|
212
|
-
yield api.completeRunGroupWithError('Agent was terminated via SIGTERM');
|
|
213
|
-
cleanupAgentLockfile(lockFilePath, 1);
|
|
214
|
-
}));
|
|
215
|
-
process.on('SIGINT', () => __awaiter(this, void 0, void 0, function* () {
|
|
216
|
-
yield api.completeRunGroupWithError('Agent was terminated via SIGINT');
|
|
217
|
-
cleanupAgentLockfile(lockFilePath, 1);
|
|
218
|
-
}));
|
|
219
|
-
}
|
|
220
|
-
function cleanupAgentLockfile(lockFilePath, code) {
|
|
221
|
-
if ((0, fs_1.existsSync)(lockFilePath)) {
|
|
222
|
-
(0, fs_1.unlinkSync)(lockFilePath);
|
|
223
|
-
process.exit(code);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
function startAgent() {
|
|
227
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
228
|
-
const runGroup = (0, environment_1.getRunGroup)();
|
|
229
|
-
if (!runGroup) {
|
|
230
|
-
(0, print_run_group_error_1.printRunGroupError)();
|
|
231
|
-
return process.exit(1);
|
|
232
|
-
}
|
|
233
|
-
output.note({
|
|
234
|
-
title: 'Starting an agent for running Nx tasks',
|
|
235
|
-
});
|
|
236
|
-
const options = JSON.parse(stripJsonComments((0, fs_1.readFileSync)(`${workspaceRoot}/nx.json`).toString())).tasksRunnerOptions.default.options;
|
|
237
|
-
const agentName = getAgentName();
|
|
238
|
-
const api = new distributed_agent_api_1.DistributedAgentApi(options, runGroup, agentName);
|
|
239
|
-
createAgentLockfileAndSetUpListeners(api, options, agentName);
|
|
240
|
-
return executeTasks(options, api)
|
|
241
|
-
.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
242
|
-
yield (0, metric_logger_1.submitRunMetrics)(options);
|
|
243
|
-
return res;
|
|
244
|
-
}))
|
|
245
|
-
.catch((e) => __awaiter(this, void 0, void 0, function* () {
|
|
246
|
-
yield api.completeRunGroupWithError(`Critical Error in Agent: "${e.message}"`);
|
|
247
|
-
throw e;
|
|
248
|
-
}));
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
exports.startAgent = startAgent;
|
|
252
|
-
//# sourceMappingURL=distributed-agent.impl.js.map
|
|
1
|
+
const a5_0x59ff=['NO_FURTHER_TASKS_TO_RUN','NO_MESSAGES_TIMEOUT','projectName','params','API\x20Response','toString','true','then','wait','completed:\x20','Other\x20Nx\x20Cloud\x20Agents\x20Detected','__esModule','taskId','Agent\x20was\x20terminated\x20via\x20SIGINT','Executing:\x20\x27','Fetching\x20tasks...','assign','/nx.json','__awaiter','value','VERBOSE_LOGGING','SIGTERM','defineProperty','Waiter','submitRunMetrics','parse','CIRCLECI','/tasks-hashes-','next','child_process','completed','existsSync','configuration','projects','../../error/print-run-group-error','createUnchangedValueTimeout','criticalErrorMessage','../../../utilities/nx-imports','warn','Command\x20execution\x20failed\x20(distributed\x20task\x20execution:\x20','cacheDirectory','./node_modules/.cache/nx','npx\x20nx\x20run-many\x20--target=','tasks','throw','SIGINT','includes','Agent\x20was\x20terminated\x20via\x20SIGTERM','/lockfiles','exit','completeRunGroupWithError','readdirSync','getRunGroup','Starting\x20an\x20agent\x20for\x20running\x20Nx\x20tasks','End\x20all\x20currently\x20running\x20agents,\x20run\x20\x22npx\x20nx-cloud\x20clean-up-agents\x22,\x20and\x20try\x20again.','./distributed-agent.api','strip-json-comments','done','../../../utilities/metric-logger','\x20seconds','env','target','.lock','join','DistributedAgentApi','push','Critical\x20Error\x20in\x20Agent:\x20\x22','CIRCLE_STAGE','Distributed\x20Execution\x20Terminated','length','DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE','executionId:\x20','forEach','executionId','default','Duplicate\x20Agent\x20ID\x20Detected','getTime','readFileSync','reset','startAgent','error','CIRCLE_JOB','If\x20you\x20believe\x20this\x20is\x20the\x20case,\x20run\x20\x22npx\x20nx-cloud\x20clean-up-agents\x22.','\x20--parallel\x20--max-parallel=','retryDuring','find','../../../utilities/environment','tasksRunnerOptions','message','status','number\x20of\x20tasks:\x20','floor','writeFileSync','maxParallel','inherit',').\x20Tasks\x20hashes\x20haven\x27t\x20been\x20recorded.','../../../utilities/waiter','note','We\x20have\x20detected\x20another\x20agent\x20with\x20this\x20ID\x20running\x20in\x20this\x20workspace.\x20This\x20should\x20not\x20happen.','--configuration=','unlinkSync','NX_AGENT_NAME'];(function(_0xbb8a3c,_0x59ffee){const _0x225ff7=function(_0x16092e){while(--_0x16092e){_0xbb8a3c['push'](_0xbb8a3c['shift']());}};_0x225ff7(++_0x59ffee);}(a5_0x59ff,0x95));const a5_0x225f=function(_0xbb8a3c,_0x59ffee){_0xbb8a3c=_0xbb8a3c-0x0;let _0x225ff7=a5_0x59ff[_0xbb8a3c];return _0x225ff7;};'use strict';var __awaiter=this&&this[a5_0x225f('0x49')]||function(_0x3115dc,_0x4318ac,_0x37622b,_0x336007){function _0x4d53b9(_0x55bcac){return _0x55bcac instanceof _0x37622b?_0x55bcac:new _0x37622b(function(_0x290342){_0x290342(_0x55bcac);});}return new(_0x37622b||(_0x37622b=Promise))(function(_0x419a6d,_0x40ced7){function _0x3831b6(_0x592756){try{_0x131bc4(_0x336007[a5_0x225f('0x53')](_0x592756));}catch(_0x45d50a){_0x40ced7(_0x45d50a);}}function _0x12e04f(_0x205f16){try{_0x131bc4(_0x336007[a5_0x225f('0x63')](_0x205f16));}catch(_0x2dbbcd){_0x40ced7(_0x2dbbcd);}}function _0x131bc4(_0x54f219){_0x54f219[a5_0x225f('0xa')]?_0x419a6d(_0x54f219[a5_0x225f('0x4a')]):_0x4d53b9(_0x54f219[a5_0x225f('0x4a')])[a5_0x225f('0x3e')](_0x3831b6,_0x12e04f);}_0x131bc4((_0x336007=_0x336007['apply'](_0x3115dc,_0x4318ac||[]))[a5_0x225f('0x53')]());});};Object[a5_0x225f('0x4d')](exports,a5_0x225f('0x42'),{'value':!![]});exports['startAgent']=void 0x0;const child_process_1=require(a5_0x225f('0x54'));const fs_1=require('fs');const stripJsonComments=require(a5_0x225f('0x9'));const create_unchanged_value_timeout_1=require('../../../utilities/create-unchanged-value-timeout');const environment_1=require(a5_0x225f('0x27'));const metric_logger_1=require(a5_0x225f('0xb'));const waiter_1=require(a5_0x225f('0x31'));const print_run_group_error_1=require(a5_0x225f('0x59'));const distributed_agent_api_1=require(a5_0x225f('0x8'));const {output,workspaceRoot}=require(a5_0x225f('0x5c'));function executeTasks(_0x556d6b,_0xdbbedd){return __awaiter(this,void 0x0,void 0x0,function*(){let _0x56ecfc=0x0;let _0x2432cd=null;const _0x163f89=(0x0,create_unchanged_value_timeout_1[a5_0x225f('0x5a')])({'title':'No\x20new\x20messages\x20received\x20after\x20'+environment_1[a5_0x225f('0x38')]/0x3e8+a5_0x225f('0xc'),'timeout':environment_1[a5_0x225f('0x38')]});const _0x2eea90=new waiter_1[(a5_0x225f('0x4e'))]();let _0xafde8f=[];const _0x22cb4a=new Date();let _0x5d2db8=![];while(!![]){if(environment_1[a5_0x225f('0x4b')]){output[a5_0x225f('0x32')]({'title':a5_0x225f('0x46')});}_0x2432cd=yield _0xdbbedd[a5_0x225f('0x62')](_0x2432cd?_0x2432cd[a5_0x225f('0x1a')]:null,_0x56ecfc,_0xafde8f);if(environment_1[a5_0x225f('0x4b')]){output[a5_0x225f('0x32')]({'title':a5_0x225f('0x3b'),'bodyLines':[a5_0x225f('0x40')+_0x2432cd[a5_0x225f('0x55')],'status:\x20'+_0x2432cd[a5_0x225f('0x2a')],'retryDuring:\x20'+_0x2432cd[a5_0x225f('0x25')],a5_0x225f('0x18')+_0x2432cd[a5_0x225f('0x1a')],a5_0x225f('0x2b')+_0x2432cd[a5_0x225f('0x62')]['length'],'error:\x20'+_0x2432cd[a5_0x225f('0x5b')],'maxParallel:\x20'+_0x2432cd[a5_0x225f('0x2e')]]});}if(_0x2432cd[a5_0x225f('0x5b')]){output[a5_0x225f('0x21')]({'title':a5_0x225f('0x15'),'bodyLines':['Error:',_0x2432cd[a5_0x225f('0x5b')]]});process[a5_0x225f('0x2')](0x0);}if((_0x2432cd===null||_0x2432cd===void 0x0?void 0x0:_0x2432cd[a5_0x225f('0x25')])&&(_0x2432cd===null||_0x2432cd===void 0x0?void 0x0:_0x2432cd[a5_0x225f('0x25')])!==0x0&&!_0x5d2db8&&new Date()['getTime']()-_0x22cb4a[a5_0x225f('0x1d')]()>_0x2432cd[a5_0x225f('0x25')]){yield _0x2eea90[a5_0x225f('0x3f')]();continue;}if((_0x2432cd===null||_0x2432cd===void 0x0?void 0x0:_0x2432cd[a5_0x225f('0x2a')])!==undefined){if(_0x2432cd['status']==='RUN_GROUP_COMPLETED'||_0x2432cd[a5_0x225f('0x2a')]===a5_0x225f('0x37')){return;}}else if(_0x2432cd[a5_0x225f('0x55')]){return;}_0x163f89(_0x2432cd[a5_0x225f('0x62')]['map'](_0x2da15f=>_0x2da15f[a5_0x225f('0x43')])['join'](''));if(!_0x2432cd['executionId']){if(environment_1[a5_0x225f('0x4b')]){output[a5_0x225f('0x32')]({'title':'Waiting...'});}yield _0x2eea90[a5_0x225f('0x3f')]();_0x56ecfc=0x0;_0xafde8f=[];continue;}_0x2eea90[a5_0x225f('0x1f')]();_0x5d2db8=!![];const _0x3bb7e6=invokeTasksUsingRunMany(_0x556d6b,_0x2432cd['executionId'],_0x2432cd['tasks'],_0x2432cd['maxParallel']);_0x56ecfc=_0x3bb7e6['completedStatusCode'];_0xafde8f=_0x3bb7e6['completedTasks'];}});}function readCompletedTasks(_0x50e6dd,_0x1bcd7e){const _0x36350e=a5_0x225f('0x5e')+_0x1bcd7e+a5_0x225f('0x30');let _0x9eb2e1;try{const _0x1e836d=_0x50e6dd[a5_0x225f('0x5f')]||'./node_modules/.cache/nx';const _0x390dc3=_0x1e836d+a5_0x225f('0x52')+_0x1bcd7e;_0x9eb2e1=JSON['parse']((0x0,fs_1[a5_0x225f('0x1e')])(_0x390dc3)[a5_0x225f('0x3c')]());(0x0,fs_1[a5_0x225f('0x35')])(_0x390dc3);}catch(_0x4e2594){throw new Error(_0x36350e);}if(_0x9eb2e1['length']==0x0){throw new Error(_0x36350e);}return _0x9eb2e1;}function invokeTasksUsingRunMany(_0x53511d,_0x522d3c,_0xb44a92,_0x1790b3){let _0x15e1de=0x0;const _0x262408=[];for(const _0x1f9fb6 of groupByTarget(_0xb44a92)){const _0x4704aa=_0x1f9fb6[a5_0x225f('0x57')]?a5_0x225f('0x34')+_0x1f9fb6['configuration']:'';const _0x5a9936=_0x1790b3>0x1?a5_0x225f('0x24')+_0x1790b3:'';const _0x44e67f=a5_0x225f('0x61')+_0x1f9fb6[a5_0x225f('0xe')]+'\x20'+_0x4704aa+'\x20--projects='+_0x1f9fb6[a5_0x225f('0x58')][a5_0x225f('0x10')](',')+'\x20'+_0x1f9fb6[a5_0x225f('0x3a')]+_0x5a9936;if(environment_1[a5_0x225f('0x4b')]){output[a5_0x225f('0x32')]({'title':a5_0x225f('0x45')+_0x44e67f+'\x27'});}try{(0x0,child_process_1['execSync'])(_0x44e67f,{'stdio':[a5_0x225f('0x2f'),'inherit',a5_0x225f('0x2f')],'env':Object['assign'](Object[a5_0x225f('0x47')]({},process[a5_0x225f('0xd')]),{'NX_CACHE_FAILURES':a5_0x225f('0x3d'),'NX_CLOUD_DISTRIBUTED_EXECUTION_ID':_0x522d3c})});_0x262408[a5_0x225f('0x12')](...readCompletedTasks(_0x53511d,_0x522d3c));}catch(_0x54c585){if(_0x54c585[a5_0x225f('0x2a')]===environment_1[a5_0x225f('0x17')]){throw _0x54c585;}else{_0x15e1de=0x1;_0x262408[a5_0x225f('0x12')](...readCompletedTasks(_0x53511d,_0x522d3c));}}}return{'completedStatusCode':_0x15e1de,'completedTasks':_0x262408};}function groupByTarget(_0x246661){const _0x5cb245=[];_0x246661[a5_0x225f('0x19')](_0x328816=>{const _0x18570d=_0x5cb245[a5_0x225f('0x26')](_0x5c4538=>_0x5c4538['target']===_0x328816[a5_0x225f('0xe')]&&_0x5c4538[a5_0x225f('0x57')]===_0x328816[a5_0x225f('0x57')]);if(_0x18570d){_0x18570d[a5_0x225f('0x58')][a5_0x225f('0x12')](_0x328816[a5_0x225f('0x39')]);}else{_0x5cb245[a5_0x225f('0x12')]({'target':_0x328816[a5_0x225f('0xe')],'projects':[_0x328816[a5_0x225f('0x39')]],'params':_0x328816[a5_0x225f('0x3a')],'configuration':_0x328816[a5_0x225f('0x57')]});}});return _0x5cb245;}function getAgentName(){if(process['env'][a5_0x225f('0x36')]!==undefined){return process[a5_0x225f('0xd')][a5_0x225f('0x36')];}else if(process[a5_0x225f('0xd')][a5_0x225f('0x51')]!==undefined&&process['env']['CIRCLE_STAGE']){return process['env'][a5_0x225f('0x14')];}else if(process[a5_0x225f('0xd')][a5_0x225f('0x51')]!==undefined&&process['env'][a5_0x225f('0x22')]){return process[a5_0x225f('0xd')][a5_0x225f('0x22')];}else{return'Agent\x20'+Math[a5_0x225f('0x2c')](Math['random']()*0x186a0);}}function createAgentLockfileAndSetUpListeners(_0x2b384d,_0x423806,_0x398b34){const _0x1e2d26=_0x423806['cacheDirectory']||a5_0x225f('0x60');const _0x3efd4d=_0x1e2d26+a5_0x225f('0x1');const _0x7263f3=_0x3efd4d+'/'+_0x398b34+a5_0x225f('0xf');if(!(0x0,fs_1[a5_0x225f('0x56')])(_0x3efd4d)){(0x0,fs_1['mkdirSync'])(_0x3efd4d,{'recursive':!![]});}const _0x51f031=(0x0,fs_1[a5_0x225f('0x4')])(_0x3efd4d);if(_0x51f031[a5_0x225f('0x16')]){if(_0x51f031[a5_0x225f('0x65')](_0x398b34+a5_0x225f('0xf'))){output[a5_0x225f('0x21')]({'title':a5_0x225f('0x1c'),'bodyLines':[a5_0x225f('0x33'),'',a5_0x225f('0x7')]});process['exit'](0x1);}output[a5_0x225f('0x5d')]({'title':a5_0x225f('0x41'),'bodyLines':['We\x20have\x20detected\x20other\x20agents\x20running\x20in\x20this\x20workspace.\x20This\x20can\x20cause\x20unexpected\x20behavior.','','This\x20can\x20also\x20be\x20a\x20false\x20positive\x20caused\x20by\x20agents\x20that\x20did\x20not\x20shut\x20down\x20correctly.',a5_0x225f('0x23')]});}(0x0,fs_1[a5_0x225f('0x2d')])(_0x7263f3,'');process['on'](a5_0x225f('0x2'),_0x2daeb6=>{cleanupAgentLockfile(_0x7263f3,_0x2daeb6);});process['on'](a5_0x225f('0x4c'),()=>__awaiter(this,void 0x0,void 0x0,function*(){yield _0x2b384d[a5_0x225f('0x3')](a5_0x225f('0x0'));cleanupAgentLockfile(_0x7263f3,0x1);}));process['on'](a5_0x225f('0x64'),()=>__awaiter(this,void 0x0,void 0x0,function*(){yield _0x2b384d[a5_0x225f('0x3')](a5_0x225f('0x44'));cleanupAgentLockfile(_0x7263f3,0x1);}));}function cleanupAgentLockfile(_0x2b6022,_0x29d930){if((0x0,fs_1[a5_0x225f('0x56')])(_0x2b6022)){(0x0,fs_1['unlinkSync'])(_0x2b6022);process[a5_0x225f('0x2')](_0x29d930);}}function startAgent(){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x3b2b0f=(0x0,environment_1[a5_0x225f('0x5')])();if(!_0x3b2b0f){(0x0,print_run_group_error_1['printRunGroupError'])();return process[a5_0x225f('0x2')](0x1);}output[a5_0x225f('0x32')]({'title':a5_0x225f('0x6')});const _0x583317=JSON[a5_0x225f('0x50')](stripJsonComments((0x0,fs_1['readFileSync'])(workspaceRoot+a5_0x225f('0x48'))[a5_0x225f('0x3c')]()))[a5_0x225f('0x28')][a5_0x225f('0x1b')]['options'];const _0x12234a=getAgentName();const _0x15a877=new distributed_agent_api_1[(a5_0x225f('0x11'))](_0x583317,_0x3b2b0f,_0x12234a);createAgentLockfileAndSetUpListeners(_0x15a877,_0x583317,_0x12234a);return executeTasks(_0x583317,_0x15a877)[a5_0x225f('0x3e')](_0x5a574d=>__awaiter(this,void 0x0,void 0x0,function*(){yield(0x0,metric_logger_1[a5_0x225f('0x4f')])(_0x583317);return _0x5a574d;}))['catch'](_0x4a7411=>__awaiter(this,void 0x0,void 0x0,function*(){yield _0x15a877[a5_0x225f('0x3')](a5_0x225f('0x13')+_0x4a7411[a5_0x225f('0x29')]+'\x22');throw _0x4a7411;}));});}exports[a5_0x225f('0x20')]=startAgent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distributed-agent.impl.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/distributed-agent/distributed-agent.impl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAAyC;AACzC,2BAOY;AACZ,yDAAyD;AACzD,
|
|
1
|
+
{"version":3,"file":"distributed-agent.impl.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/distributed-agent/distributed-agent.impl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAAyC;AACzC,2BAOY;AACZ,yDAAyD;AACzD,sGAAgG;AAChG,gEAKwC;AACxC,oEAAoE;AACpE,sDAAmD;AACnD,6EAAuE;AAOvE,mEAA8D;AAE9D,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAE3E,SAAe,YAAY,CACzB,OAA+B,EAC/B,GAAwB;;QAExB,IAAI,mBAAmB,GAAG,CAAC,CAAC;QAC5B,IAAI,WAAW,GAA4B,IAAI,CAA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,CAAC,CAAC;IACP,CAAC;CAAA;AA/BD,gCA+BC"}
|
|
@@ -1,137 +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 serializer_overrides_1 = require("../../../utilities/serializer-overrides");
|
|
17
|
-
const { output } = 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
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
73
|
-
output.note({
|
|
74
|
-
title: 'Completing run group with an error',
|
|
75
|
-
bodyLines: [`runGroup: ${runGroup}`, `error: ${error}`],
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
try {
|
|
79
|
-
const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/complete-run-group', {
|
|
80
|
-
runGroup: runGroup,
|
|
81
|
-
criticalErrorMessage: error,
|
|
82
|
-
}), 3);
|
|
83
|
-
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
84
|
-
}
|
|
85
|
-
catch (e) {
|
|
86
|
-
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
87
|
-
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
88
|
-
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.DistributedExecutionApi = DistributedExecutionApi;
|
|
94
|
-
function createStartRequest(runGroup, task, options) {
|
|
95
|
-
const tasksToExecute = task.map((arr) => {
|
|
96
|
-
return arr.map((t) => {
|
|
97
|
-
return {
|
|
98
|
-
taskId: t.id,
|
|
99
|
-
hash: t.hash,
|
|
100
|
-
projectName: t.target.project,
|
|
101
|
-
target: t.target.target,
|
|
102
|
-
configuration: t.target.configuration || null,
|
|
103
|
-
params: (0, serializer_overrides_1.serializeOverrides)(t),
|
|
104
|
-
};
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
const request = {
|
|
108
|
-
command: (0, environment_1.parseCommand)(),
|
|
109
|
-
branch: (0, environment_1.getBranch)(),
|
|
110
|
-
runGroup,
|
|
111
|
-
tasks: tasksToExecute,
|
|
112
|
-
maxParallel: calculateMaxParallel(options),
|
|
113
|
-
};
|
|
114
|
-
if (environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT) {
|
|
115
|
-
request.agentCount = environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT;
|
|
116
|
-
}
|
|
117
|
-
if (!environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_STOP_AGENTS_ON_FAILURE) {
|
|
118
|
-
request.stopAgentsOnFailure = false;
|
|
119
|
-
}
|
|
120
|
-
return request;
|
|
121
|
-
}
|
|
122
|
-
exports.createStartRequest = createStartRequest;
|
|
123
|
-
function calculateMaxParallel(options) {
|
|
124
|
-
if (options.parallel === 'false' || options.parallel === false) {
|
|
125
|
-
return 1;
|
|
126
|
-
}
|
|
127
|
-
else if (options.parallel === 'true' || options.parallel === true) {
|
|
128
|
-
return Number(options.maxParallel || 3);
|
|
129
|
-
}
|
|
130
|
-
else if (options.parallel === undefined) {
|
|
131
|
-
return options.maxParallel ? Number(options.maxParallel) : 3;
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
return Number(options.parallel) || 3;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
//# sourceMappingURL=distributed-execution.api.js.map
|
|
1
|
+
const a6_0x55c8=['agentCount','axiosException','../../../utilities/nx-imports','createMetricRecorder','Completing\x20run\x20group\x20with\x20an\x20error','error','note','dteStatus','completeRunGroupWithError','exit','map','value','NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT','getBranch','message','DistributedExecutionApi','Starting\x20a\x20distributed\x20execution','NX_CLOUD_DISTRIBUTED_EXECUTION_STOP_AGENTS_ON_FAILURE','target','/nx-cloud/executions/status','stringify','then','status','completeRunGroup','defineProperty','runGroup:\x20','maxParallel','hash','parallel','post','/nx-cloud/executions/complete-run-group','../../../utilities/axios','apply','recordMetric','../../../utilities/serializer-overrides','mapRespToPerfEntry','/nx-cloud/executions/start','stopAgentsOnFailure','serializeOverrides','done','../../../utilities/metric-logger','enabled','apiAxiosInstance','data','response','parseCommand','createStartRequest','axiosMultipleTries','__esModule','VERBOSE_LOGGING','__awaiter','error:\x20','RUNNER_FAILURE_PERF_ENTRY'];(function(_0x5a8c9b,_0x55c811){const _0x52eadd=function(_0x1fbb01){while(--_0x1fbb01){_0x5a8c9b['push'](_0x5a8c9b['shift']());}};_0x52eadd(++_0x55c811);}(a6_0x55c8,0x1e0));const a6_0x52ea=function(_0x5a8c9b,_0x55c811){_0x5a8c9b=_0x5a8c9b-0x0;let _0x52eadd=a6_0x55c8[_0x5a8c9b];return _0x52eadd;};'use strict';var __awaiter=this&&this[a6_0x52ea('0x2f')]||function(_0x514b62,_0x97af26,_0x2e5383,_0x60c7b6){function _0x2cf929(_0x205136){return _0x205136 instanceof _0x2e5383?_0x205136:new _0x2e5383(function(_0x3d99a4){_0x3d99a4(_0x205136);});}return new(_0x2e5383||(_0x2e5383=Promise))(function(_0x5c4f1a,_0x277203){function _0x2d8456(_0x14801e){try{_0x564a99(_0x60c7b6['next'](_0x14801e));}catch(_0x33dd23){_0x277203(_0x33dd23);}}function _0x4ebeb1(_0x5a247b){try{_0x564a99(_0x60c7b6['throw'](_0x5a247b));}catch(_0x193b71){_0x277203(_0x193b71);}}function _0x564a99(_0x471bad){_0x471bad[a6_0x52ea('0x24')]?_0x5c4f1a(_0x471bad[a6_0x52ea('0x8')]):_0x2cf929(_0x471bad[a6_0x52ea('0x8')])[a6_0x52ea('0x12')](_0x2d8456,_0x4ebeb1);}_0x564a99((_0x60c7b6=_0x60c7b6[a6_0x52ea('0x1d')](_0x514b62,_0x97af26||[]))['next']());});};Object[a6_0x52ea('0x15')](exports,a6_0x52ea('0x2d'),{'value':!![]});exports[a6_0x52ea('0x2b')]=exports[a6_0x52ea('0xc')]=void 0x0;const axios_1=require(a6_0x52ea('0x1c'));const environment_1=require('../../../utilities/environment');const metric_logger_1=require(a6_0x52ea('0x25'));const serializer_overrides_1=require(a6_0x52ea('0x1f'));const {output}=require(a6_0x52ea('0x34'));class DistributedExecutionApi{constructor(_0xbef912){this['apiAxiosInstance']=(0x0,axios_1['createApiAxiosInstance'])(_0xbef912);}['start'](_0x5d0723){var _0x1cb977;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x2ac64a=(0x0,metric_logger_1['createMetricRecorder'])('dteStart');let _0x3d28a2;if(environment_1['VERBOSE_LOGGING']){output['note']({'title':a6_0x52ea('0xd'),'bodyLines':[JSON[a6_0x52ea('0x11')](_0x5d0723,null,0x2)]});}try{_0x3d28a2=yield(0x0,axios_1[a6_0x52ea('0x2c')])(()=>this[a6_0x52ea('0x27')][a6_0x52ea('0x1a')](a6_0x52ea('0x21'),_0x5d0723));_0x2ac64a[a6_0x52ea('0x1e')]((0x0,metric_logger_1['mapRespToPerfEntry'])(_0x3d28a2));}catch(_0x26bdc3){_0x2ac64a[a6_0x52ea('0x1e')](((_0x1cb977=_0x26bdc3===null||_0x26bdc3===void 0x0?void 0x0:_0x26bdc3[a6_0x52ea('0x33')])===null||_0x1cb977===void 0x0?void 0x0:_0x1cb977[a6_0x52ea('0x29')])?(0x0,metric_logger_1[a6_0x52ea('0x20')])(_0x26bdc3[a6_0x52ea('0x33')][a6_0x52ea('0x29')]):metric_logger_1[a6_0x52ea('0x31')]);throw _0x26bdc3;}if(!_0x3d28a2['data'][a6_0x52ea('0x26')]){throw new Error('Workspace\x20is\x20disabled.\x20Cannot\x20perform\x20distributed\x20task\x20executions.');}if(_0x3d28a2['data'][a6_0x52ea('0x2')]){throw new Error(_0x3d28a2[a6_0x52ea('0x28')][a6_0x52ea('0x2')]);}return _0x3d28a2[a6_0x52ea('0x28')]['id'];});}[a6_0x52ea('0x13')](_0x4ed702){var _0x5a54e0;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x9d681c=(0x0,metric_logger_1[a6_0x52ea('0x0')])(a6_0x52ea('0x4'));try{const _0x2e4de3=yield(0x0,axios_1[a6_0x52ea('0x2c')])(()=>this[a6_0x52ea('0x27')][a6_0x52ea('0x1a')](a6_0x52ea('0x10'),{'id':_0x4ed702}));_0x9d681c['recordMetric']((0x0,metric_logger_1[a6_0x52ea('0x20')])(_0x2e4de3));return _0x2e4de3[a6_0x52ea('0x28')];}catch(_0x341627){_0x9d681c[a6_0x52ea('0x1e')](((_0x5a54e0=_0x341627===null||_0x341627===void 0x0?void 0x0:_0x341627[a6_0x52ea('0x33')])===null||_0x5a54e0===void 0x0?void 0x0:_0x5a54e0[a6_0x52ea('0x29')])?(0x0,metric_logger_1[a6_0x52ea('0x20')])(_0x341627[a6_0x52ea('0x33')][a6_0x52ea('0x29')]):metric_logger_1[a6_0x52ea('0x31')]);output[a6_0x52ea('0x2')]({'title':_0x341627[a6_0x52ea('0xb')]});process[a6_0x52ea('0x6')](0x1);}});}[a6_0x52ea('0x5')](_0x3f1a41,_0x520f37){var _0x56f147;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x4e4933=(0x0,metric_logger_1[a6_0x52ea('0x0')])(a6_0x52ea('0x14'));if(environment_1[a6_0x52ea('0x2e')]){output[a6_0x52ea('0x3')]({'title':a6_0x52ea('0x1'),'bodyLines':[a6_0x52ea('0x16')+_0x3f1a41,a6_0x52ea('0x30')+_0x520f37]});}try{const _0xcdce88=yield(0x0,axios_1['axiosMultipleTries'])(()=>this[a6_0x52ea('0x27')]['post'](a6_0x52ea('0x1b'),{'runGroup':_0x3f1a41,'criticalErrorMessage':_0x520f37}),0x3);_0x4e4933[a6_0x52ea('0x1e')]((0x0,metric_logger_1[a6_0x52ea('0x20')])(_0xcdce88));}catch(_0x5cde07){_0x4e4933[a6_0x52ea('0x1e')](((_0x56f147=_0x5cde07===null||_0x5cde07===void 0x0?void 0x0:_0x5cde07['axiosException'])===null||_0x56f147===void 0x0?void 0x0:_0x56f147['response'])?(0x0,metric_logger_1[a6_0x52ea('0x20')])(_0x5cde07['axiosException'][a6_0x52ea('0x29')]):metric_logger_1[a6_0x52ea('0x31')]);}});}}exports[a6_0x52ea('0xc')]=DistributedExecutionApi;function createStartRequest(_0x1b4f8d,_0x47e31e,_0x432511){const _0x13aaaf=_0x47e31e[a6_0x52ea('0x7')](_0x1bbe81=>{return _0x1bbe81['map'](_0x4aa5c6=>{return{'taskId':_0x4aa5c6['id'],'hash':_0x4aa5c6[a6_0x52ea('0x18')],'projectName':_0x4aa5c6[a6_0x52ea('0xf')]['project'],'target':_0x4aa5c6[a6_0x52ea('0xf')]['target'],'configuration':_0x4aa5c6['target']['configuration']||null,'params':(0x0,serializer_overrides_1[a6_0x52ea('0x23')])(_0x4aa5c6)};});});const _0x4933d8={'command':(0x0,environment_1[a6_0x52ea('0x2a')])(),'branch':(0x0,environment_1[a6_0x52ea('0xa')])(),'runGroup':_0x1b4f8d,'tasks':_0x13aaaf,'maxParallel':calculateMaxParallel(_0x432511)};if(environment_1[a6_0x52ea('0x9')]){_0x4933d8[a6_0x52ea('0x32')]=environment_1[a6_0x52ea('0x9')];}if(!environment_1[a6_0x52ea('0xe')]){_0x4933d8[a6_0x52ea('0x22')]=![];}return _0x4933d8;}exports['createStartRequest']=createStartRequest;function calculateMaxParallel(_0x302b52){if(_0x302b52[a6_0x52ea('0x19')]==='false'||_0x302b52['parallel']===![]){return 0x1;}else if(_0x302b52['parallel']==='true'||_0x302b52[a6_0x52ea('0x19')]===!![]){return Number(_0x302b52[a6_0x52ea('0x17')]||0x3);}else if(_0x302b52[a6_0x52ea('0x19')]===undefined){return _0x302b52[a6_0x52ea('0x17')]?Number(_0x302b52[a6_0x52ea('0x17')]):0x3;}else{return Number(_0x302b52[a6_0x52ea('0x19')])||0x3;}}
|
|
@@ -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,gEAMwC;AACxC,oEAI0C;AAE1C,kFAA6E;AAE7E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,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AAC,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;
|
|
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,gEAMwC;AACxC,oEAI0C;AAE1C,kFAA6E;AAE7E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAE5D,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,6BAAe,EAAE;gBACnB,MAAM,CAAC,IAAI,CAAC;oBACV,KAAK,EAAE,kCAAkC;oBACzC,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;iBAC7C,CAAC,CAAC;aACJ;YACD,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,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