@nrwl/nx-cloud 14.5.0-beta.2 → 14.5.0
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 +1 -36
- package/lib/core/api/run-group.api.js +1 -68
- package/lib/core/commands/record-output.js +7 -2
- package/lib/core/commands/record-output.js.map +1 -1
- package/lib/core/commands/start-ci-run.js +2 -0
- package/lib/core/commands/start-ci-run.js.map +1 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +1 -156
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +1 -284
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +1 -113
- package/lib/core/runners/cloud-enabled/cloud-run.api.js +1 -167
- package/lib/core/runners/cloud-enabled/id-generator.js +1 -16
- package/lib/core/runners/distributed-agent/distributed-agent.api.js +1 -79
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js +1 -263
- package/lib/core/runners/distributed-execution/distributed-execution.api.js +1 -143
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js +1 -220
- 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/package.json +1 -1
|
@@ -1,36 +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.ErrorReporterApi = void 0;
|
|
13
|
-
const axios_1 = require("../../utilities/axios");
|
|
14
|
-
const { output } = require('../../utilities/nx-imports');
|
|
15
|
-
class ErrorReporterApi {
|
|
16
|
-
constructor(options) {
|
|
17
|
-
this.apiAxiosInstance = (0, axios_1.createApiAxiosInstance)(options);
|
|
18
|
-
}
|
|
19
|
-
reportError(message) {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
try {
|
|
22
|
-
yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/report-client-error', {
|
|
23
|
-
message,
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
output.warn({
|
|
28
|
-
title: `Unable to record the following error: '${message}'`,
|
|
29
|
-
bodyLines: [e.message],
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.ErrorReporterApi = ErrorReporterApi;
|
|
36
|
-
//# sourceMappingURL=error-reporter.api.js.map
|
|
1
|
+
const a0_0x2315=['__esModule','reportError','done','../../utilities/axios','Unable\x20to\x20record\x20the\x20following\x20error:\x20\x27','ErrorReporterApi','then','message','value','/nx-cloud/report-client-error','../../utilities/nx-imports','__awaiter','next','apply','throw','apiAxiosInstance','axiosMultipleTries'];(function(_0x5107c9,_0x2315ad){const _0x7edd18=function(_0x3635b8){while(--_0x3635b8){_0x5107c9['push'](_0x5107c9['shift']());}};_0x7edd18(++_0x2315ad);}(a0_0x2315,0x1b8));const a0_0x7edd=function(_0x5107c9,_0x2315ad){_0x5107c9=_0x5107c9-0x0;let _0x7edd18=a0_0x2315[_0x5107c9];return _0x7edd18;};'use strict';var __awaiter=this&&this[a0_0x7edd('0xd')]||function(_0x525481,_0x51c3a1,_0x182ac5,_0x317d96){function _0x252be6(_0x94f6ed){return _0x94f6ed instanceof _0x182ac5?_0x94f6ed:new _0x182ac5(function(_0x310337){_0x310337(_0x94f6ed);});}return new(_0x182ac5||(_0x182ac5=Promise))(function(_0x262db0,_0x2ef727){function _0x5ad2ff(_0x268147){try{_0x26e0ca(_0x317d96['next'](_0x268147));}catch(_0x383649){_0x2ef727(_0x383649);}}function _0x2fdda1(_0x59e99d){try{_0x26e0ca(_0x317d96[a0_0x7edd('0x10')](_0x59e99d));}catch(_0x277ccf){_0x2ef727(_0x277ccf);}}function _0x26e0ca(_0x1fa1cb){_0x1fa1cb[a0_0x7edd('0x4')]?_0x262db0(_0x1fa1cb[a0_0x7edd('0xa')]):_0x252be6(_0x1fa1cb[a0_0x7edd('0xa')])[a0_0x7edd('0x8')](_0x5ad2ff,_0x2fdda1);}_0x26e0ca((_0x317d96=_0x317d96[a0_0x7edd('0xf')](_0x525481,_0x51c3a1||[]))[a0_0x7edd('0xe')]());});};Object['defineProperty'](exports,a0_0x7edd('0x2'),{'value':!![]});exports[a0_0x7edd('0x7')]=void 0x0;const axios_1=require(a0_0x7edd('0x5'));const {output}=require(a0_0x7edd('0xc'));class ErrorReporterApi{constructor(_0x50c0d2){this[a0_0x7edd('0x0')]=(0x0,axios_1['createApiAxiosInstance'])(_0x50c0d2);}[a0_0x7edd('0x3')](_0x585664){return __awaiter(this,void 0x0,void 0x0,function*(){try{yield(0x0,axios_1[a0_0x7edd('0x1')])(()=>this[a0_0x7edd('0x0')]['post'](a0_0x7edd('0xb'),{'message':_0x585664}));}catch(_0x51b069){output['warn']({'title':a0_0x7edd('0x6')+_0x585664+'\x27','bodyLines':[_0x51b069[a0_0x7edd('0x9')]]});}});}}exports[a0_0x7edd('0x7')]=ErrorReporterApi;
|
|
@@ -1,68 +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.RunGroupApi = void 0;
|
|
13
|
-
const axios_1 = require("../../utilities/axios");
|
|
14
|
-
const metric_logger_1 = require("../../utilities/metric-logger");
|
|
15
|
-
const { output } = require('../../utilities/nx-imports');
|
|
16
|
-
class RunGroupApi {
|
|
17
|
-
constructor(options) {
|
|
18
|
-
this.apiAxiosInstance = (0, axios_1.createApiAxiosInstance)(options);
|
|
19
|
-
}
|
|
20
|
-
createRunGroup(branch, runGroup, stopAgentsOnFailure, agentCount, stopAgentsAfter) {
|
|
21
|
-
var _a;
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const recorder = (0, metric_logger_1.createMetricRecorder)('createRunGroup');
|
|
24
|
-
try {
|
|
25
|
-
const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/create-run-group', {
|
|
26
|
-
branch,
|
|
27
|
-
runGroup,
|
|
28
|
-
stopAgentsOnFailure,
|
|
29
|
-
agentCount,
|
|
30
|
-
stopAgentsAfter,
|
|
31
|
-
}));
|
|
32
|
-
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
33
|
-
}
|
|
34
|
-
catch (e) {
|
|
35
|
-
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
36
|
-
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
37
|
-
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
38
|
-
output.error({
|
|
39
|
-
title: e.message,
|
|
40
|
-
});
|
|
41
|
-
process.exit(1);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
completeRunGroup(runGroup) {
|
|
46
|
-
var _a;
|
|
47
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
const recorder = (0, metric_logger_1.createMetricRecorder)('createRunGroup');
|
|
49
|
-
try {
|
|
50
|
-
const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/complete-run-group', {
|
|
51
|
-
runGroup: runGroup,
|
|
52
|
-
}));
|
|
53
|
-
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
54
|
-
}
|
|
55
|
-
catch (e) {
|
|
56
|
-
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
57
|
-
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
58
|
-
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
59
|
-
output.error({
|
|
60
|
-
title: e.message,
|
|
61
|
-
});
|
|
62
|
-
process.exit(1);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.RunGroupApi = RunGroupApi;
|
|
68
|
-
//# sourceMappingURL=run-group.api.js.map
|
|
1
|
+
const a1_0x5641=['mapRespToPerfEntry','exit','response','../../utilities/nx-imports','/nx-cloud/executions/create-run-group','apply','axiosMultipleTries','completeRunGroup','defineProperty','createRunGroup','createApiAxiosInstance','createMetricRecorder','message','next','../../utilities/metric-logger','apiAxiosInstance','post','RUNNER_FAILURE_PERF_ENTRY','error','__esModule','../../utilities/axios','axiosException','RunGroupApi','value','__awaiter','done','recordMetric','then'];(function(_0xd5d1e,_0x564185){const _0x3ce1a4=function(_0x88b601){while(--_0x88b601){_0xd5d1e['push'](_0xd5d1e['shift']());}};_0x3ce1a4(++_0x564185);}(a1_0x5641,0x67));const a1_0x3ce1=function(_0xd5d1e,_0x564185){_0xd5d1e=_0xd5d1e-0x0;let _0x3ce1a4=a1_0x5641[_0xd5d1e];return _0x3ce1a4;};'use strict';var __awaiter=this&&this[a1_0x3ce1('0x5')]||function(_0x18cca3,_0x13a7f7,_0x376fed,_0x36bdaa){function _0x29ca47(_0x4442af){return _0x4442af instanceof _0x376fed?_0x4442af:new _0x376fed(function(_0x6036c3){_0x6036c3(_0x4442af);});}return new(_0x376fed||(_0x376fed=Promise))(function(_0x4cf0d1,_0x59dccc){function _0x2a7119(_0x51139f){try{_0x1a6845(_0x36bdaa[a1_0x3ce1('0x16')](_0x51139f));}catch(_0x4c6788){_0x59dccc(_0x4c6788);}}function _0x2c63df(_0x975ab5){try{_0x1a6845(_0x36bdaa['throw'](_0x975ab5));}catch(_0x3f8fe4){_0x59dccc(_0x3f8fe4);}}function _0x1a6845(_0x21e11a){_0x21e11a[a1_0x3ce1('0x6')]?_0x4cf0d1(_0x21e11a[a1_0x3ce1('0x4')]):_0x29ca47(_0x21e11a['value'])[a1_0x3ce1('0x8')](_0x2a7119,_0x2c63df);}_0x1a6845((_0x36bdaa=_0x36bdaa[a1_0x3ce1('0xe')](_0x18cca3,_0x13a7f7||[]))[a1_0x3ce1('0x16')]());});};Object[a1_0x3ce1('0x11')](exports,a1_0x3ce1('0x0'),{'value':!![]});exports['RunGroupApi']=void 0x0;const axios_1=require(a1_0x3ce1('0x1'));const metric_logger_1=require(a1_0x3ce1('0x17'));const {output}=require(a1_0x3ce1('0xc'));class RunGroupApi{constructor(_0x17f29f){this[a1_0x3ce1('0x18')]=(0x0,axios_1[a1_0x3ce1('0x13')])(_0x17f29f);}['createRunGroup'](_0x21e4fe,_0x5a97cc,_0x21822f,_0x2a02d8,_0x381138){var _0xba6511;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x905226=(0x0,metric_logger_1['createMetricRecorder'])(a1_0x3ce1('0x12'));try{const _0x3dc325=yield(0x0,axios_1[a1_0x3ce1('0xf')])(()=>this[a1_0x3ce1('0x18')]['post'](a1_0x3ce1('0xd'),{'branch':_0x21e4fe,'runGroup':_0x5a97cc,'stopAgentsOnFailure':_0x21822f,'agentCount':_0x2a02d8,'stopAgentsAfter':_0x381138}));_0x905226[a1_0x3ce1('0x7')]((0x0,metric_logger_1[a1_0x3ce1('0x9')])(_0x3dc325));}catch(_0x59706d){_0x905226[a1_0x3ce1('0x7')](((_0xba6511=_0x59706d===null||_0x59706d===void 0x0?void 0x0:_0x59706d['axiosException'])===null||_0xba6511===void 0x0?void 0x0:_0xba6511[a1_0x3ce1('0xb')])?(0x0,metric_logger_1['mapRespToPerfEntry'])(_0x59706d[a1_0x3ce1('0x2')][a1_0x3ce1('0xb')]):metric_logger_1[a1_0x3ce1('0x1a')]);output[a1_0x3ce1('0x1b')]({'title':_0x59706d['message']});process[a1_0x3ce1('0xa')](0x1);}});}[a1_0x3ce1('0x10')](_0x4315bc){var _0x69a9f6;return __awaiter(this,void 0x0,void 0x0,function*(){const _0xbf5053=(0x0,metric_logger_1[a1_0x3ce1('0x14')])(a1_0x3ce1('0x12'));try{const _0x559b70=yield(0x0,axios_1[a1_0x3ce1('0xf')])(()=>this[a1_0x3ce1('0x18')][a1_0x3ce1('0x19')]('/nx-cloud/executions/complete-run-group',{'runGroup':_0x4315bc}));_0xbf5053['recordMetric']((0x0,metric_logger_1[a1_0x3ce1('0x9')])(_0x559b70));}catch(_0x38a7ca){_0xbf5053[a1_0x3ce1('0x7')](((_0x69a9f6=_0x38a7ca===null||_0x38a7ca===void 0x0?void 0x0:_0x38a7ca['axiosException'])===null||_0x69a9f6===void 0x0?void 0x0:_0x69a9f6[a1_0x3ce1('0xb')])?(0x0,metric_logger_1[a1_0x3ce1('0x9')])(_0x38a7ca[a1_0x3ce1('0x2')][a1_0x3ce1('0xb')]):metric_logger_1[a1_0x3ce1('0x1a')]);output['error']({'title':_0x38a7ca[a1_0x3ce1('0x15')]});process[a1_0x3ce1('0xa')](0x1);}});}}exports[a1_0x3ce1('0x3')]=RunGroupApi;
|
|
@@ -17,12 +17,14 @@ const util_1 = require("util");
|
|
|
17
17
|
const zlib_1 = require("zlib");
|
|
18
18
|
const output_obfuscator_1 = require("../terminal-output/output-obfuscator");
|
|
19
19
|
const print_message_1 = require("../../utilities/print-message");
|
|
20
|
+
const distributed_execution_api_1 = require("../runners/distributed-execution/distributed-execution.api");
|
|
20
21
|
const { output, workspaceRoot } = require('../../utilities/nx-imports');
|
|
21
22
|
const MAX_CHARACTERS_OUTPUT_CAPTURE = 200000;
|
|
22
23
|
function runCommandAndStoreInCloud() {
|
|
23
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
25
|
const taskRunnerOptions = getTaskRunnerOptions();
|
|
25
26
|
const axios = (0, axios_1.createApiAxiosInstance)(taskRunnerOptions);
|
|
27
|
+
const dteApi = new distributed_execution_api_1.DistributedExecutionApi(taskRunnerOptions);
|
|
26
28
|
const outputObfuscator = new output_obfuscator_1.OutputObfuscator(taskRunnerOptions.maskedProperties);
|
|
27
29
|
const branch = (0, environment_1.getBranch)();
|
|
28
30
|
const runGroup = (0, environment_1.getRunGroup)();
|
|
@@ -40,7 +42,7 @@ function runCommandAndStoreInCloud() {
|
|
|
40
42
|
branch,
|
|
41
43
|
runGroup,
|
|
42
44
|
};
|
|
43
|
-
yield endRecordOutputRun(axios, outputObfuscator, taskRunnerOptions, endRecordOutputRunParams);
|
|
45
|
+
yield endRecordOutputRun(axios, outputObfuscator, taskRunnerOptions, endRecordOutputRunParams, dteApi);
|
|
44
46
|
process.exit(statusCode);
|
|
45
47
|
});
|
|
46
48
|
}
|
|
@@ -117,7 +119,7 @@ function createTaskDefinitionFromUserCommand(outputObfuscator, params) {
|
|
|
117
119
|
terminalOutput: truncatedOutput,
|
|
118
120
|
};
|
|
119
121
|
}
|
|
120
|
-
function endRecordOutputRun(axios, obfuscator, taskRunnerOptions, params) {
|
|
122
|
+
function endRecordOutputRun(axios, obfuscator, taskRunnerOptions, params, dteApi) {
|
|
121
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
122
124
|
const commandWithPrefix = `nx-cloud record -- ${params.userCommandAndArgsString}`;
|
|
123
125
|
const endRunReq = {
|
|
@@ -146,6 +148,9 @@ function endRecordOutputRun(axios, obfuscator, taskRunnerOptions, params) {
|
|
|
146
148
|
if (process.env.NX_CLOUD_SILENT_RECORD !== 'true') {
|
|
147
149
|
printRecordOutputRunEndMessage(endRunResp.data.runUrl);
|
|
148
150
|
}
|
|
151
|
+
if (params.statusCode !== 0 && params.runGroup) {
|
|
152
|
+
yield dteApi.completeRunGroupWithError(params.runGroup, `Command "${params.userCommandAndArgsString}" failed.`);
|
|
153
|
+
}
|
|
149
154
|
});
|
|
150
155
|
}
|
|
151
156
|
function printRecordOutputRunEndMessage(runUrl) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-output.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/commands/record-output.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAoC;AACpC,6DAKqC;AAErC,iDAG+B;AAC/B,+BAAiC;AACjC,+BAA4B;AAE5B,4EAAwE;AACxE,iEAA6D;
|
|
1
|
+
{"version":3,"file":"record-output.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/commands/record-output.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAoC;AACpC,6DAKqC;AAErC,iDAG+B;AAC/B,+BAAiC;AACjC,+BAA4B;AAE5B,4EAAwE;AACxE,iEAA6D;AAC7D,0GAAqG;AAErG,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAYxE,MAAM,6BAA6B,GAAG,MAAO,CAAC;AAE9C,SAAsB,yBAAyB;;QAC7C,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;QACjD,MAAM,KAAK,GAA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AC,QAAQ,CAAC,OAAO,KACzB,kBAAkB,EAAE,MAAM,EAC1B,cAAc,EAAE,0BAA0B,GAC3C;SACF,CAAC,CACH,CAAC;QACF,IAAI,OAAO,CAAC,GAAG,CAAC,sBAAsB,KAAK,MAAM,EAAE;YACjD,8BAA8B,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACxD;QAED,IAAI,MAAM,CAAC,UAAU,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE;YAC9C,MAAM,MAAM,CAAC,yBAAyB,CACpC,MAAM,CAAC,QAAQ,EACf,YAAY,MAAM,CAAC,wBAAwB,WAAW,CACvD,CAAC;SACH;IACH,CAAC;CAAA;AAED,SAAS,8BAA8B,CAAC,MAAc;IACpD,MAAM,CAAC,oBAAoB,EAAE,CAAC;IAC9B,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,gDAAgD,EAAE,CAAC,CAAC;IACzE,IAAA,4BAAY,EAAC,iDAAiD,MAAM,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,0DAA0D;AAC1D,kDAAkD;AAClD;;;;GAIG;AACH,SAAS,YAAY,CAAC,MAAc;IAClC,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,GAAG,GAAG,CAAC,CAAC;IACxC,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,GAAG,GAAG,CAAC,CAAC;IACxC,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,GAAG,GAAG,EAAE,CAAC;IAC1C,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -16,6 +16,7 @@ const print_run_group_error_1 = require("../error/print-run-group-error");
|
|
|
16
16
|
const run_group_api_1 = require("../api/run-group.api");
|
|
17
17
|
const fs_1 = require("fs");
|
|
18
18
|
const yargsParser = require("yargs-parser");
|
|
19
|
+
const distributed_task_execution_detection_1 = require("../../utilities/distributed-task-execution-detection");
|
|
19
20
|
const { output, workspaceRoot } = require('../../utilities/nx-imports');
|
|
20
21
|
const args = yargsParser(process.argv, {
|
|
21
22
|
boolean: ['stop-agents-on-failure'],
|
|
@@ -48,6 +49,7 @@ function startCiRun() {
|
|
|
48
49
|
const options = JSON.parse(stripJsonComments((0, fs_1.readFileSync)(`${workspaceRoot}/nx.json`).toString())).tasksRunnerOptions.default.options;
|
|
49
50
|
const api = new run_group_api_1.RunGroupApi(options);
|
|
50
51
|
yield api.createRunGroup(branch, runGroup, args.stopAgentsOnFailure, args.agentCount, args.stopAgentsAfter);
|
|
52
|
+
(0, distributed_task_execution_detection_1.storeMarker)();
|
|
51
53
|
});
|
|
52
54
|
}
|
|
53
55
|
exports.startCiRun = startCiRun;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start-ci-run.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/commands/start-ci-run.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyD;AACzD,6DAIqC;AACrC,0EAAoE;AACpE,wDAAmD;AACnD,2BAAkC;AAClC,4CAA4C;
|
|
1
|
+
{"version":3,"file":"start-ci-run.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/commands/start-ci-run.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyD;AACzD,6DAIqC;AACrC,0EAAoE;AACpE,wDAAmD;AACnD,2BAAkC;AAClC,4CAA4C;AAC5C,+GAAmF;AAEnF,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AACxE,MAAM,IAAI,GAAQ,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE;IAC1C,OAAO,EAAE,CAAC,wBAAwB,CAAC;IACnC,MAAM,EAAE,CAAC,aAAa,EAAE,eAAe,CAAC;IACxC,MAAM,EAAE,CAAC,mBAAmB,CAAC;CAC9B,CAAC,CAAC;AAEH,SAAsB,UAAU;;QAC9B,MAAM,MAAM,GAAG,IAAA,uBAAS,GAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,IAAA,yBAAW,GAAE,CAAC;QAE/B,IAAI,CAAC,QAAQ,EAAE;YACb,IAAA,0CAAkB,GAAE,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;QAED,IAAI,6BAAe,EAAE;YACnB,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,sBAAsB,QAAQ,EAAE;aACxC,CAAC,CAAC;SACJ;QAED,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,kEAAkE;SACnE;QAED,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,MAAM,CAAC,KAAK,CAAC;gBACX,KAAK,EAAE,iEAAiE;gBACxE,SAAS,EAAE,CAAC,2DAA2D,CAAC;aACzE,CAAC,CAAC;YACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CACxB,iBAAiB,CAAC,IAAA,iBAAY,EAAC,GAAG,aAAa,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC,CACvE,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC;QAErC,MAAM,GAAG,GAAG,IAAI,2BAAW,CAAC,OAAO,CAAC,CAAC;QACrC,MAAM,GAAG,CAAC,cAAc,CACtB,MAAM,EACN,QAAQ,EACR,IAAI,CAAC,mBAAmB,EACxB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,eAAe,CACrB,CAAC;QACF,IAAA,kDAAW,GAAE,CAAC;IAChB,CAAC;CAAA;AAxCD,gCAwCC"}
|
|
@@ -1,156 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CloudEnabledLifeCycle = void 0;
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const fs_1 = require("fs");
|
|
7
|
-
const environment_1 = require("../../../utilities/environment");
|
|
8
|
-
const serializer_overrides_1 = require("../../../utilities/serializer-overrides");
|
|
9
|
-
const { workspaceRoot } = require('../../../utilities/nx-imports');
|
|
10
|
-
class CloudEnabledLifeCycle {
|
|
11
|
-
constructor(runContext, cacheDirectory, skipNxCache, collectTerminalOutput, cacheableOperations, outputObfuscator, tasks) {
|
|
12
|
-
this.runContext = runContext;
|
|
13
|
-
this.cacheDirectory = cacheDirectory;
|
|
14
|
-
this.skipNxCache = skipNxCache;
|
|
15
|
-
this.collectTerminalOutput = collectTerminalOutput;
|
|
16
|
-
this.cacheableOperations = cacheableOperations;
|
|
17
|
-
this.outputObfuscator = outputObfuscator;
|
|
18
|
-
this.tasks = tasks;
|
|
19
|
-
}
|
|
20
|
-
scheduleTask(task) {
|
|
21
|
-
this.runContext.scheduledTasks.push(task);
|
|
22
|
-
}
|
|
23
|
-
startTask(task) {
|
|
24
|
-
this.tasks.push({
|
|
25
|
-
taskId: task.id,
|
|
26
|
-
startTime: new Date().toISOString(),
|
|
27
|
-
target: task.target.target,
|
|
28
|
-
projectName: task.target.project,
|
|
29
|
-
hash: task.hash,
|
|
30
|
-
hashDetails: this.cleanUpHashDetails(task.hashDetails),
|
|
31
|
-
params: (0, serializer_overrides_1.serializeOverrides)(task),
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
// Used for older version for Nx. Remove in Dec 2022
|
|
35
|
-
endTask(task, code) {
|
|
36
|
-
let cacheStatus;
|
|
37
|
-
if (this.runContext.statuses[task.hash]) {
|
|
38
|
-
cacheStatus = this.runContext.statuses[task.hash];
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
if (this.cacheableOperations.indexOf(task.target.target) > -1 &&
|
|
42
|
-
!this.skipNxCache) {
|
|
43
|
-
cacheStatus = 'local-cache-hit';
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
cacheStatus = 'cache-miss';
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
this.updateStartedTask(task, code, cacheStatus);
|
|
50
|
-
}
|
|
51
|
-
endTasks(tasks) {
|
|
52
|
-
for (let t of tasks) {
|
|
53
|
-
let cacheStatus;
|
|
54
|
-
const taskIsRemoteCacheHit = t.status === 'remote-cache';
|
|
55
|
-
const taskIsLocalCacheHitPreNx135 = t.status === 'cache';
|
|
56
|
-
const taskIsLocalCacheHit = t.status === 'local-cache' ||
|
|
57
|
-
t.status === 'local-cache-kept-existing' ||
|
|
58
|
-
taskIsLocalCacheHitPreNx135;
|
|
59
|
-
if (this.runContext.statuses[t.task.hash]) {
|
|
60
|
-
cacheStatus = this.runContext.statuses[t.task.hash];
|
|
61
|
-
}
|
|
62
|
-
else if (taskIsRemoteCacheHit) {
|
|
63
|
-
cacheStatus = 'remote-cache-hit';
|
|
64
|
-
}
|
|
65
|
-
else if (taskIsLocalCacheHit) {
|
|
66
|
-
cacheStatus = 'local-cache-hit';
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
if (this.cacheableOperations.indexOf(t.task.target.target) > -1 &&
|
|
70
|
-
!this.skipNxCache) {
|
|
71
|
-
cacheStatus = 'local-cache-hit';
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
cacheStatus = 'cache-miss';
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
this.updateStartedTask(t.task, t.code, cacheStatus);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
endCommand() { }
|
|
81
|
-
updateStartedTask(task, code, cacheStatus) {
|
|
82
|
-
const startedTask = this.tasks.find((t) => t.taskId === task.id);
|
|
83
|
-
if (!startedTask) {
|
|
84
|
-
throw new Error(`Cannot find task ${task.id}`);
|
|
85
|
-
}
|
|
86
|
-
startedTask.endTime = new Date().toISOString();
|
|
87
|
-
startedTask.status = code;
|
|
88
|
-
startedTask.params = this.outputObfuscator.obfuscate(startedTask.params);
|
|
89
|
-
startedTask.cacheStatus = cacheStatus;
|
|
90
|
-
if (this.collectTerminalOutput) {
|
|
91
|
-
startedTask.terminalOutput = this.getTerminalOutput(task.hash, startedTask.cacheStatus, code);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
getTerminalOutput(hash, cacheStatus, code) {
|
|
95
|
-
let dir;
|
|
96
|
-
if (this.cacheDirectory) {
|
|
97
|
-
if (this.cacheDirectory.startsWith('./')) {
|
|
98
|
-
dir = (0, path_1.join)(workspaceRoot, this.cacheDirectory);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
dir = this.cacheDirectory;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
dir = (0, path_1.join)(workspaceRoot, 'node_modules', '.cache', 'nx');
|
|
106
|
-
}
|
|
107
|
-
try {
|
|
108
|
-
const taskOutput = this.readTerminalOutputFile(dir, hash);
|
|
109
|
-
const taskOutputSanitized = this.outputObfuscator.obfuscate(taskOutput);
|
|
110
|
-
if (environment_1.NX_CLOUD_UNLIMITED_OUTPUT)
|
|
111
|
-
return taskOutputSanitized;
|
|
112
|
-
const maxCharacters = cacheStatus === 'cache-miss'
|
|
113
|
-
? code === 0
|
|
114
|
-
? CloudEnabledLifeCycle.MAX_CHARACTERS_SUCCESSFUL_TASK
|
|
115
|
-
: CloudEnabledLifeCycle.MAX_CHARACTERS_FAILED_TASK
|
|
116
|
-
: CloudEnabledLifeCycle.MAX_CHARACTERS_CACHED_TASK;
|
|
117
|
-
return taskOutputSanitized.length > maxCharacters
|
|
118
|
-
? `TRUNCATED\n\n${taskOutputSanitized.slice(taskOutputSanitized.length - maxCharacters)}`
|
|
119
|
-
: taskOutputSanitized;
|
|
120
|
-
}
|
|
121
|
-
catch (e) {
|
|
122
|
-
return '';
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
cleanUpHashDetails(hashDetails) {
|
|
126
|
-
const nodes = {};
|
|
127
|
-
Object.keys(hashDetails.nodes)
|
|
128
|
-
.filter((k) => !k.startsWith('npm:'))
|
|
129
|
-
.forEach((k) => {
|
|
130
|
-
nodes[k] = hashDetails.nodes[k];
|
|
131
|
-
});
|
|
132
|
-
return {
|
|
133
|
-
nodes,
|
|
134
|
-
runtime: hashDetails.runtime,
|
|
135
|
-
implicitDeps: hashDetails.implicitDeps,
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
readTerminalOutputFile(dir, hash) {
|
|
139
|
-
try {
|
|
140
|
-
return (0, fs_1.readFileSync)(path.join(dir, 'terminalOutputs', hash)).toString();
|
|
141
|
-
}
|
|
142
|
-
catch (_a) {
|
|
143
|
-
try {
|
|
144
|
-
return (0, fs_1.readFileSync)(path.join(dir, hash, 'terminalOutput')).toString();
|
|
145
|
-
}
|
|
146
|
-
catch (_b) {
|
|
147
|
-
return '';
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
exports.CloudEnabledLifeCycle = CloudEnabledLifeCycle;
|
|
153
|
-
CloudEnabledLifeCycle.MAX_CHARACTERS_FAILED_TASK = 200000;
|
|
154
|
-
CloudEnabledLifeCycle.MAX_CHARACTERS_SUCCESSFUL_TASK = 20000;
|
|
155
|
-
CloudEnabledLifeCycle.MAX_CHARACTERS_CACHED_TASK = 20000;
|
|
156
|
-
//# sourceMappingURL=cloud-enabled-life-cycle.js.map
|
|
1
|
+
const a0_0x2a0a=['MAX_CHARACTERS_FAILED_TASK','../../../utilities/nx-imports','scheduledTasks','task','obfuscate','remote-cache-hit','statuses','length','local-cache-hit','outputObfuscator','endTask','find','status','tasks','cacheDirectory','runContext','keys','serializeOverrides','params','MAX_CHARACTERS_SUCCESSFUL_TASK','hashDetails','skipNxCache','cache','terminalOutput','taskId','cleanUpHashDetails','cache-miss','terminalOutputs','push','indexOf','CloudEnabledLifeCycle','endCommand','npm:','cacheStatus','hash','.cache','slice','join','project','startsWith','endTasks','toISOString','__esModule','cacheableOperations','remote-cache','TRUNCATED\x0a\x0a','path','target','updateStartedTask','readTerminalOutputFile','collectTerminalOutput','readFileSync','MAX_CHARACTERS_CACHED_TASK','forEach','Cannot\x20find\x20task\x20','nodes','../../../utilities/environment','local-cache','getTerminalOutput'];(function(_0x4038a2,_0x2a0a69){const _0x3be34f=function(_0x5dd5c7){while(--_0x5dd5c7){_0x4038a2['push'](_0x4038a2['shift']());}};_0x3be34f(++_0x2a0a69);}(a0_0x2a0a,0x172));const a0_0x3be3=function(_0x4038a2,_0x2a0a69){_0x4038a2=_0x4038a2-0x0;let _0x3be34f=a0_0x2a0a[_0x4038a2];return _0x3be34f;};'use strict';Object['defineProperty'](exports,a0_0x3be3('0x1a'),{'value':!![]});exports[a0_0x3be3('0xe')]=void 0x0;const path=require('path');const path_1=require(a0_0x3be3('0x1e'));const fs_1=require('fs');const environment_1=require(a0_0x3be3('0x28'));const serializer_overrides_1=require('../../../utilities/serializer-overrides');const {workspaceRoot}=require(a0_0x3be3('0x2c'));class CloudEnabledLifeCycle{constructor(_0x5713a1,_0x214784,_0x2fdc03,_0x447130,_0x5d2950,_0x1b4e39,_0x117335){this['runContext']=_0x5713a1;this['cacheDirectory']=_0x214784;this[a0_0x3be3('0x5')]=_0x2fdc03;this['collectTerminalOutput']=_0x447130;this[a0_0x3be3('0x1b')]=_0x5d2950;this[a0_0x3be3('0x34')]=_0x1b4e39;this[a0_0x3be3('0x38')]=_0x117335;}['scheduleTask'](_0x4cd760){this[a0_0x3be3('0x3a')][a0_0x3be3('0x2d')][a0_0x3be3('0xc')](_0x4cd760);}['startTask'](_0x23d8d0){this[a0_0x3be3('0x38')]['push']({'taskId':_0x23d8d0['id'],'startTime':new Date()[a0_0x3be3('0x19')](),'target':_0x23d8d0[a0_0x3be3('0x1f')][a0_0x3be3('0x1f')],'projectName':_0x23d8d0[a0_0x3be3('0x1f')][a0_0x3be3('0x16')],'hash':_0x23d8d0['hash'],'hashDetails':this[a0_0x3be3('0x9')](_0x23d8d0[a0_0x3be3('0x4')]),'params':(0x0,serializer_overrides_1[a0_0x3be3('0x1')])(_0x23d8d0)});}[a0_0x3be3('0x35')](_0xa36a7d,_0x45df29){let _0x3e2eda;if(this['runContext'][a0_0x3be3('0x31')][_0xa36a7d[a0_0x3be3('0x12')]]){_0x3e2eda=this[a0_0x3be3('0x3a')][a0_0x3be3('0x31')][_0xa36a7d[a0_0x3be3('0x12')]];}else{if(this[a0_0x3be3('0x1b')][a0_0x3be3('0xd')](_0xa36a7d['target'][a0_0x3be3('0x1f')])>-0x1&&!this['skipNxCache']){_0x3e2eda=a0_0x3be3('0x33');}else{_0x3e2eda=a0_0x3be3('0xa');}}this[a0_0x3be3('0x20')](_0xa36a7d,_0x45df29,_0x3e2eda);}[a0_0x3be3('0x18')](_0x5eda9e){for(let _0x13ec90 of _0x5eda9e){let _0x2c6f8a;const _0x1e44f7=_0x13ec90['status']===a0_0x3be3('0x1c');const _0x5286b8=_0x13ec90[a0_0x3be3('0x37')]===a0_0x3be3('0x6');const _0x4105cc=_0x13ec90[a0_0x3be3('0x37')]===a0_0x3be3('0x29')||_0x13ec90['status']==='local-cache-kept-existing'||_0x5286b8;if(this['runContext']['statuses'][_0x13ec90[a0_0x3be3('0x2e')][a0_0x3be3('0x12')]]){_0x2c6f8a=this[a0_0x3be3('0x3a')][a0_0x3be3('0x31')][_0x13ec90[a0_0x3be3('0x2e')][a0_0x3be3('0x12')]];}else if(_0x1e44f7){_0x2c6f8a=a0_0x3be3('0x30');}else if(_0x4105cc){_0x2c6f8a=a0_0x3be3('0x33');}else{if(this[a0_0x3be3('0x1b')]['indexOf'](_0x13ec90[a0_0x3be3('0x2e')][a0_0x3be3('0x1f')][a0_0x3be3('0x1f')])>-0x1&&!this['skipNxCache']){_0x2c6f8a='local-cache-hit';}else{_0x2c6f8a=a0_0x3be3('0xa');}}this[a0_0x3be3('0x20')](_0x13ec90[a0_0x3be3('0x2e')],_0x13ec90['code'],_0x2c6f8a);}}[a0_0x3be3('0xf')](){}[a0_0x3be3('0x20')](_0x4e3a06,_0x1c0743,_0x3374f8){const _0x103113=this[a0_0x3be3('0x38')][a0_0x3be3('0x36')](_0x255473=>_0x255473[a0_0x3be3('0x8')]===_0x4e3a06['id']);if(!_0x103113){throw new Error(a0_0x3be3('0x26')+_0x4e3a06['id']);}_0x103113['endTime']=new Date()['toISOString']();_0x103113[a0_0x3be3('0x37')]=_0x1c0743;_0x103113['params']=this['outputObfuscator'][a0_0x3be3('0x2f')](_0x103113[a0_0x3be3('0x2')]);_0x103113[a0_0x3be3('0x11')]=_0x3374f8;if(this[a0_0x3be3('0x22')]){_0x103113[a0_0x3be3('0x7')]=this[a0_0x3be3('0x2a')](_0x4e3a06[a0_0x3be3('0x12')],_0x103113[a0_0x3be3('0x11')],_0x1c0743);}}[a0_0x3be3('0x2a')](_0xdef40e,_0x107112,_0x2f7af8){let _0x55ee12;if(this['cacheDirectory']){if(this[a0_0x3be3('0x39')][a0_0x3be3('0x17')]('./')){_0x55ee12=(0x0,path_1['join'])(workspaceRoot,this['cacheDirectory']);}else{_0x55ee12=this['cacheDirectory'];}}else{_0x55ee12=(0x0,path_1[a0_0x3be3('0x15')])(workspaceRoot,'node_modules',a0_0x3be3('0x13'),'nx');}try{const _0x2cfedd=this[a0_0x3be3('0x21')](_0x55ee12,_0xdef40e);const _0x5c7018=this[a0_0x3be3('0x34')][a0_0x3be3('0x2f')](_0x2cfedd);if(environment_1['NX_CLOUD_UNLIMITED_OUTPUT'])return _0x5c7018;const _0x292bea=_0x107112===a0_0x3be3('0xa')?_0x2f7af8===0x0?CloudEnabledLifeCycle[a0_0x3be3('0x3')]:CloudEnabledLifeCycle['MAX_CHARACTERS_FAILED_TASK']:CloudEnabledLifeCycle[a0_0x3be3('0x24')];return _0x5c7018[a0_0x3be3('0x32')]>_0x292bea?a0_0x3be3('0x1d')+_0x5c7018[a0_0x3be3('0x14')](_0x5c7018['length']-_0x292bea):_0x5c7018;}catch(_0x1a5fd5){return'';}}[a0_0x3be3('0x9')](_0x34940d){const _0x58b0ba={};Object[a0_0x3be3('0x0')](_0x34940d[a0_0x3be3('0x27')])['filter'](_0x3d8f76=>!_0x3d8f76['startsWith'](a0_0x3be3('0x10')))[a0_0x3be3('0x25')](_0x1c7906=>{_0x58b0ba[_0x1c7906]=_0x34940d[a0_0x3be3('0x27')][_0x1c7906];});return{'nodes':_0x58b0ba,'runtime':_0x34940d['runtime'],'implicitDeps':_0x34940d['implicitDeps']};}[a0_0x3be3('0x21')](_0x4d206b,_0x38f5ee){try{return(0x0,fs_1[a0_0x3be3('0x23')])(path[a0_0x3be3('0x15')](_0x4d206b,a0_0x3be3('0xb'),_0x38f5ee))['toString']();}catch(_0x1bd862){try{return(0x0,fs_1[a0_0x3be3('0x23')])(path[a0_0x3be3('0x15')](_0x4d206b,_0x38f5ee,a0_0x3be3('0x7')))['toString']();}catch(_0xef3d47){return'';}}}}exports[a0_0x3be3('0xe')]=CloudEnabledLifeCycle;CloudEnabledLifeCycle[a0_0x3be3('0x2b')]=0x30d40;CloudEnabledLifeCycle[a0_0x3be3('0x3')]=0x4e20;CloudEnabledLifeCycle[a0_0x3be3('0x24')]=0x4e20;
|