@nrwl/nx-cloud 15.1.0 → 15.2.0-beta.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/lib/core/api/error-reporter.api.js +36 -1
- package/lib/core/api/run-group.api.js +68 -1
- package/lib/core/models/distributed-agent/tasks-api-response.model.d.ts +5 -0
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +92 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +305 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js.map +1 -1
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +117 -1
- package/lib/core/runners/cloud-enabled/cloud-run.api.js +167 -1
- package/lib/core/runners/cloud-enabled/id-generator.js +16 -1
- package/lib/core/runners/distributed-agent/distributed-agent.api.js +80 -1
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js +169 -1
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js.map +1 -1
- package/lib/core/runners/distributed-agent/execute-tasks.d.ts +3 -0
- package/lib/core/runners/distributed-agent/execute-tasks.js +115 -0
- package/lib/core/runners/distributed-agent/execute-tasks.js.map +1 -0
- package/lib/core/runners/distributed-agent/invoke-tasks.d.ts +8 -0
- package/lib/core/runners/distributed-agent/invoke-tasks.js +58 -0
- package/lib/core/runners/distributed-agent/invoke-tasks.js.map +1 -0
- package/lib/core/runners/distributed-execution/distributed-execution.api.js +143 -1
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js +115 -1
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js.map +1 -1
- package/lib/core/runners/distributed-execution/process-task.d.ts +7 -0
- package/lib/core/runners/distributed-execution/process-task.js +45 -0
- package/lib/core/runners/distributed-execution/process-task.js.map +1 -0
- package/lib/core/runners/distributed-execution/process-tasks.d.ts +7 -0
- package/lib/core/runners/distributed-execution/process-tasks.js +67 -0
- package/lib/core/runners/distributed-execution/process-tasks.js.map +1 -0
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js +37 -1
- package/lib/core/runners/distributed-execution/task-graph-creator.d.ts +2 -0
- package/lib/core/runners/distributed-execution/task-graph-creator.js +100 -1
- package/lib/core/runners/distributed-execution/task-graph-creator.js.map +1 -1
- package/lib/daemon/process-run-end.js +2 -3
- package/lib/daemon/process-run-end.js.map +1 -1
- package/lib/utilities/dte-artifact-storage.d.ts +7 -0
- package/lib/utilities/dte-artifact-storage.js +42 -0
- package/lib/utilities/dte-artifact-storage.js.map +1 -0
- package/lib/utilities/nx-imports.js +1 -7
- package/lib/utilities/nx-imports.js.map +1 -1
- package/package.json +1 -1
|
@@ -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,
|
|
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,2BAOY;AACZ,yDAAyD;AACzD,4CAA4C;AAC5C,gEAIwC;AACxC,oEAAoE;AACpE,6FAAuF;AACvF,uFAAiF;AACjF,6EAAuE;AAEvE,mEAA8D;AAC9D,mDAA+C;AAC/C,kFAA6E;AAC7E,kEAA8D;AAC9D,sEAAkE;AAClE,qEAAgE;AAEhE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAC3E,MAAM,IAAI,GAAQ,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE;IAC1C,KAAK,EAAE,CAAC,SAAS,CAAC;IAClB,OAAO,EAAE,EAAE;CACZ,CAAC,CAAC;AAEH,mDAAmD;AACnD,gDAAgD;AAChD,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAA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CAAC;IACH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAS,EAAE;QAC/B,MAAM,GAAG,CAAC,yBAAyB,CAAC,kCAAkC,CAAC,CAAC;QACxE,oBAAoB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC,CAAA,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAS,EAAE;QAC9B,MAAM,GAAG,CAAC,yBAAyB,CAAC,iCAAiC,CAAC,CAAC;QACvE,oBAAoB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC,CAAA,CAAC,CAAC;AACL,CAAC;AAED,SAAS,oBAAoB,CAAC,YAAY,EAAE,IAAI;IAC9C,IAAI,IAAA,eAAU,EAAC,YAAY,CAAC,EAAE;QAC5B,IAAA,eAAU,EAAC,YAAY,CAAC,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACpB;AACH,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DistributedAgentApi } from './distributed-agent.api';
|
|
2
|
+
import { DteArtifactStorage } from '../../../utilities/dte-artifact-storage';
|
|
3
|
+
export declare function executeTasks(agentName: string, api: DistributedAgentApi, dteArtifactStorage: DteArtifactStorage, completedTaskReader: (id: string) => any, targets: string[]): Promise<void>;
|
|
@@ -0,0 +1,115 @@
|
|
|
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.executeTasks = void 0;
|
|
13
|
+
const create_unchanged_value_timeout_1 = require("../../../utilities/create-unchanged-value-timeout");
|
|
14
|
+
const environment_1 = require("../../../utilities/environment");
|
|
15
|
+
const waiter_1 = require("../../../utilities/waiter");
|
|
16
|
+
const invoke_tasks_1 = require("./invoke-tasks");
|
|
17
|
+
const { output } = require('../../../utilities/nx-imports');
|
|
18
|
+
function executeTasks(agentName, api, dteArtifactStorage, completedTaskReader, targets) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
let completedStatusCode = 0;
|
|
21
|
+
let apiResponse = null;
|
|
22
|
+
const failIfSameTasksAfterTimeout = (0, create_unchanged_value_timeout_1.createUnchangedValueTimeout)({
|
|
23
|
+
title: `No new messages received after ${environment_1.NO_MESSAGES_TIMEOUT / 1000} seconds`,
|
|
24
|
+
timeout: environment_1.NO_MESSAGES_TIMEOUT,
|
|
25
|
+
});
|
|
26
|
+
const waiter = new waiter_1.Waiter();
|
|
27
|
+
let completedTasks = [];
|
|
28
|
+
const startTime = new Date();
|
|
29
|
+
let executedAnyTasks = false;
|
|
30
|
+
const processedTasks = {};
|
|
31
|
+
while (true) {
|
|
32
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
33
|
+
output.note({
|
|
34
|
+
title: `${agentName} fetching tasks...`,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
apiResponse = yield api.tasks(apiResponse ? apiResponse.executionId : null, completedStatusCode, completedTasks, targets);
|
|
38
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
39
|
+
output.note({
|
|
40
|
+
title: `${agentName} received an API Response`,
|
|
41
|
+
bodyLines: [
|
|
42
|
+
`completed: ${apiResponse.completed}`,
|
|
43
|
+
`status: ${apiResponse.status}`,
|
|
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 === null || apiResponse === void 0 ? void 0 : apiResponse.status) !== undefined) {
|
|
71
|
+
if (apiResponse.status === 'RUN_GROUP_COMPLETED' ||
|
|
72
|
+
apiResponse.status === 'NO_FURTHER_TASKS_TO_RUN') {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else if (apiResponse.completed) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
// if status is present that use the status instead of completed, otherwise use completed
|
|
80
|
+
failIfSameTasksAfterTimeout(apiResponse.tasks.map((t) => t.taskId).join(''));
|
|
81
|
+
if (!apiResponse.executionId) {
|
|
82
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
83
|
+
output.note({
|
|
84
|
+
title: `${agentName} waiting...`,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
yield waiter.wait();
|
|
88
|
+
completedStatusCode = 0;
|
|
89
|
+
completedTasks = [];
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
waiter.reset();
|
|
93
|
+
executedAnyTasks = true;
|
|
94
|
+
if (apiResponse.completedTasks) {
|
|
95
|
+
for (const t of apiResponse.completedTasks) {
|
|
96
|
+
if (processedTasks[t.taskId])
|
|
97
|
+
continue;
|
|
98
|
+
output.note({
|
|
99
|
+
title: `${agentName} downloading artifacts for ${t.taskId} Hash: ${t.hash} Url: ${t.url}`,
|
|
100
|
+
});
|
|
101
|
+
yield dteArtifactStorage.retrieveAndExtract(t.hash, t.url);
|
|
102
|
+
processedTasks[t.taskId] = true;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const r = (0, invoke_tasks_1.invokeTasksUsingRunMany)(completedTaskReader, apiResponse.executionId, apiResponse.tasks, apiResponse.maxParallel);
|
|
106
|
+
for (const t of r.completedTasks) {
|
|
107
|
+
processedTasks[t.taskId] = true;
|
|
108
|
+
}
|
|
109
|
+
completedStatusCode = r.completedStatusCode;
|
|
110
|
+
completedTasks = r.completedTasks;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
exports.executeTasks = executeTasks;
|
|
115
|
+
//# sourceMappingURL=execute-tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-tasks.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/distributed-agent/execute-tasks.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,sGAAgG;AAChG,gEAGwC;AACxC,sDAAmD;AACnD,iDAAyD;AAGzD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAE5D,SAAsB,YAAY,CAChC,SAAiB,EACjB,GAAwB,EACxB,kBAAsC,E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gBACxB,cAAc,GAAG,EAAE,CAAC;gBACpB,SAAS;aACV;YAED,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,gBAAgB,GAAG,IAAI,CAAC;YAExB,IAAI,WAAW,CAAC,cAAc,EAAE;gBAC9B,KAAK,MAAM,CAAC,IAAI,WAAW,CAAC,cAAc,EAAE;oBAC1C,IAAI,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC;wBAAE,SAAS;oBACvC,MAAM,CAAC,IAAI,CAAC;wBACV,KAAK,EAAE,GAAG,SAAS,8BAA8B,CAAC,CAAC,MAAM,UAAU,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,GAAG,EAAE;qBAC1F,CAAC,CAAC;oBACH,MAAM,kBAAkB,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;oBAC3D,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;iBACjC;aACF;YAED,MAAM,CAAC,GAAG,IAAA,sCAAuB,EAC/B,mBAAmB,EACnB,WAAW,CAAC,WAAW,EACvB,WAAW,CAAC,KAAK,EACjB,WAAW,CAAC,WAAW,CACxB,CAAC;YAEF,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE;gBAChC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;aACjC;YAED,mBAAmB,GAAG,CAAC,CAAC,mBAAmB,CAAC;YAC5C,cAAc,GAAG,CAAC,CAAC,cAAc,CAAC;SACnC;IACH,CAAC;CAAA;AAlID,oCAkIC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TaskToExecute } from '../../models/distributed-agent';
|
|
2
|
+
export declare function invokeTasksUsingRunMany(completedTaskReader: (id: string) => any, executionId: string, tasks: TaskToExecute[], maxParallel: number): {
|
|
3
|
+
completedTasks: {
|
|
4
|
+
taskId: string;
|
|
5
|
+
hash: string;
|
|
6
|
+
}[];
|
|
7
|
+
completedStatusCode: number;
|
|
8
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.invokeTasksUsingRunMany = void 0;
|
|
4
|
+
const environment_1 = require("../../../utilities/environment");
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const { output } = require('../../../utilities/nx-imports');
|
|
7
|
+
function invokeTasksUsingRunMany(completedTaskReader, executionId, tasks, maxParallel) {
|
|
8
|
+
let completedStatusCode = 0;
|
|
9
|
+
const completedTasks = [];
|
|
10
|
+
for (const g of groupByTarget(tasks)) {
|
|
11
|
+
const config = g.configuration ? `--configuration=${g.configuration}` : ``;
|
|
12
|
+
const parallel = maxParallel > 1 ? ` --parallel --max-parallel=${maxParallel}` : ``;
|
|
13
|
+
// TODO use pnpx or yarn when needed
|
|
14
|
+
const command = `npx nx run-many --target=${g.target} ${config} --projects=${g.projects.join(',')} ${g.params}${parallel}`;
|
|
15
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
16
|
+
output.note({
|
|
17
|
+
title: `Executing: '${command}'`,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
(0, child_process_1.execSync)(command, {
|
|
22
|
+
stdio: ['ignore', 'inherit', 'inherit'],
|
|
23
|
+
env: Object.assign(Object.assign({}, process.env), { NX_CACHE_FAILURES: 'true', NX_CLOUD_DISTRIBUTED_EXECUTION_ID: executionId, NX_STREAM_OUTPUT: 'true', NX_PREFIX_OUTPUT: 'true' }),
|
|
24
|
+
});
|
|
25
|
+
completedTasks.push(...completedTaskReader(executionId));
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
if (e.status === environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE) {
|
|
29
|
+
throw e;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
completedStatusCode = 1;
|
|
33
|
+
completedTasks.push(...completedTaskReader(executionId));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return { completedStatusCode, completedTasks };
|
|
38
|
+
}
|
|
39
|
+
exports.invokeTasksUsingRunMany = invokeTasksUsingRunMany;
|
|
40
|
+
function groupByTarget(tasks) {
|
|
41
|
+
const res = [];
|
|
42
|
+
tasks.forEach((t) => {
|
|
43
|
+
const r = res.find((rr) => rr.target === t.target && rr.configuration === t.configuration);
|
|
44
|
+
if (r) {
|
|
45
|
+
r.projects.push(t.projectName);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
res.push({
|
|
49
|
+
target: t.target,
|
|
50
|
+
projects: [t.projectName],
|
|
51
|
+
params: t.params,
|
|
52
|
+
configuration: t.configuration,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return res;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=invoke-tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoke-tasks.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/distributed-agent/invoke-tasks.ts"],"names":[],"mappings":";;;AACA,gEAGwC;AACxC,iDAAyC;AAEzC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAE5D,SAAgB,uBAAuB,CACrC,mBAAwC,EACxC,WAAmB,EACnB,KAAsB,EACtB,WAAmB;IAKnB,IAAI,mBAAmB,GAAG,CAAC,CAAC;IAC5B,MAAM,cAAc,GAAG,EAAW,CAAC;IACnC,KAAK,MAAM,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE;QACpC,MAAM,MAAM,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3E,MAAM,QAAQ,GACZ,WAAW,GAAG,CAAC,CAA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EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,aAAa,KAAK,CAAC,CAAC,aAAa,CACvE,CAAC;QACF,IAAI,CAAC,EAAE;YACL,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;SAChC;aAAM;YACL,GAAG,CAAC,IAAI,CAAC;gBACP,MAAM,EAAE,CAAC,CAAC,MAAM;gBAChB,QAAQ,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;gBACzB,MAAM,EAAE,CAAC,CAAC,MAAM;gBAChB,aAAa,EAAE,CAAC,CAAC,aAAa;aAC/B,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -1 +1,143 @@
|
|
|
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 } = 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
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
28
|
+
output.note({
|
|
29
|
+
title: 'Starting a distributed execution',
|
|
30
|
+
bodyLines: [JSON.stringify(params, null, 2)],
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/start', params));
|
|
35
|
+
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
39
|
+
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
40
|
+
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
41
|
+
throw e;
|
|
42
|
+
}
|
|
43
|
+
if (!resp.data.enabled) {
|
|
44
|
+
throw new Error(`Workspace is disabled. Cannot perform distributed task executions.`);
|
|
45
|
+
}
|
|
46
|
+
if (resp.data.error) {
|
|
47
|
+
throw new Error(resp.data.error);
|
|
48
|
+
}
|
|
49
|
+
return resp.data.id;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
status(id) {
|
|
53
|
+
var _a;
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const recorder = (0, metric_logger_1.createMetricRecorder)('dteStatus');
|
|
56
|
+
try {
|
|
57
|
+
const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/status', {
|
|
58
|
+
id,
|
|
59
|
+
}));
|
|
60
|
+
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
61
|
+
return resp.data;
|
|
62
|
+
}
|
|
63
|
+
catch (e) {
|
|
64
|
+
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
65
|
+
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
66
|
+
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
67
|
+
output.error({
|
|
68
|
+
title: e.message,
|
|
69
|
+
});
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
completeRunGroupWithError(runGroup, error) {
|
|
75
|
+
var _a;
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const recorder = (0, metric_logger_1.createMetricRecorder)('completeRunGroup');
|
|
78
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
79
|
+
output.note({
|
|
80
|
+
title: 'Completing run group with an error',
|
|
81
|
+
bodyLines: [`runGroup: ${runGroup}`, `error: ${error}`],
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/complete-run-group', {
|
|
86
|
+
runGroup: runGroup,
|
|
87
|
+
criticalErrorMessage: error,
|
|
88
|
+
}), 3);
|
|
89
|
+
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
90
|
+
}
|
|
91
|
+
catch (e) {
|
|
92
|
+
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
93
|
+
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
94
|
+
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.DistributedExecutionApi = DistributedExecutionApi;
|
|
100
|
+
function createStartRequest(runGroup, task, options) {
|
|
101
|
+
const tasksToExecute = task.map((arr) => {
|
|
102
|
+
return arr.map((t) => {
|
|
103
|
+
return {
|
|
104
|
+
taskId: t.id,
|
|
105
|
+
hash: t.hash,
|
|
106
|
+
projectName: t.target.project,
|
|
107
|
+
target: t.target.target,
|
|
108
|
+
configuration: t.target.configuration || null,
|
|
109
|
+
params: (0, serializer_overrides_1.serializeOverrides)(t),
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
const request = {
|
|
114
|
+
command: (0, environment_1.parseCommand)(),
|
|
115
|
+
branch: (0, environment_1.getBranch)(),
|
|
116
|
+
runGroup,
|
|
117
|
+
tasks: tasksToExecute,
|
|
118
|
+
maxParallel: calculateMaxParallel(options),
|
|
119
|
+
};
|
|
120
|
+
if (environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT) {
|
|
121
|
+
request.agentCount = environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT;
|
|
122
|
+
}
|
|
123
|
+
if (!environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_STOP_AGENTS_ON_FAILURE) {
|
|
124
|
+
request.stopAgentsOnFailure = false;
|
|
125
|
+
}
|
|
126
|
+
return request;
|
|
127
|
+
}
|
|
128
|
+
exports.createStartRequest = createStartRequest;
|
|
129
|
+
function calculateMaxParallel(options) {
|
|
130
|
+
if (options.parallel === 'false' || options.parallel === false) {
|
|
131
|
+
return 1;
|
|
132
|
+
}
|
|
133
|
+
else if (options.parallel === 'true' || options.parallel === true) {
|
|
134
|
+
return Number(options.maxParallel || 3);
|
|
135
|
+
}
|
|
136
|
+
else if (options.parallel === undefined) {
|
|
137
|
+
return options.maxParallel ? Number(options.maxParallel) : 3;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
return Number(options.parallel) || 3;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=distributed-execution.api.js.map
|
|
@@ -1 +1,115 @@
|
|
|
1
|
-
const a8_0x2c4b=['Main\x20job\x20was\x20terminated\x20via\x20SIGTERM','Extracting\x20artifacts','Main\x20job\x20was\x20terminated\x20via\x20SIGINT','then','TaskGraphCreator','getNxCacheDirectory','./task-graph-creator','message','addVerticalSeparator','executionStatus','defineProperty','executionStatus:\x20','Waiter','FileStorage','success','value','Main\x20job\x20terminated\x20with\x20an\x20error:\x20\x22','target','reset','\x20seconds.','executionId:\x20','tasks','apply','terminalOutput','join','../../api/error-reporter.api','criticalErrorMessage','completedTasks','Starting\x20distributed\x20command\x20execution','get','write','DistributedExecutionApi','existsSync','Processing\x20task\x20','next','skipNxCache','targetDependencies','splitTasksIntoStages','wait','../../../utilities/waiter','See\x20run\x20details\x20at\x20','push','E2EEncryption','scheduleTask','NO_COMPLETED_TASKS_TIMEOUT','Found\x20unknown\x20task:\x20','completeRunGroupWithError','../../file-storage/file-storage','number\x20of\x20completed\x20tasks:\x20','__awaiter','taskGraph','VERBOSE_LOGGING','../../../utilities/serializer-overrides','SIGTERM','Unable\x20to\x20download\x20','warn','hash','done','nodes','configuration','find','DTE\x20needs\x20the\x20cache\x20to\x20share\x20files\x20between\x20agents.','serializeOverrides','length','createUnchangedValueTimeout','ErrorReporterApi','COMPLETED','__esModule','toString','taskId','dependencies','stdout','../../file-storage/e2e-encryption','strip-json-comments','url','Successfully\x20completed\x20running\x20the\x20command.','exit','assign','error','submitRunMetrics','Command\x20execution\x20failed.','Waiting...','endTasks','parse','./split-task-graph-into-stages','getRunGroup','error:\x20','printRunGroupError','ENCRYPTION_KEY','note','project','Unable\x20to\x20complete\x20a\x20run.','lifeCycle','/nx.json','../../../utilities/nx-imports','run','encryptionKey','The\x20files\x20have\x20been\x20extracted\x20from\x20a\x20previous\x20command\x20invocation.','start','commandStatus','../../../utilities/create-unchanged-value-timeout','Retrieving\x20artifacts\x20from\x20','build','log'];(function(_0x43d8f7,_0x2c4b9a){const _0x101cb7=function(_0x4b6b8f){while(--_0x4b6b8f){_0x43d8f7['push'](_0x43d8f7['shift']());}};_0x101cb7(++_0x2c4b9a);}(a8_0x2c4b,0x181));const a8_0x101c=function(_0x43d8f7,_0x2c4b9a){_0x43d8f7=_0x43d8f7-0x0;let _0x101cb7=a8_0x2c4b[_0x43d8f7];return _0x101cb7;};'use strict';var __awaiter=this&&this[a8_0x101c('0x50')]||function(_0x78464,_0xc0146d,_0x3c3e85,_0x11a53c){function _0x46a482(_0x215956){return _0x215956 instanceof _0x3c3e85?_0x215956:new _0x3c3e85(function(_0x2ed7ac){_0x2ed7ac(_0x215956);});}return new(_0x3c3e85||(_0x3c3e85=Promise))(function(_0x172714,_0x1a03ff){function _0x2eded6(_0x134965){try{_0x524867(_0x11a53c[a8_0x101c('0x41')](_0x134965));}catch(_0x420056){_0x1a03ff(_0x420056);}}function _0x4784ba(_0x9925c6){try{_0x524867(_0x11a53c['throw'](_0x9925c6));}catch(_0x1090c4){_0x1a03ff(_0x1090c4);}}function _0x524867(_0x28b1ed){_0x28b1ed[a8_0x101c('0x58')]?_0x172714(_0x28b1ed[a8_0x101c('0x2e')]):_0x46a482(_0x28b1ed[a8_0x101c('0x2e')])[a8_0x101c('0x22')](_0x2eded6,_0x4784ba);}_0x524867((_0x11a53c=_0x11a53c[a8_0x101c('0x35')](_0x78464,_0xc0146d||[]))[a8_0x101c('0x41')]());});};Object[a8_0x101c('0x29')](exports,a8_0x101c('0x62'),{'value':!![]});exports['nxCloudDistributedTasksRunner']=void 0x0;const fs_1=require('fs');const stripJsonComments=require(a8_0x101c('0x0'));const create_unchanged_value_timeout_1=require(a8_0x101c('0x1b'));const environment_1=require('../../../utilities/environment');const metric_logger_1=require('../../../utilities/metric-logger');const serializer_overrides_1=require(a8_0x101c('0x53'));const waiter_1=require(a8_0x101c('0x46'));const error_reporter_api_1=require(a8_0x101c('0x38'));const print_run_group_error_1=require('../../error/print-run-group-error');const e2e_encryption_1=require(a8_0x101c('0x67'));const file_storage_1=require(a8_0x101c('0x4e'));const distributed_execution_api_1=require('./distributed-execution.api');const split_task_graph_into_stages_1=require(a8_0x101c('0xb'));const task_graph_creator_1=require(a8_0x101c('0x25'));const {output,workspaceRoot,getOutputs,Cache}=require(a8_0x101c('0x15'));class NoopLifeCycle{[a8_0x101c('0x4a')](_0x111202){}['startTask'](_0x2d1ecb){}[a8_0x101c('0x9')](_0x2dae6d){}}function runDistributedExecution(_0x4ca707,_0x591e30,_0x48c7de,_0xd547d5,_0xd4af69,_0x1a115c,_0x4a831b){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x5921f4=yield _0x4ca707[a8_0x101c('0x19')]((0x0,distributed_execution_api_1['createStartRequest'])(_0x1a115c,(0x0,split_task_graph_into_stages_1[a8_0x101c('0x44')])(_0x4a831b),_0x591e30));return yield processTasks(_0x4ca707,_0xd547d5,_0xd4af69,_0x591e30,_0x5921f4,Object['values'](_0x4a831b[a8_0x101c('0x34')]),_0x48c7de);});}function processTasks(_0x2feacb,_0x47b5d5,_0x12b663,_0x8bf9dd,_0x488b83,_0x4868a5,_0x82a6b6){return __awaiter(this,void 0x0,void 0x0,function*(){const _0xeb427d={};const _0x49ee50=(0x0,create_unchanged_value_timeout_1[a8_0x101c('0x5f')])({'title':'No\x20new\x20completed\x20tasks\x20after\x20'+environment_1[a8_0x101c('0x4b')]/0x3e8+a8_0x101c('0x32'),'timeout':environment_1[a8_0x101c('0x4b')]});const _0xad0a53=new waiter_1[(a8_0x101c('0x2b'))]();while(!![]){if(environment_1['VERBOSE_LOGGING']){output[a8_0x101c('0x10')]({'title':a8_0x101c('0x8')});}yield _0xad0a53[a8_0x101c('0x45')]();const _0x4bcd13=yield _0x2feacb['status'](_0x488b83);if(environment_1[a8_0x101c('0x52')]){output[a8_0x101c('0x10')]({'title':'Status\x20update','bodyLines':[a8_0x101c('0x33')+_0x488b83,a8_0x101c('0x2a')+_0x4bcd13['executionStatus'],a8_0x101c('0x4f')+_0x4bcd13[a8_0x101c('0x3a')]['length'],a8_0x101c('0xd')+_0x4bcd13[a8_0x101c('0x39')]]});}if(_0x4bcd13[a8_0x101c('0x39')]){output[a8_0x101c('0x5')]({'title':'Distributed\x20Execution\x20Terminated','bodyLines':['Error:',_0x4bcd13[a8_0x101c('0x39')]]});process['exit'](0x1);}_0x49ee50(_0x4bcd13[a8_0x101c('0x3a')][a8_0x101c('0x5e')]);for(const _0x2968d4 of _0x4bcd13[a8_0x101c('0x3a')]){if(_0xeb427d[_0x2968d4[a8_0x101c('0x64')]])continue;yield processTask(_0x47b5d5,_0x12b663,_0x82a6b6,_0x8bf9dd,_0x4868a5,_0x2968d4);_0xad0a53[a8_0x101c('0x31')]();_0xeb427d[_0x2968d4[a8_0x101c('0x64')]]=!![];}if(_0x4bcd13[a8_0x101c('0x28')]===a8_0x101c('0x61')){return{'commandStatus':_0x4bcd13[a8_0x101c('0x1a')],'runUrl':_0x4bcd13['runUrl']};}}});}function processTask(_0x15e96e,_0x375e44,_0x5ede12,_0x303c7f,_0x45027b,_0x4c1375){return __awaiter(this,void 0x0,void 0x0,function*(){if(environment_1[a8_0x101c('0x52')]){output[a8_0x101c('0x10')]({'title':a8_0x101c('0x40')+_0x4c1375[a8_0x101c('0x64')]});}const _0x5ac152=_0x45027b['find'](_0x3f8c32=>_0x4c1375[a8_0x101c('0x64')]===_0x3f8c32['id']);if(!_0x5ac152){throw new Error(a8_0x101c('0x4c')+_0x4c1375[a8_0x101c('0x64')]);}if(environment_1['VERBOSE_LOGGING']){output[a8_0x101c('0x10')]({'title':a8_0x101c('0x1c')+_0x4c1375[a8_0x101c('0x1')]});}const _0xafc18a=getOutputs(_0x5ede12['projectGraph'][a8_0x101c('0x59')],_0x5ac152);try{yield _0x15e96e['retrieve'](_0x4c1375['hash'],_0x4c1375[a8_0x101c('0x1')],(0x0,environment_1[a8_0x101c('0x24')])(_0x303c7f));}catch(_0x9d9d80){if(_0xafc18a[a8_0x101c('0x5e')]>0x0&&!_0xafc18a[a8_0x101c('0x5b')](_0x1f92a9=>(0x0,fs_1[a8_0x101c('0x3f')])(_0x1f92a9))){throw _0x9d9d80;}else{output[a8_0x101c('0x56')]({'title':a8_0x101c('0x55')+_0x4c1375[a8_0x101c('0x1')]+'.\x20Hash:\x20'+_0x4c1375[a8_0x101c('0x57')],'bodyLines':[a8_0x101c('0x18')]});}}const _0x3dfe9e=yield _0x375e44[a8_0x101c('0x3c')](Object[a8_0x101c('0x4')](Object[a8_0x101c('0x4')]({},_0x5ac152),{'hash':_0x4c1375[a8_0x101c('0x57')]}));if(environment_1['VERBOSE_LOGGING']){output[a8_0x101c('0x10')]({'title':a8_0x101c('0x20'),'bodyLines':_0xafc18a});}yield _0x375e44['copyFilesFromCache'](_0x4c1375[a8_0x101c('0x57')],_0x3dfe9e,_0xafc18a);output['logCommand'](getCommand(_0x5ac152));process[a8_0x101c('0x66')][a8_0x101c('0x3d')](_0x3dfe9e[a8_0x101c('0x36')]);output[a8_0x101c('0x27')]();});}function getCommand(_0x1796b8){const _0x422f99=_0x1796b8['target']['configuration']?':'+_0x1796b8[a8_0x101c('0x30')][a8_0x101c('0x5a')]:'';return['nx',a8_0x101c('0x16'),_0x1796b8[a8_0x101c('0x30')][a8_0x101c('0x11')]+':'+_0x1796b8['target'][a8_0x101c('0x30')]+_0x422f99,(0x0,serializer_overrides_1[a8_0x101c('0x5d')])(_0x1796b8)][a8_0x101c('0x37')]('\x20');}function attachSignalListenersToCompleteRunGroupOnError(_0x3a0dde,_0xe4f27e){process['on']('SIGINT',()=>__awaiter(this,void 0x0,void 0x0,function*(){yield _0x3a0dde[a8_0x101c('0x4d')](_0xe4f27e,a8_0x101c('0x21'));process[a8_0x101c('0x3')](0x1);}));process['on'](a8_0x101c('0x54'),()=>__awaiter(this,void 0x0,void 0x0,function*(){yield _0x3a0dde[a8_0x101c('0x4d')](_0xe4f27e,a8_0x101c('0x1f'));process[a8_0x101c('0x3')](0x1);}));}const nxCloudDistributedTasksRunner=(_0x5f0490,_0xe9f664,_0x595dcb)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){if(_0xe9f664[a8_0x101c('0x42')]){output[a8_0x101c('0x56')]({'title':'--skip-nx-cache\x20is\x20ignored\x20when\x20using\x20distributed\x20tasks\x20execution\x20(DTE).','bodyLine':[a8_0x101c('0x5c')]});}if(environment_1['VERBOSE_LOGGING']){output[a8_0x101c('0x10')]({'title':a8_0x101c('0x3b')});}_0xe9f664[a8_0x101c('0x13')]=new NoopLifeCycle();const _0x9eaa2c=(0x0,environment_1[a8_0x101c('0xc')])();if(!_0x9eaa2c){(0x0,print_run_group_error_1[a8_0x101c('0xe')])();return process[a8_0x101c('0x3')](0x1);}const _0x1c4c49=new e2e_encryption_1[(a8_0x101c('0x49'))](environment_1[a8_0x101c('0xf')]||_0xe9f664[a8_0x101c('0x17')]);const _0xcfb8bb=new error_reporter_api_1[(a8_0x101c('0x60'))](_0xe9f664);const _0x225d0a=new file_storage_1[(a8_0x101c('0x2c'))](_0x1c4c49,_0xcfb8bb,!![],![]);const _0x44c2d0=new Cache(_0xe9f664);const _0x1aade7=new distributed_execution_api_1[(a8_0x101c('0x3e'))](_0xe9f664);attachSignalListenersToCompleteRunGroupOnError(_0x1aade7,_0x9eaa2c);try{const _0x5f5a9b=getTaskGraph(_0x595dcb,_0x5f0490,_0xe9f664);const _0x391ad9=yield runDistributedExecution(_0x1aade7,_0xe9f664,_0x595dcb,_0x225d0a,_0x44c2d0,_0x9eaa2c,_0x5f5a9b);if(_0x391ad9[a8_0x101c('0x1a')]===0x0){output[a8_0x101c('0x2d')]({'title':a8_0x101c('0x2'),'bodyLines':[a8_0x101c('0x47')+_0x391ad9['runUrl']]});}else{output[a8_0x101c('0x5')]({'title':a8_0x101c('0x7'),'bodyLines':[a8_0x101c('0x47')+_0x391ad9['runUrl']]});}yield(0x0,metric_logger_1[a8_0x101c('0x6')])(_0xe9f664);process[a8_0x101c('0x3')](_0x391ad9[a8_0x101c('0x1a')]);}catch(_0x3142ca){output[a8_0x101c('0x5')]({'title':a8_0x101c('0x12'),'bodyLines':[_0x3142ca[a8_0x101c('0x26')]]});if(_0x3142ca['axiosException']){console['log'](_0x3142ca['axiosException']);}else{console[a8_0x101c('0x1e')](_0x3142ca);}try{yield _0x1aade7[a8_0x101c('0x4d')](_0x9eaa2c,a8_0x101c('0x2f')+_0x3142ca[a8_0x101c('0x26')]+'\x22');}finally{process[a8_0x101c('0x3')](0x1);}}});exports['nxCloudDistributedTasksRunner']=nxCloudDistributedTasksRunner;function getTaskGraph(_0x5b2331,_0x18fc80,_0x294e70){if(_0x5b2331[a8_0x101c('0x51')]){return _0x5b2331[a8_0x101c('0x51')];}else{const _0x418611=JSON[a8_0x101c('0xa')](stripJsonComments((0x0,fs_1['readFileSync'])(workspaceRoot+a8_0x101c('0x14'))[a8_0x101c('0x63')]()));return new task_graph_creator_1[(a8_0x101c('0x23'))](_0x5b2331['projectGraph'],getDefaultDependencyConfigs(_0x418611,_0x294e70))['createTaskGraph'](_0x18fc80);}}function getDefaultDependencyConfigs(_0x5a27f1,_0x463a77){var _0x79f078,_0x1a67bf;const _0x271c85=(_0x79f078=_0x5a27f1[a8_0x101c('0x43')])!==null&&_0x79f078!==void 0x0?_0x79f078:{};const _0x3dadbc=_0x463a77?(_0x1a67bf=_0x463a77['strictlyOrderedTargets'])!==null&&_0x1a67bf!==void 0x0?_0x1a67bf:[a8_0x101c('0x1d')]:[];for(const _0x1c032f of _0x3dadbc){_0x271c85[_0x1c032f]=_0x271c85[_0x1c032f]||[];_0x271c85[_0x1c032f][a8_0x101c('0x48')]({'target':_0x1c032f,'projects':a8_0x101c('0x65')});}return _0x271c85;}
|
|
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.nxCloudDistributedTasksRunner = void 0;
|
|
13
|
+
const environment_1 = require("../../../utilities/environment");
|
|
14
|
+
const metric_logger_1 = require("../../../utilities/metric-logger");
|
|
15
|
+
const error_reporter_api_1 = require("../../api/error-reporter.api");
|
|
16
|
+
const print_run_group_error_1 = require("../../error/print-run-group-error");
|
|
17
|
+
const e2e_encryption_1 = require("../../file-storage/e2e-encryption");
|
|
18
|
+
const file_storage_1 = require("../../file-storage/file-storage");
|
|
19
|
+
const distributed_execution_api_1 = require("./distributed-execution.api");
|
|
20
|
+
const split_task_graph_into_stages_1 = require("./split-task-graph-into-stages");
|
|
21
|
+
const task_graph_creator_1 = require("./task-graph-creator");
|
|
22
|
+
const process_tasks_1 = require("./process-tasks");
|
|
23
|
+
const dte_artifact_storage_1 = require("../../../utilities/dte-artifact-storage");
|
|
24
|
+
const { output } = require('../../../utilities/nx-imports');
|
|
25
|
+
class NoopLifeCycle {
|
|
26
|
+
scheduleTask(task) { }
|
|
27
|
+
startTask(task) { }
|
|
28
|
+
endTasks(tasks) { }
|
|
29
|
+
}
|
|
30
|
+
const nxCloudDistributedTasksRunner = (tasks, options, context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
if (options.skipNxCache) {
|
|
32
|
+
output.warn({
|
|
33
|
+
title: `--skip-nx-cache is ignored when using distributed tasks execution (DTE).`,
|
|
34
|
+
bodyLine: [`DTE needs the cache to share files between agents.`],
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
38
|
+
output.note({
|
|
39
|
+
title: 'Starting distributed command execution',
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
options.lifeCycle = new NoopLifeCycle();
|
|
43
|
+
const runGroup = (0, environment_1.getRunGroup)();
|
|
44
|
+
if (!runGroup) {
|
|
45
|
+
(0, print_run_group_error_1.printRunGroupError)();
|
|
46
|
+
return process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
const encryption = new e2e_encryption_1.E2EEncryption(environment_1.ENCRYPTION_KEY || options.encryptionKey);
|
|
49
|
+
const errorReporter = new error_reporter_api_1.ErrorReporterApi(options);
|
|
50
|
+
const dteArtifactStorage = new dte_artifact_storage_1.DteArtifactStorage(new file_storage_1.FileStorage(encryption, errorReporter, true, false), (0, environment_1.getNxCacheDirectory)(options));
|
|
51
|
+
const api = new distributed_execution_api_1.DistributedExecutionApi(options);
|
|
52
|
+
attachSignalListenersToCompleteRunGroupOnError(api, runGroup);
|
|
53
|
+
try {
|
|
54
|
+
const taskGraph = getTaskGraph(context, tasks, options);
|
|
55
|
+
const r = yield runDistributedExecution(api, options, dteArtifactStorage, runGroup, taskGraph);
|
|
56
|
+
if (r.commandStatus === 0) {
|
|
57
|
+
output.success({
|
|
58
|
+
title: 'Successfully completed running the command.',
|
|
59
|
+
bodyLines: [`See run details at ${r.runUrl}`],
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
output.error({
|
|
64
|
+
title: 'Command execution failed.',
|
|
65
|
+
bodyLines: [`See run details at ${r.runUrl}`],
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
yield (0, metric_logger_1.submitRunMetrics)(options);
|
|
69
|
+
process.exit(r.commandStatus);
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
output.error({
|
|
73
|
+
title: 'Unable to complete a run.',
|
|
74
|
+
bodyLines: [e.message],
|
|
75
|
+
});
|
|
76
|
+
if (e.axiosException) {
|
|
77
|
+
console.log(e.axiosException);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
console.log(e);
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
yield api.completeRunGroupWithError(runGroup, `Main job terminated with an error: "${e.message}"`);
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
exports.nxCloudDistributedTasksRunner = nxCloudDistributedTasksRunner;
|
|
91
|
+
function getTaskGraph(context, tasks, options) {
|
|
92
|
+
if (context.taskGraph) {
|
|
93
|
+
return context.taskGraph;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return (0, task_graph_creator_1.createTaskGraphCompat)(options, context.projectGraph, tasks);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function attachSignalListenersToCompleteRunGroupOnError(api, runGroup) {
|
|
100
|
+
process.on('SIGINT', () => __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
yield api.completeRunGroupWithError(runGroup, 'Main job was terminated via SIGINT');
|
|
102
|
+
process.exit(1);
|
|
103
|
+
}));
|
|
104
|
+
process.on('SIGTERM', () => __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
yield api.completeRunGroupWithError(runGroup, 'Main job was terminated via SIGTERM');
|
|
106
|
+
process.exit(1);
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
109
|
+
function runDistributedExecution(api, options, dteArtifactStorage, runGroup, taskGraph) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
const id = yield api.start((0, distributed_execution_api_1.createStartRequest)(runGroup, (0, split_task_graph_into_stages_1.splitTasksIntoStages)(taskGraph), options));
|
|
112
|
+
return yield (0, process_tasks_1.processTasks)(api, dteArtifactStorage, id, Object.values(taskGraph.tasks));
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=distributed-execution.runner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distributed-execution.runner.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/distributed-execution/distributed-execution.runner.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"distributed-execution.runner.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/distributed-execution/distributed-execution.runner.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gEAKwC;AACxC,oEAAoE;AACpE,qEAAgE;AAChE,6EAAuE;AACvE,sEAAkE;AAClE,kEAA8D;AAG9D,2EAGqC;AACrC,iFAAsE;AACtE,6DAA6D;AAC7D,mDAA+C;AAC/C,kFAA6E;AAE7E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAE5D,MAAM,aAAa;IACjB,YAAY,CAAC,IAAU,IAAS,CAAC;IAEjC,SAAS,CAAC,IAAU,IAAS,CAAC;IAE9B,QAAQ,CAAC,KAAmB,IAAS,CAAC;CACvC;AAEM,MAAM,6BAA6B,GAAQ,CAChD,KAAa,EACb,OAA+B,EAC/B,OAAY,EACZ,EAAE;IACF,IAAI,OAAO,CAAC,WAAW,EAAE;QACvB,MAAM,CAAC,IAAI,CAAC;YACV,KAAK,EAAE,0EAA0E;YACjF,QAAQ,EAAE,CAAC,oDAAoD,CAAC;SACjE,CAAC,CAAC;KACJ;IACD,IAAI,6BAAe,EAAE;QACnB,MAAM,CAAC,IAAI,CAAC;YACV,KAAK,EAAE,wCAAwC;SAChD,CAAC,CAAC;KACJ;IACD,OAAO,CAAC,SAAS,GAAG,IAAI,aAAa,EAAE,CAAC;IACxC,MAAM,QAAQ,GAAG,IAAA,yBAAW,GAAE,CAAC;IAC/B,IAAI,CAAC,QAAQ,EAAE;QACb,IAAA,0CAAkB,GAAE,CAAC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AAgB,EAChB,SAAoB;;QAEpB,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,KAAK,CACxB,IAAA,8CAAkB,EAAC,QAAQ,EAAE,IAAA,mDAAoB,EAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CACvE,CAAC;QACF,OAAO,MAAM,IAAA,4BAAY,EACvB,GAAG,EACH,kBAAkB,EAClB,EAAE,EACF,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAC/B,CAAC;IACJ,CAAC;CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Task } from '../../models/run-context.model';
|
|
2
|
+
import { DteArtifactStorage } from '../../../utilities/dte-artifact-storage';
|
|
3
|
+
export declare function processTask(dteArtifactStorage: DteArtifactStorage, tasks: Task[], completedTask: {
|
|
4
|
+
taskId: string;
|
|
5
|
+
hash: string;
|
|
6
|
+
url: string;
|
|
7
|
+
}): Promise<void>;
|