@nrwl/nx-cloud 15.1.1 → 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/nx-cloud-tasks-runner.js +1 -7
- package/lib/nx-cloud-tasks-runner.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;AA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1B,oBAAoB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC,CAAC,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,C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AM,MAAM,CAAC,IAAI,EAAE,CAAC;gBACpB,mBAAmB,GAAG,CAAC,CAAC;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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,CAAC,GAAG,GAAG,CAAC,IAAI,CAChB,CAAC,EAAE,EAAE,EAAE,CAAC,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_0x5bbf=['exit','apply','toString','DistributedExecutionApi','value','Unable\x20to\x20download\x20','build','completedTasks','nodes','Waiter','defineProperty','createUnchangedValueTimeout','projectGraph','serializeOverrides','write','error','Extracting\x20artifacts','commandStatus','axiosException','readFileSync','../../file-storage/e2e-encryption','done','SIGTERM','target','terminalOutput','TaskGraphCreator','Main\x20job\x20was\x20terminated\x20via\x20SIGINT','splitTasksIntoStages','start','message','existsSync','Processing\x20task\x20','strip-json-comments','createTaskGraph','retrieve','../../api/error-reporter.api','SIGINT','completeRunGroupWithError','hash','log','find','VERBOSE_LOGGING','assign','../../../utilities/environment','printRunGroupError','note','/nx.json','Retrieving\x20artifacts\x20from\x20','startTask','FileStorage','See\x20run\x20details\x20at\x20','taskId','targetDependencies','getRunGroup','warn','scheduleTask','../../../utilities/nx-imports','../../../utilities/waiter','project','taskGraph','executionStatus','throw','lifeCycle','E2EEncryption','./distributed-execution.api','length','values','runUrl','Successfully\x20completed\x20running\x20the\x20command.','tasks','submitRunMetrics','createStartRequest','../../error/print-run-group-error','criticalErrorMessage','encryptionKey','../../../utilities/metric-logger','url','__awaiter','ENCRYPTION_KEY','Waiting...','configuration','Status\x20update','run','executionId:\x20','push','--skip-nx-cache\x20is\x20ignored\x20when\x20using\x20distributed\x20tasks\x20execution\x20(DTE).','dependencies','Distributed\x20Execution\x20Terminated','parse','Unable\x20to\x20complete\x20a\x20run.','Found\x20unknown\x20task:\x20','\x20seconds.','Main\x20job\x20was\x20terminated\x20via\x20SIGTERM','executionStatus:\x20','./split-task-graph-into-stages','./task-graph-creator','number\x20of\x20completed\x20tasks:\x20','addVerticalSeparator'];(function(_0x226c85,_0x5bbf15){const _0x34fa82=function(_0x420810){while(--_0x420810){_0x226c85['push'](_0x226c85['shift']());}};_0x34fa82(++_0x5bbf15);}(a8_0x5bbf,0xf4));const a8_0x34fa=function(_0x226c85,_0x5bbf15){_0x226c85=_0x226c85-0x0;let _0x34fa82=a8_0x5bbf[_0x226c85];return _0x34fa82;};'use strict';var __awaiter=this&&this[a8_0x34fa('0x1d')]||function(_0x2076fc,_0x5a60fa,_0x7a623b,_0x47856b){function _0x3ac67c(_0xef377b){return _0xef377b instanceof _0x7a623b?_0xef377b:new _0x7a623b(function(_0x3c9b98){_0x3c9b98(_0xef377b);});}return new(_0x7a623b||(_0x7a623b=Promise))(function(_0x308128,_0x3f030e){function _0x5e9aac(_0x379b0f){try{_0x16c02f(_0x47856b['next'](_0x379b0f));}catch(_0x27efe5){_0x3f030e(_0x27efe5);}}function _0x5c51b9(_0x1016b9){try{_0x16c02f(_0x47856b[a8_0x34fa('0xd')](_0x1016b9));}catch(_0x2ab666){_0x3f030e(_0x2ab666);}}function _0x16c02f(_0x295fd4){_0x295fd4[a8_0x34fa('0x47')]?_0x308128(_0x295fd4[a8_0x34fa('0x36')]):_0x3ac67c(_0x295fd4[a8_0x34fa('0x36')])['then'](_0x5e9aac,_0x5c51b9);}_0x16c02f((_0x47856b=_0x47856b[a8_0x34fa('0x33')](_0x2076fc,_0x5a60fa||[]))['next']());});};Object[a8_0x34fa('0x3c')](exports,'__esModule',{'value':!![]});exports['nxCloudDistributedTasksRunner']=void 0x0;const fs_1=require('fs');const stripJsonComments=require(a8_0x34fa('0x52'));const create_unchanged_value_timeout_1=require('../../../utilities/create-unchanged-value-timeout');const environment_1=require(a8_0x34fa('0x5d'));const metric_logger_1=require(a8_0x34fa('0x1b'));const serializer_overrides_1=require('../../../utilities/serializer-overrides');const waiter_1=require(a8_0x34fa('0x9'));const error_reporter_api_1=require(a8_0x34fa('0x55'));const print_run_group_error_1=require(a8_0x34fa('0x18'));const e2e_encryption_1=require(a8_0x34fa('0x46'));const file_storage_1=require('../../file-storage/file-storage');const distributed_execution_api_1=require(a8_0x34fa('0x10'));const split_task_graph_into_stages_1=require(a8_0x34fa('0x2e'));const task_graph_creator_1=require(a8_0x34fa('0x2f'));const {output,workspaceRoot,getOutputs,Cache}=require(a8_0x34fa('0x8'));class NoopLifeCycle{[a8_0x34fa('0x7')](_0x581425){}[a8_0x34fa('0x0')](_0x4b8665){}['endTasks'](_0x578138){}}function runDistributedExecution(_0x211bc9,_0x45e910,_0x2b27a6,_0x838ebb,_0x37e4f9,_0x4fd65b,_0xc4a9f){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x595e67=yield _0x211bc9[a8_0x34fa('0x4e')]((0x0,distributed_execution_api_1[a8_0x34fa('0x17')])(_0x4fd65b,(0x0,split_task_graph_into_stages_1[a8_0x34fa('0x4d')])(_0xc4a9f),_0x45e910));return yield processTasks(_0x211bc9,_0x838ebb,_0x37e4f9,_0x45e910,_0x595e67,Object[a8_0x34fa('0x12')](_0xc4a9f[a8_0x34fa('0x15')]),_0x2b27a6);});}function processTasks(_0x1e563f,_0x36597a,_0x15f737,_0x40caba,_0x34b085,_0x2a8853,_0x964c59){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x593e00={};const _0x3626fb=(0x0,create_unchanged_value_timeout_1[a8_0x34fa('0x3d')])({'title':'No\x20new\x20completed\x20tasks\x20after\x20'+environment_1['NO_COMPLETED_TASKS_TIMEOUT']/0x3e8+a8_0x34fa('0x2b'),'timeout':environment_1['NO_COMPLETED_TASKS_TIMEOUT']});const _0xd066af=new waiter_1[(a8_0x34fa('0x3b'))]();while(!![]){if(environment_1['VERBOSE_LOGGING']){output[a8_0x34fa('0x5f')]({'title':a8_0x34fa('0x1f')});}yield _0xd066af['wait']();const _0x4f9c8f=yield _0x1e563f['status'](_0x34b085);if(environment_1[a8_0x34fa('0x5b')]){output['note']({'title':a8_0x34fa('0x21'),'bodyLines':[a8_0x34fa('0x23')+_0x34b085,a8_0x34fa('0x2d')+_0x4f9c8f[a8_0x34fa('0xc')],a8_0x34fa('0x30')+_0x4f9c8f['completedTasks'][a8_0x34fa('0x11')],'error:\x20'+_0x4f9c8f[a8_0x34fa('0x19')]]});}if(_0x4f9c8f[a8_0x34fa('0x19')]){output[a8_0x34fa('0x41')]({'title':a8_0x34fa('0x27'),'bodyLines':['Error:',_0x4f9c8f[a8_0x34fa('0x19')]]});process[a8_0x34fa('0x32')](0x1);}_0x3626fb(_0x4f9c8f['completedTasks'][a8_0x34fa('0x11')]);for(const _0x3b52ac of _0x4f9c8f[a8_0x34fa('0x39')]){if(_0x593e00[_0x3b52ac[a8_0x34fa('0x3')]])continue;yield processTask(_0x36597a,_0x15f737,_0x964c59,_0x40caba,_0x2a8853,_0x3b52ac);_0xd066af['reset']();_0x593e00[_0x3b52ac[a8_0x34fa('0x3')]]=!![];}if(_0x4f9c8f[a8_0x34fa('0xc')]==='COMPLETED'){return{'commandStatus':_0x4f9c8f['commandStatus'],'runUrl':_0x4f9c8f[a8_0x34fa('0x13')]};}}});}function processTask(_0x174edc,_0x18f4b8,_0x145f9d,_0x54ecc7,_0x4a3c93,_0x14db67){return __awaiter(this,void 0x0,void 0x0,function*(){if(environment_1[a8_0x34fa('0x5b')]){output[a8_0x34fa('0x5f')]({'title':a8_0x34fa('0x51')+_0x14db67[a8_0x34fa('0x3')]});}const _0x49b13b=_0x4a3c93[a8_0x34fa('0x5a')](_0x54601e=>_0x14db67['taskId']===_0x54601e['id']);if(!_0x49b13b){throw new Error(a8_0x34fa('0x2a')+_0x14db67['taskId']);}if(environment_1['VERBOSE_LOGGING']){output[a8_0x34fa('0x5f')]({'title':a8_0x34fa('0x61')+_0x14db67[a8_0x34fa('0x1c')]});}const _0x465674=getOutputs(_0x145f9d[a8_0x34fa('0x3e')][a8_0x34fa('0x3a')],_0x49b13b);try{yield _0x174edc[a8_0x34fa('0x54')](_0x14db67[a8_0x34fa('0x58')],_0x14db67[a8_0x34fa('0x1c')],(0x0,environment_1['getNxCacheDirectory'])(_0x54ecc7));}catch(_0x39f70c){if(_0x465674[a8_0x34fa('0x11')]>0x0&&!_0x465674[a8_0x34fa('0x5a')](_0x43ed2a=>(0x0,fs_1[a8_0x34fa('0x50')])(_0x43ed2a))){throw _0x39f70c;}else{output[a8_0x34fa('0x6')]({'title':a8_0x34fa('0x37')+_0x14db67[a8_0x34fa('0x1c')]+'.\x20Hash:\x20'+_0x14db67[a8_0x34fa('0x58')],'bodyLines':['The\x20files\x20have\x20been\x20extracted\x20from\x20a\x20previous\x20command\x20invocation.']});}}const _0xac94ec=yield _0x18f4b8['get'](Object[a8_0x34fa('0x5c')](Object['assign']({},_0x49b13b),{'hash':_0x14db67['hash']}));if(environment_1[a8_0x34fa('0x5b')]){output['note']({'title':a8_0x34fa('0x42'),'bodyLines':_0x465674});}yield _0x18f4b8['copyFilesFromCache'](_0x14db67[a8_0x34fa('0x58')],_0xac94ec,_0x465674);output['logCommand'](getCommand(_0x49b13b));process['stdout'][a8_0x34fa('0x40')](_0xac94ec[a8_0x34fa('0x4a')]);output[a8_0x34fa('0x31')]();});}function getCommand(_0x1af8b8){const _0x4d65ec=_0x1af8b8[a8_0x34fa('0x49')][a8_0x34fa('0x20')]?':'+_0x1af8b8[a8_0x34fa('0x49')]['configuration']:'';return['nx',a8_0x34fa('0x22'),_0x1af8b8[a8_0x34fa('0x49')][a8_0x34fa('0xa')]+':'+_0x1af8b8['target'][a8_0x34fa('0x49')]+_0x4d65ec,(0x0,serializer_overrides_1[a8_0x34fa('0x3f')])(_0x1af8b8)]['join']('\x20');}function attachSignalListenersToCompleteRunGroupOnError(_0x4cf517,_0x12ee26){process['on'](a8_0x34fa('0x56'),()=>__awaiter(this,void 0x0,void 0x0,function*(){yield _0x4cf517[a8_0x34fa('0x57')](_0x12ee26,a8_0x34fa('0x4c'));process[a8_0x34fa('0x32')](0x1);}));process['on'](a8_0x34fa('0x48'),()=>__awaiter(this,void 0x0,void 0x0,function*(){yield _0x4cf517[a8_0x34fa('0x57')](_0x12ee26,a8_0x34fa('0x2c'));process[a8_0x34fa('0x32')](0x1);}));}const nxCloudDistributedTasksRunner=(_0x1c7872,_0x47cd24,_0x38a11e)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){if(_0x47cd24['skipNxCache']){output['warn']({'title':a8_0x34fa('0x25'),'bodyLine':['DTE\x20needs\x20the\x20cache\x20to\x20share\x20files\x20between\x20agents.']});}if(environment_1['VERBOSE_LOGGING']){output[a8_0x34fa('0x5f')]({'title':'Starting\x20distributed\x20command\x20execution'});}_0x47cd24[a8_0x34fa('0xe')]=new NoopLifeCycle();const _0x524a53=(0x0,environment_1[a8_0x34fa('0x5')])();if(!_0x524a53){(0x0,print_run_group_error_1[a8_0x34fa('0x5e')])();return process['exit'](0x1);}const _0x835510=new e2e_encryption_1[(a8_0x34fa('0xf'))](environment_1[a8_0x34fa('0x1e')]||_0x47cd24[a8_0x34fa('0x1a')]);const _0x4aabdb=new error_reporter_api_1['ErrorReporterApi'](_0x47cd24);const _0x4e51da=new file_storage_1[(a8_0x34fa('0x1'))](_0x835510,_0x4aabdb,!![],![]);const _0x10b07b=new Cache(_0x47cd24);const _0x325e62=new distributed_execution_api_1[(a8_0x34fa('0x35'))](_0x47cd24);attachSignalListenersToCompleteRunGroupOnError(_0x325e62,_0x524a53);try{const _0xdaa6fe=getTaskGraph(_0x38a11e,_0x1c7872,_0x47cd24);const _0x501892=yield runDistributedExecution(_0x325e62,_0x47cd24,_0x38a11e,_0x4e51da,_0x10b07b,_0x524a53,_0xdaa6fe);if(_0x501892[a8_0x34fa('0x43')]===0x0){output['success']({'title':a8_0x34fa('0x14'),'bodyLines':[a8_0x34fa('0x2')+_0x501892[a8_0x34fa('0x13')]]});}else{output[a8_0x34fa('0x41')]({'title':'Command\x20execution\x20failed.','bodyLines':[a8_0x34fa('0x2')+_0x501892[a8_0x34fa('0x13')]]});}yield(0x0,metric_logger_1[a8_0x34fa('0x16')])(_0x47cd24);process[a8_0x34fa('0x32')](_0x501892[a8_0x34fa('0x43')]);}catch(_0x2c37be){output[a8_0x34fa('0x41')]({'title':a8_0x34fa('0x29'),'bodyLines':[_0x2c37be[a8_0x34fa('0x4f')]]});if(_0x2c37be[a8_0x34fa('0x44')]){console['log'](_0x2c37be[a8_0x34fa('0x44')]);}else{console[a8_0x34fa('0x59')](_0x2c37be);}try{yield _0x325e62[a8_0x34fa('0x57')](_0x524a53,'Main\x20job\x20terminated\x20with\x20an\x20error:\x20\x22'+_0x2c37be['message']+'\x22');}finally{process[a8_0x34fa('0x32')](0x1);}}});exports['nxCloudDistributedTasksRunner']=nxCloudDistributedTasksRunner;function getTaskGraph(_0x5155e3,_0x55b478,_0x97611f){if(_0x5155e3[a8_0x34fa('0xb')]){return _0x5155e3['taskGraph'];}else{const _0x33f85f=JSON[a8_0x34fa('0x28')](stripJsonComments((0x0,fs_1[a8_0x34fa('0x45')])(workspaceRoot+a8_0x34fa('0x60'))[a8_0x34fa('0x34')]()));return new task_graph_creator_1[(a8_0x34fa('0x4b'))](_0x5155e3[a8_0x34fa('0x3e')],getDefaultDependencyConfigs(_0x33f85f,_0x97611f))[a8_0x34fa('0x53')](_0x55b478);}}function getDefaultDependencyConfigs(_0x5f5d56,_0x488eb0){var _0x564338,_0x4c6761;const _0x55921f=(_0x564338=_0x5f5d56[a8_0x34fa('0x4')])!==null&&_0x564338!==void 0x0?_0x564338:{};const _0x129ae2=_0x488eb0?(_0x4c6761=_0x488eb0['strictlyOrderedTargets'])!==null&&_0x4c6761!==void 0x0?_0x4c6761:[a8_0x34fa('0x38')]:[];for(const _0xcd6f6 of _0x129ae2){_0x55921f[_0xcd6f6]=_0x55921f[_0xcd6f6]||[];_0x55921f[_0xcd6f6][a8_0x34fa('0x24')]({'target':_0xcd6f6,'projects':a8_0x34fa('0x26')});}return _0x55921f;}
|
|
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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C/B,kBAAsC,EACtC,QAAgB,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>;
|