@nrwl/nx-cloud 15.0.1 → 15.0.2-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/bin/nx-cloud.js +7 -0
- package/bin/nx-cloud.js.map +1 -1
- package/lib/core/api/error-reporter.api.js +36 -1
- package/lib/core/api/run-group.api.js +68 -1
- package/lib/core/commands/upload-and-show-run-details.d.ts +1 -0
- package/lib/core/commands/upload-and-show-run-details.js +60 -0
- package/lib/core/commands/upload-and-show-run-details.js.map +1 -0
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.d.ts +0 -4
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +109 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js.map +1 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +288 -1
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +113 -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 +79 -1
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js +263 -1
- package/lib/core/runners/distributed-execution/distributed-execution.api.js +143 -1
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js +220 -1
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js +37 -1
- package/lib/core/runners/distributed-execution/task-graph-creator.js +77 -1
- package/lib/core/terminal-output/end-of-run-message.js +3 -3
- package/lib/core/terminal-output/end-of-run-message.js.map +1 -1
- package/lib/core/terminal-output/read-task-terminal-output.d.ts +2 -0
- package/lib/core/terminal-output/read-task-terminal-output.js +60 -0
- package/lib/core/terminal-output/read-task-terminal-output.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1,220 @@
|
|
|
1
|
-
const a8_0x43b4=['serializeOverrides','completedTasks','VERBOSE_LOGGING','Command\x20execution\x20failed.','criticalErrorMessage','../../../utilities/waiter','wait','../../../utilities/serializer-overrides','COMPLETED','No\x20new\x20completed\x20tasks\x20after\x20','addVerticalSeparator','../../../utilities/nx-imports','write','Main\x20job\x20was\x20terminated\x20via\x20SIGTERM','executionStatus:\x20','values','target','/nx.json','status','lifeCycle','Main\x20job\x20was\x20terminated\x20via\x20SIGINT','submitRunMetrics','createUnchangedValueTimeout','length','strictlyOrderedTargets','toString','configuration','terminalOutput','DistributedExecutionApi','Starting\x20distributed\x20command\x20execution','printRunGroupError','build','error','__esModule','./split-task-graph-into-stages','Extracting\x20artifacts','Main\x20job\x20terminated\x20with\x20an\x20error:\x20\x22','retrieve','url','hash','logCommand','readFileSync','error:\x20','TaskGraphCreator','taskGraph','nxCloudDistributedTasksRunner','startTask','run','../../file-storage/file-storage','then','NO_COMPLETED_TASKS_TIMEOUT','Error:','completeRunGroupWithError','runUrl','SIGINT','ENCRYPTION_KEY','../../api/error-reporter.api','Waiter','Successfully\x20completed\x20running\x20the\x20command.','Distributed\x20Execution\x20Terminated','createStartRequest','next','E2EEncryption','value','note','get','../../../utilities/metric-logger','taskId','ErrorReporterApi','./node_modules/.cache/nx','reset','See\x20run\x20details\x20at\x20','projectGraph','log','nodes','Processing\x20task\x20','commandStatus','apply','start','Unable\x20to\x20complete\x20a\x20run.','tasks','__awaiter','Found\x20unknown\x20task:\x20','targetDependencies','../../../utilities/create-unchanged-value-timeout','endTask','strip-json-comments','push','executionId:\x20','number\x20of\x20completed\x20tasks:\x20','createTaskGraph','./distributed-execution.api','splitTasksIntoStages','stdout','SIGTERM','executionStatus','assign','parse','done','success','Retrieving\x20artifacts\x20from\x20','getRunGroup','axiosException','scheduleTask','find','exit','project','message'];(function(_0xf5e480,_0x43b465){const _0x44d35b=function(_0x39846a){while(--_0x39846a){_0xf5e480['push'](_0xf5e480['shift']());}};_0x44d35b(++_0x43b465);}(a8_0x43b4,0xa4));const a8_0x44d3=function(_0xf5e480,_0x43b465){_0xf5e480=_0xf5e480-0x0;let _0x44d35b=a8_0x43b4[_0xf5e480];return _0x44d35b;};'use strict';var __awaiter=this&&this[a8_0x44d3('0x19')]||function(_0x5c10c5,_0x4c0845,_0x37b66e,_0x4d988d){function _0x4b0e2e(_0x57e049){return _0x57e049 instanceof _0x37b66e?_0x57e049:new _0x37b66e(function(_0x28b91d){_0x28b91d(_0x57e049);});}return new(_0x37b66e||(_0x37b66e=Promise))(function(_0x37cf5b,_0x2f59ca){function _0x4465cd(_0x4795ec){try{_0x3b5074(_0x4d988d[a8_0x44d3('0x5')](_0x4795ec));}catch(_0x2ec1da){_0x2f59ca(_0x2ec1da);}}function _0x546461(_0x141547){try{_0x3b5074(_0x4d988d['throw'](_0x141547));}catch(_0x400116){_0x2f59ca(_0x400116);}}function _0x3b5074(_0x44b8d1){_0x44b8d1[a8_0x44d3('0x2a')]?_0x37cf5b(_0x44b8d1[a8_0x44d3('0x7')]):_0x4b0e2e(_0x44b8d1[a8_0x44d3('0x7')])[a8_0x44d3('0x65')](_0x4465cd,_0x546461);}_0x3b5074((_0x4d988d=_0x4d988d[a8_0x44d3('0x15')](_0x5c10c5,_0x4c0845||[]))['next']());});};Object['defineProperty'](exports,a8_0x44d3('0x55'),{'value':!![]});exports[a8_0x44d3('0x61')]=void 0x0;const fs_1=require('fs');const stripJsonComments=require(a8_0x44d3('0x1e'));const create_unchanged_value_timeout_1=require(a8_0x44d3('0x1c'));const environment_1=require('../../../utilities/environment');const metric_logger_1=require(a8_0x44d3('0xa'));const serializer_overrides_1=require(a8_0x44d3('0x3b'));const waiter_1=require(a8_0x44d3('0x39'));const error_reporter_api_1=require(a8_0x44d3('0x0'));const print_run_group_error_1=require('../../error/print-run-group-error');const e2e_encryption_1=require('../../file-storage/e2e-encryption');const file_storage_1=require(a8_0x44d3('0x64'));const distributed_execution_api_1=require(a8_0x44d3('0x23'));const split_task_graph_into_stages_1=require(a8_0x44d3('0x56'));const task_graph_creator_1=require('./task-graph-creator');const {output,workspaceRoot,getOutputs,Cache}=require(a8_0x44d3('0x3f'));class NoopLifeCycle{[a8_0x44d3('0x2f')](_0x14052c){}[a8_0x44d3('0x62')](_0x55e008){}[a8_0x44d3('0x1d')](_0xe8df55,_0x4f2dec){}}function runDistributedExecution(_0x294a13,_0x37bf20,_0x484f93,_0x1b69fc,_0x1593fc,_0x12c0ef,_0xdc2f38){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x4963c7=yield _0x294a13[a8_0x44d3('0x16')]((0x0,distributed_execution_api_1[a8_0x44d3('0x4')])(_0x12c0ef,(0x0,split_task_graph_into_stages_1[a8_0x44d3('0x24')])(_0xdc2f38),_0x37bf20));return yield processTasks(_0x294a13,_0x1b69fc,_0x1593fc,_0x37bf20,_0x4963c7,Object[a8_0x44d3('0x43')](_0xdc2f38[a8_0x44d3('0x18')]),_0x484f93);});}function processTasks(_0x118f98,_0x491f60,_0x27fa8e,_0x5733cc,_0x262dc6,_0x81063b,_0x531478){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x25eef1={};const _0x3f9bb0=(0x0,create_unchanged_value_timeout_1[a8_0x44d3('0x4a')])({'title':a8_0x44d3('0x3d')+environment_1[a8_0x44d3('0x66')]/0x3e8+'\x20seconds.','timeout':environment_1['NO_COMPLETED_TASKS_TIMEOUT']});const _0x49cb61=new waiter_1[(a8_0x44d3('0x1'))]();while(!![]){if(environment_1[a8_0x44d3('0x36')]){output[a8_0x44d3('0x8')]({'title':'Waiting...'});}yield _0x49cb61[a8_0x44d3('0x3a')]();const _0x55e918=yield _0x118f98[a8_0x44d3('0x46')](_0x262dc6);if(environment_1[a8_0x44d3('0x36')]){output['note']({'title':'Status\x20update','bodyLines':[a8_0x44d3('0x20')+_0x262dc6,a8_0x44d3('0x42')+_0x55e918['executionStatus'],a8_0x44d3('0x21')+_0x55e918[a8_0x44d3('0x35')][a8_0x44d3('0x4b')],a8_0x44d3('0x5e')+_0x55e918[a8_0x44d3('0x38')]]});}if(_0x55e918[a8_0x44d3('0x38')]){output[a8_0x44d3('0x54')]({'title':a8_0x44d3('0x3'),'bodyLines':[a8_0x44d3('0x67'),_0x55e918[a8_0x44d3('0x38')]]});process[a8_0x44d3('0x31')](0x1);}_0x3f9bb0(_0x55e918['completedTasks'][a8_0x44d3('0x4b')]);for(const _0x1006d6 of _0x55e918[a8_0x44d3('0x35')]){if(_0x25eef1[_0x1006d6['taskId']])continue;yield processTask(_0x491f60,_0x27fa8e,_0x531478,_0x5733cc,_0x81063b,_0x1006d6);_0x49cb61[a8_0x44d3('0xe')]();_0x25eef1[_0x1006d6[a8_0x44d3('0xb')]]=!![];}if(_0x55e918[a8_0x44d3('0x27')]===a8_0x44d3('0x3c')){return{'commandStatus':_0x55e918[a8_0x44d3('0x14')],'runUrl':_0x55e918[a8_0x44d3('0x69')]};}}});}function processTask(_0x263a3e,_0xdbb0d2,_0xee0b5c,_0x25b3ad,_0x3a41bd,_0x15bc2c){return __awaiter(this,void 0x0,void 0x0,function*(){if(environment_1['VERBOSE_LOGGING']){output['note']({'title':a8_0x44d3('0x13')+_0x15bc2c[a8_0x44d3('0xb')]});}const _0x23a138=_0x3a41bd[a8_0x44d3('0x30')](_0x1d9d95=>_0x15bc2c[a8_0x44d3('0xb')]===_0x1d9d95['id']);if(!_0x23a138){throw new Error(a8_0x44d3('0x1a')+_0x15bc2c[a8_0x44d3('0xb')]);}if(environment_1['VERBOSE_LOGGING']){output['note']({'title':a8_0x44d3('0x2c')+_0x15bc2c['url']});}yield _0x263a3e[a8_0x44d3('0x59')](_0x15bc2c[a8_0x44d3('0x5b')],_0x15bc2c[a8_0x44d3('0x5a')],_0x25b3ad['cacheDirectory']||a8_0x44d3('0xd'));const _0x1e5c17=yield _0xdbb0d2[a8_0x44d3('0x9')](Object[a8_0x44d3('0x28')](Object['assign']({},_0x23a138),{'hash':_0x15bc2c[a8_0x44d3('0x5b')]}));const _0x50ab8b=getOutputs(_0xee0b5c['projectGraph'][a8_0x44d3('0x12')],_0x23a138);if(environment_1[a8_0x44d3('0x36')]){output[a8_0x44d3('0x8')]({'title':a8_0x44d3('0x57'),'bodyLines':_0x50ab8b});}yield _0xdbb0d2['copyFilesFromCache'](_0x15bc2c['hash'],_0x1e5c17,_0x50ab8b);output[a8_0x44d3('0x5c')](getCommand(_0x23a138));process[a8_0x44d3('0x25')][a8_0x44d3('0x40')](_0x1e5c17[a8_0x44d3('0x4f')]);output[a8_0x44d3('0x3e')]();});}function getCommand(_0x33a92e){const _0x4f600=_0x33a92e[a8_0x44d3('0x44')][a8_0x44d3('0x4e')]?':'+_0x33a92e[a8_0x44d3('0x44')][a8_0x44d3('0x4e')]:'';return['nx',a8_0x44d3('0x63'),_0x33a92e[a8_0x44d3('0x44')][a8_0x44d3('0x32')]+':'+_0x33a92e[a8_0x44d3('0x44')][a8_0x44d3('0x44')]+_0x4f600,(0x0,serializer_overrides_1[a8_0x44d3('0x34')])(_0x33a92e)]['join']('\x20');}function attachSignalListenersToCompleteRunGroupOnError(_0xfc5942,_0x3ff5fc){process['on'](a8_0x44d3('0x6a'),()=>__awaiter(this,void 0x0,void 0x0,function*(){yield _0xfc5942[a8_0x44d3('0x68')](_0x3ff5fc,a8_0x44d3('0x48'));process[a8_0x44d3('0x31')](0x1);}));process['on'](a8_0x44d3('0x26'),()=>__awaiter(this,void 0x0,void 0x0,function*(){yield _0xfc5942[a8_0x44d3('0x68')](_0x3ff5fc,a8_0x44d3('0x41'));process[a8_0x44d3('0x31')](0x1);}));}const nxCloudDistributedTasksRunner=(_0x5a145b,_0x40d1d5,_0x1b5f4f)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){if(environment_1[a8_0x44d3('0x36')]){output[a8_0x44d3('0x8')]({'title':a8_0x44d3('0x51')});}_0x40d1d5[a8_0x44d3('0x47')]=new NoopLifeCycle();const _0x59e69d=(0x0,environment_1[a8_0x44d3('0x2d')])();if(!_0x59e69d){(0x0,print_run_group_error_1[a8_0x44d3('0x52')])();return process['exit'](0x1);}const _0x23077a=new e2e_encryption_1[(a8_0x44d3('0x6'))](environment_1[a8_0x44d3('0x6b')]||_0x40d1d5['encryptionKey']);const _0x241077=new error_reporter_api_1[(a8_0x44d3('0xc'))](_0x40d1d5);const _0x6046b8=new file_storage_1['FileStorage'](_0x23077a,_0x241077,!![],![]);const _0x174470=new Cache(_0x40d1d5);const _0xf34720=new distributed_execution_api_1[(a8_0x44d3('0x50'))](_0x40d1d5);attachSignalListenersToCompleteRunGroupOnError(_0xf34720,_0x59e69d);try{const _0x5540d6=getTaskGraph(_0x1b5f4f,_0x5a145b,_0x40d1d5);const _0x373e9f=yield runDistributedExecution(_0xf34720,_0x40d1d5,_0x1b5f4f,_0x6046b8,_0x174470,_0x59e69d,_0x5540d6);if(_0x373e9f[a8_0x44d3('0x14')]===0x0){output[a8_0x44d3('0x2b')]({'title':a8_0x44d3('0x2'),'bodyLines':[a8_0x44d3('0xf')+_0x373e9f[a8_0x44d3('0x69')]]});}else{output[a8_0x44d3('0x54')]({'title':a8_0x44d3('0x37'),'bodyLines':[a8_0x44d3('0xf')+_0x373e9f[a8_0x44d3('0x69')]]});}yield(0x0,metric_logger_1[a8_0x44d3('0x49')])(_0x40d1d5);process[a8_0x44d3('0x31')](_0x373e9f[a8_0x44d3('0x14')]);}catch(_0x1064d2){output[a8_0x44d3('0x54')]({'title':a8_0x44d3('0x17'),'bodyLines':[_0x1064d2[a8_0x44d3('0x33')]]});if(_0x1064d2[a8_0x44d3('0x2e')]){console[a8_0x44d3('0x11')](_0x1064d2[a8_0x44d3('0x2e')]);}else{console[a8_0x44d3('0x11')](_0x1064d2);}try{yield _0xf34720['completeRunGroupWithError'](_0x59e69d,a8_0x44d3('0x58')+_0x1064d2['message']+'\x22');}finally{process[a8_0x44d3('0x31')](0x1);}}});exports[a8_0x44d3('0x61')]=nxCloudDistributedTasksRunner;function getTaskGraph(_0x55908e,_0x2cc6f9,_0x31b163){if(_0x55908e['taskGraph']){return _0x55908e[a8_0x44d3('0x60')];}else{const _0x53fbc6=JSON[a8_0x44d3('0x29')](stripJsonComments((0x0,fs_1[a8_0x44d3('0x5d')])(workspaceRoot+a8_0x44d3('0x45'))[a8_0x44d3('0x4d')]()));return new task_graph_creator_1[(a8_0x44d3('0x5f'))](_0x55908e[a8_0x44d3('0x10')],getDefaultDependencyConfigs(_0x53fbc6,_0x31b163))[a8_0x44d3('0x22')](_0x2cc6f9);}}function getDefaultDependencyConfigs(_0x1b040b,_0x4421e3){var _0x401f6b,_0x17dcb7;const _0xe4e190=(_0x401f6b=_0x1b040b[a8_0x44d3('0x1b')])!==null&&_0x401f6b!==void 0x0?_0x401f6b:{};const _0x486144=_0x4421e3?(_0x17dcb7=_0x4421e3[a8_0x44d3('0x4c')])!==null&&_0x17dcb7!==void 0x0?_0x17dcb7:[a8_0x44d3('0x53')]:[];for(const _0x4f7203 of _0x486144){_0xe4e190[_0x4f7203]=_0xe4e190[_0x4f7203]||[];_0xe4e190[_0x4f7203][a8_0x44d3('0x1f')]({'target':_0x4f7203,'projects':'dependencies'});}return _0xe4e190;}
|
|
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 fs_1 = require("fs");
|
|
14
|
+
const stripJsonComments = require("strip-json-comments");
|
|
15
|
+
const create_unchanged_value_timeout_1 = require("../../../utilities/create-unchanged-value-timeout");
|
|
16
|
+
const environment_1 = require("../../../utilities/environment");
|
|
17
|
+
const metric_logger_1 = require("../../../utilities/metric-logger");
|
|
18
|
+
const serializer_overrides_1 = require("../../../utilities/serializer-overrides");
|
|
19
|
+
const waiter_1 = require("../../../utilities/waiter");
|
|
20
|
+
const error_reporter_api_1 = require("../../api/error-reporter.api");
|
|
21
|
+
const print_run_group_error_1 = require("../../error/print-run-group-error");
|
|
22
|
+
const e2e_encryption_1 = require("../../file-storage/e2e-encryption");
|
|
23
|
+
const file_storage_1 = require("../../file-storage/file-storage");
|
|
24
|
+
const distributed_execution_api_1 = require("./distributed-execution.api");
|
|
25
|
+
const split_task_graph_into_stages_1 = require("./split-task-graph-into-stages");
|
|
26
|
+
const task_graph_creator_1 = require("./task-graph-creator");
|
|
27
|
+
const { output, workspaceRoot, getOutputs, Cache, } = require('../../../utilities/nx-imports');
|
|
28
|
+
class NoopLifeCycle {
|
|
29
|
+
scheduleTask(task) { }
|
|
30
|
+
startTask(task) { }
|
|
31
|
+
endTask(task, code) { }
|
|
32
|
+
}
|
|
33
|
+
function runDistributedExecution(api, options, context, fileStorage, cache, runGroup, taskGraph) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const id = yield api.start((0, distributed_execution_api_1.createStartRequest)(runGroup, (0, split_task_graph_into_stages_1.splitTasksIntoStages)(taskGraph), options));
|
|
36
|
+
return yield processTasks(api, fileStorage, cache, options, id, Object.values(taskGraph.tasks), context);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function processTasks(api, fileStorage, cache, options, executionId, tasks, context) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const processedTasks = {};
|
|
42
|
+
const failIfNumberOfCompletedTasksDoesNotChangeAfterTimeout = (0, create_unchanged_value_timeout_1.createUnchangedValueTimeout)({
|
|
43
|
+
title: `No new completed tasks after ${environment_1.NO_COMPLETED_TASKS_TIMEOUT / 1000} seconds.`,
|
|
44
|
+
timeout: environment_1.NO_COMPLETED_TASKS_TIMEOUT,
|
|
45
|
+
});
|
|
46
|
+
const waiter = new waiter_1.Waiter();
|
|
47
|
+
while (true) {
|
|
48
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
49
|
+
output.note({
|
|
50
|
+
title: 'Waiting...',
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
yield waiter.wait();
|
|
54
|
+
const r = yield api.status(executionId);
|
|
55
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
56
|
+
output.note({
|
|
57
|
+
title: `Status update`,
|
|
58
|
+
bodyLines: [
|
|
59
|
+
`executionId: ${executionId}`,
|
|
60
|
+
`executionStatus: ${r.executionStatus}`,
|
|
61
|
+
`number of completed tasks: ${r.completedTasks.length}`,
|
|
62
|
+
`error: ${r.criticalErrorMessage}`,
|
|
63
|
+
],
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
if (r.criticalErrorMessage) {
|
|
67
|
+
output.error({
|
|
68
|
+
title: 'Distributed Execution Terminated',
|
|
69
|
+
bodyLines: ['Error:', r.criticalErrorMessage],
|
|
70
|
+
});
|
|
71
|
+
process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
failIfNumberOfCompletedTasksDoesNotChangeAfterTimeout(r.completedTasks.length);
|
|
74
|
+
for (const t of r.completedTasks) {
|
|
75
|
+
if (processedTasks[t.taskId])
|
|
76
|
+
continue;
|
|
77
|
+
yield processTask(fileStorage, cache, context, options, tasks, t);
|
|
78
|
+
waiter.reset();
|
|
79
|
+
processedTasks[t.taskId] = true;
|
|
80
|
+
}
|
|
81
|
+
if (r.executionStatus === 'COMPLETED') {
|
|
82
|
+
return { commandStatus: r.commandStatus, runUrl: r.runUrl };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function processTask(fileStorage, cache, context, options, tasks, completedTask) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
90
|
+
output.note({
|
|
91
|
+
title: `Processing task ${completedTask.taskId}`,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const matchingTask = tasks.find((tt) => completedTask.taskId === tt.id);
|
|
95
|
+
if (!matchingTask) {
|
|
96
|
+
throw new Error(`Found unknown task: ${completedTask.taskId}`);
|
|
97
|
+
}
|
|
98
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
99
|
+
output.note({
|
|
100
|
+
title: `Retrieving artifacts from ${completedTask.url}`,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
yield fileStorage.retrieve(completedTask.hash, completedTask.url, options.cacheDirectory || './node_modules/.cache/nx');
|
|
104
|
+
const cachedResult = yield cache.get(Object.assign(Object.assign({}, matchingTask), { hash: completedTask.hash }));
|
|
105
|
+
const outputs = getOutputs(context.projectGraph.nodes, matchingTask);
|
|
106
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
107
|
+
output.note({
|
|
108
|
+
title: `Extracting artifacts`,
|
|
109
|
+
bodyLines: outputs,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
yield cache.copyFilesFromCache(completedTask.hash, cachedResult, outputs);
|
|
113
|
+
output.logCommand(getCommand(matchingTask));
|
|
114
|
+
process.stdout.write(cachedResult.terminalOutput);
|
|
115
|
+
output.addVerticalSeparator();
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function getCommand(task) {
|
|
119
|
+
const config = task.target.configuration
|
|
120
|
+
? `:${task.target.configuration}`
|
|
121
|
+
: '';
|
|
122
|
+
return [
|
|
123
|
+
'nx',
|
|
124
|
+
'run',
|
|
125
|
+
`${task.target.project}:${task.target.target}${config}`,
|
|
126
|
+
(0, serializer_overrides_1.serializeOverrides)(task),
|
|
127
|
+
].join(' ');
|
|
128
|
+
}
|
|
129
|
+
function attachSignalListenersToCompleteRunGroupOnError(api, runGroup) {
|
|
130
|
+
process.on('SIGINT', () => __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
yield api.completeRunGroupWithError(runGroup, 'Main job was terminated via SIGINT');
|
|
132
|
+
process.exit(1);
|
|
133
|
+
}));
|
|
134
|
+
process.on('SIGTERM', () => __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
yield api.completeRunGroupWithError(runGroup, 'Main job was terminated via SIGTERM');
|
|
136
|
+
process.exit(1);
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
const nxCloudDistributedTasksRunner = (tasks, options, context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
140
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
141
|
+
output.note({
|
|
142
|
+
title: 'Starting distributed command execution',
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
options.lifeCycle = new NoopLifeCycle();
|
|
146
|
+
const runGroup = (0, environment_1.getRunGroup)();
|
|
147
|
+
if (!runGroup) {
|
|
148
|
+
(0, print_run_group_error_1.printRunGroupError)();
|
|
149
|
+
return process.exit(1);
|
|
150
|
+
}
|
|
151
|
+
const encryption = new e2e_encryption_1.E2EEncryption(environment_1.ENCRYPTION_KEY || options.encryptionKey);
|
|
152
|
+
const errorReporter = new error_reporter_api_1.ErrorReporterApi(options);
|
|
153
|
+
const fileStorage = new file_storage_1.FileStorage(encryption, errorReporter, true, false);
|
|
154
|
+
const cache = new Cache(options);
|
|
155
|
+
const api = new distributed_execution_api_1.DistributedExecutionApi(options);
|
|
156
|
+
attachSignalListenersToCompleteRunGroupOnError(api, runGroup);
|
|
157
|
+
try {
|
|
158
|
+
const taskGraph = getTaskGraph(context, tasks, options);
|
|
159
|
+
const r = yield runDistributedExecution(api, options, context, fileStorage, cache, runGroup, taskGraph);
|
|
160
|
+
if (r.commandStatus === 0) {
|
|
161
|
+
output.success({
|
|
162
|
+
title: 'Successfully completed running the command.',
|
|
163
|
+
bodyLines: [`See run details at ${r.runUrl}`],
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
output.error({
|
|
168
|
+
title: 'Command execution failed.',
|
|
169
|
+
bodyLines: [`See run details at ${r.runUrl}`],
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
yield (0, metric_logger_1.submitRunMetrics)(options);
|
|
173
|
+
process.exit(r.commandStatus);
|
|
174
|
+
}
|
|
175
|
+
catch (e) {
|
|
176
|
+
output.error({
|
|
177
|
+
title: 'Unable to complete a run.',
|
|
178
|
+
bodyLines: [e.message],
|
|
179
|
+
});
|
|
180
|
+
if (e.axiosException) {
|
|
181
|
+
console.log(e.axiosException);
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
console.log(e);
|
|
185
|
+
}
|
|
186
|
+
try {
|
|
187
|
+
yield api.completeRunGroupWithError(runGroup, `Main job terminated with an error: "${e.message}"`);
|
|
188
|
+
}
|
|
189
|
+
finally {
|
|
190
|
+
process.exit(1);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
exports.nxCloudDistributedTasksRunner = nxCloudDistributedTasksRunner;
|
|
195
|
+
function getTaskGraph(context, tasks, options) {
|
|
196
|
+
if (context.taskGraph) {
|
|
197
|
+
return context.taskGraph;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
const nxjson = JSON.parse(stripJsonComments((0, fs_1.readFileSync)(`${workspaceRoot}/nx.json`).toString()));
|
|
201
|
+
return new task_graph_creator_1.TaskGraphCreator(context.projectGraph, getDefaultDependencyConfigs(nxjson, options)).createTaskGraph(tasks);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
function getDefaultDependencyConfigs(nxJson, runnerOptions) {
|
|
205
|
+
var _a, _b;
|
|
206
|
+
const defaults = (_a = nxJson.targetDependencies) !== null && _a !== void 0 ? _a : {};
|
|
207
|
+
const strictlyOrderedTargets = runnerOptions
|
|
208
|
+
? (_b = runnerOptions.strictlyOrderedTargets) !== null && _b !== void 0 ? _b : ['build']
|
|
209
|
+
: [];
|
|
210
|
+
// Strictly Ordered Targets depend on their dependencies
|
|
211
|
+
for (const target of strictlyOrderedTargets) {
|
|
212
|
+
defaults[target] = defaults[target] || [];
|
|
213
|
+
defaults[target].push({
|
|
214
|
+
target,
|
|
215
|
+
projects: 'dependencies',
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
return defaults;
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=distributed-execution.runner.js.map
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.splitTasksIntoStages = void 0;
|
|
4
|
+
function splitTasksIntoStages(taskGraph) {
|
|
5
|
+
const stages = [];
|
|
6
|
+
const notStagedTaskIds = new Set(Object.values(taskGraph.tasks).map((t) => t.id));
|
|
7
|
+
let stageIndex = 0;
|
|
8
|
+
// Loop through tasks and try to stage them. As tasks are staged, they are removed from the loop
|
|
9
|
+
while (notStagedTaskIds.size > 0) {
|
|
10
|
+
const currentStage = (stages[stageIndex] = []);
|
|
11
|
+
for (const taskId of notStagedTaskIds) {
|
|
12
|
+
let ready = true;
|
|
13
|
+
for (const dependency of taskGraph.dependencies[taskId]) {
|
|
14
|
+
if (notStagedTaskIds.has(dependency)) {
|
|
15
|
+
// dependency has not been staged yet, this task is not ready to be staged.
|
|
16
|
+
ready = false;
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
// Some dependency still has not been staged, skip it for now, it will be processed again
|
|
21
|
+
if (!ready) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
// All the dependencies have been staged, let's stage it.
|
|
25
|
+
const task = taskGraph.tasks[taskId];
|
|
26
|
+
currentStage.push(task);
|
|
27
|
+
}
|
|
28
|
+
// Remove the entire new stage of tasks from the list
|
|
29
|
+
for (const task of currentStage) {
|
|
30
|
+
notStagedTaskIds.delete(task.id);
|
|
31
|
+
}
|
|
32
|
+
stageIndex++;
|
|
33
|
+
}
|
|
34
|
+
return stages;
|
|
35
|
+
}
|
|
36
|
+
exports.splitTasksIntoStages = splitTasksIntoStages;
|
|
37
|
+
//# sourceMappingURL=split-task-graph-into-stages.js.map
|
|
@@ -1 +1,77 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskGraphCreator = void 0;
|
|
4
|
+
const { getDependencyConfigs } = require('../../../utilities/nx-imports');
|
|
5
|
+
/**
|
|
6
|
+
* This is only used for versions of Nx prior to 14 where the task graph
|
|
7
|
+
* wasn't part of the context so we have to recreate it
|
|
8
|
+
*/
|
|
9
|
+
class TaskGraphCreator {
|
|
10
|
+
constructor(projectGraph, defaultTargetDependencies) {
|
|
11
|
+
this.projectGraph = projectGraph;
|
|
12
|
+
this.defaultTargetDependencies = defaultTargetDependencies;
|
|
13
|
+
}
|
|
14
|
+
createTaskGraph(tasks) {
|
|
15
|
+
const graph = {
|
|
16
|
+
roots: [],
|
|
17
|
+
tasks: {},
|
|
18
|
+
dependencies: {},
|
|
19
|
+
};
|
|
20
|
+
for (const task of tasks) {
|
|
21
|
+
this.addTaskToGraph(task, graph);
|
|
22
|
+
const dependencyConfigs = getDependencyConfigs(task.target, this.defaultTargetDependencies, this.projectGraph);
|
|
23
|
+
if (!dependencyConfigs) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
this.addTaskDependencies(task, dependencyConfigs, tasks, graph);
|
|
27
|
+
}
|
|
28
|
+
graph.roots = Object.keys(graph.dependencies).filter((k) => graph.dependencies[k].length === 0);
|
|
29
|
+
return graph;
|
|
30
|
+
}
|
|
31
|
+
addTaskDependencies(task, dependencyConfigs, tasks, graph) {
|
|
32
|
+
for (const dependencyConfig of dependencyConfigs) {
|
|
33
|
+
if (dependencyConfig.projects === 'self') {
|
|
34
|
+
for (const t of tasks) {
|
|
35
|
+
if (t.target.project === task.target.project &&
|
|
36
|
+
t.target.target === dependencyConfig.target) {
|
|
37
|
+
graph.dependencies[task.id].push(t.id);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else if (dependencyConfig.projects === 'dependencies') {
|
|
42
|
+
const seen = new Set();
|
|
43
|
+
this.addDependencies(task.target.project, dependencyConfig.target, tasks, graph, task.id, seen);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
addDependencies(project, target, tasks, graph, taskId, seen) {
|
|
48
|
+
seen.add(project);
|
|
49
|
+
const dependencies = this.projectGraph.dependencies[project];
|
|
50
|
+
if (dependencies) {
|
|
51
|
+
const projectDependencies = dependencies.map((dependency) => dependency.target);
|
|
52
|
+
for (const projectDependency of projectDependencies) {
|
|
53
|
+
if (seen.has(projectDependency)) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const dependency = this.findTask({ project: projectDependency, target }, tasks);
|
|
57
|
+
if (dependency) {
|
|
58
|
+
if (graph.dependencies[taskId].indexOf(dependency.id) === -1) {
|
|
59
|
+
graph.dependencies[taskId].push(dependency.id);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
this.addDependencies(projectDependency, target, tasks, graph, taskId, seen);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
findTask({ project, target }, tasks) {
|
|
69
|
+
return tasks.find((t) => t.target.project === project && t.target.target === target);
|
|
70
|
+
}
|
|
71
|
+
addTaskToGraph(task, graph) {
|
|
72
|
+
graph.tasks[task.id] = task;
|
|
73
|
+
graph.dependencies[task.id] = [];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.TaskGraphCreator = TaskGraphCreator;
|
|
77
|
+
//# sourceMappingURL=task-graph-creator.js.map
|
|
@@ -21,10 +21,10 @@ class EndOfRunMessage {
|
|
|
21
21
|
.map((t) => t.projectName);
|
|
22
22
|
const message = [];
|
|
23
23
|
if (anyErrors) {
|
|
24
|
-
message.push(`
|
|
24
|
+
message.push(`View structured, searchable error logs at ${this.runContext.runUrl}`);
|
|
25
25
|
}
|
|
26
26
|
else if (anyCacheMisses) {
|
|
27
|
-
message.push(`
|
|
27
|
+
message.push(`View logs and investigate cache misses at ${this.runContext.runUrl}`);
|
|
28
28
|
}
|
|
29
29
|
else if (hits.length > 0) {
|
|
30
30
|
const tasks = hits.length === 1 ? hits[0] : `${hits.length} tasks`;
|
|
@@ -32,7 +32,7 @@ class EndOfRunMessage {
|
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
34
|
if (this.runContext.runUrl) {
|
|
35
|
-
message.push(`
|
|
35
|
+
message.push(`View logs and run details at ${this.runContext.runUrl}`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
if (message.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"end-of-run-message.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/terminal-output/end-of-run-message.ts"],"names":[],"mappings":";;;AAEA,6DAAqF;AACrF,iEAA6D;AAE7D,MAAa,eAAe;IAC1B,YACmB,UAAsB,EACtB,cAA+B;QAD/B,eAAU,GAAV,UAAU,CAAY;QACtB,mBAAc,GAAd,cAAc,CAAiB;IAC/C,CAAC;IAEJ,qBAAqB;QACnB,IAAI,oDAAsC;YAAE,OAAO;QAEnD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;YAC3B,OAAO;SACR;QAED,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;QACtE,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAC/C,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,KAAK,YAAY,CACxC,CAAC;QAEF,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc;aAC7B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,kBAAkB,CAAC;aACtE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QAE7B,MAAM,OAAO,GAAG,EAAW,CAAC;QAC5B,IAAI,SAAS,EAAE;YACb,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"end-of-run-message.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/terminal-output/end-of-run-message.ts"],"names":[],"mappings":";;;AAEA,6DAAqF;AACrF,iEAA6D;AAE7D,MAAa,eAAe;IAC1B,YACmB,UAAsB,EACtB,cAA+B;QAD/B,eAAU,GAAV,UAAU,CAAY;QACtB,mBAAc,GAAd,cAAc,CAAiB;IAC/C,CAAC;IAEJ,qBAAqB;QACnB,IAAI,oDAAsC;YAAE,OAAO;QAEnD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;YAC3B,OAAO;SACR;QAED,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;QACtE,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAC/C,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,KAAK,YAAY,CACxC,CAAC;QAEF,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc;aAC7B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,kBAAkB,CAAC;aACtE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QAE7B,MAAM,OAAO,GAAG,EAAW,CAAC;QAC5B,IAAI,SAAS,EAAE;YACb,OAAO,CAAC,IAAI,CACV,6CAA6C,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CACtE,CAAC;SACH;aAAM,IAAI,cAAc,EAAE;YACzB,OAAO,CAAC,IAAI,CACV,6CAA6C,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CACtE,CAAC;SACH;aAAM,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,QAAQ,CAAC;YACnE,OAAO,CAAC,IAAI,CACV,sCAAsC,KAAK,KAAK,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CACzE,CAAC;SACH;aAAM;YACL,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;gBAC1B,OAAO,CAAC,IAAI,CAAC,gCAAgC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;aACxE;SACF;QACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;YACtB,IAAA,4BAAY,EAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SACjC;IACH,CAAC;CACF;AA7CD,0CA6CC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { OutputObfuscator } from './output-obfuscator';
|
|
2
|
+
export declare function readTaskTerminalOutput(cacheDirectory: string | undefined, outputObfuscator: OutputObfuscator, hash: string, cacheStatus: 'remote-cache-hit' | 'local-cache-hit' | 'cache-miss', code: number): string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readTaskTerminalOutput = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const { workspaceRoot } = require('../../utilities/nx-imports');
|
|
6
|
+
const environment_1 = require("../../utilities/environment");
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const path = require("path");
|
|
9
|
+
const MAX_CHARACTERS_FAILED_TASK = 200000;
|
|
10
|
+
const MAX_CHARACTERS_SUCCESSFUL_TASK = 20000;
|
|
11
|
+
const MAX_CHARACTERS_CACHED_TASK = 20000;
|
|
12
|
+
function readTaskTerminalOutput(cacheDirectory, outputObfuscator, hash, cacheStatus, code) {
|
|
13
|
+
let dir;
|
|
14
|
+
if (cacheDirectory) {
|
|
15
|
+
if (cacheDirectory.startsWith('./')) {
|
|
16
|
+
dir = (0, path_1.join)(workspaceRoot, cacheDirectory);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
dir = cacheDirectory;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
dir = (0, path_1.join)(workspaceRoot, 'node_modules', '.cache', 'nx');
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const taskOutput = readTerminalOutputFile(dir, hash);
|
|
27
|
+
const taskOutputSanitized = outputObfuscator.obfuscate(taskOutput);
|
|
28
|
+
if (environment_1.NX_CLOUD_UNLIMITED_OUTPUT)
|
|
29
|
+
return taskOutputSanitized;
|
|
30
|
+
const maxCharacters = cacheStatus === 'cache-miss'
|
|
31
|
+
? code === 0
|
|
32
|
+
? MAX_CHARACTERS_SUCCESSFUL_TASK
|
|
33
|
+
: MAX_CHARACTERS_FAILED_TASK
|
|
34
|
+
: MAX_CHARACTERS_CACHED_TASK;
|
|
35
|
+
return taskOutputSanitized.length > maxCharacters
|
|
36
|
+
? `TRUNCATED\n\n${taskOutputSanitized.slice(taskOutputSanitized.length - maxCharacters)}`
|
|
37
|
+
: taskOutputSanitized;
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
if (process.env.NX_VERBOSE_LOGGING === 'true') {
|
|
41
|
+
console.error(e);
|
|
42
|
+
}
|
|
43
|
+
return '';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.readTaskTerminalOutput = readTaskTerminalOutput;
|
|
47
|
+
function readTerminalOutputFile(dir, hash) {
|
|
48
|
+
try {
|
|
49
|
+
return (0, fs_1.readFileSync)(path.join(dir, 'terminalOutputs', hash)).toString();
|
|
50
|
+
}
|
|
51
|
+
catch (_a) {
|
|
52
|
+
try {
|
|
53
|
+
return (0, fs_1.readFileSync)(path.join(dir, hash, 'terminalOutput')).toString();
|
|
54
|
+
}
|
|
55
|
+
catch (_b) {
|
|
56
|
+
return '';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=read-task-terminal-output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-task-terminal-output.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/terminal-output/read-task-terminal-output.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAE5B,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAChE,6DAAwE;AACxE,2BAAkC;AAClC,6BAA6B;AAG7B,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAC1C,MAAM,8BAA8B,GAAG,KAAK,CAAC;AAC7C,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAEzC,SAAgB,sBAAsB,CACpC,cAAkC,EAClC,gBAAkC,EAClC,IAAY,EACZ,WAAkE,EAClE,IAAY;IAEZ,IAAI,GAAG,CAAC;IACR,IAAI,cAAc,EAAE;QAClB,IAAI,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;YACnC,GAAG,GAAG,IAAA,WAAI,EAAC,aAAa,EAAE,cAAc,CAAC,CAAC;SAC3C;aAAM;YACL,GAAG,GAAG,cAAc,CAAC;SACtB;KACF;SAAM;QACL,GAAG,GAAG,IAAA,WAAI,EAAC,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;KAC3D;IACD,IAAI;QACF,MAAM,UAAU,GAAG,sBAAsB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrD,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACnE,IAAI,uCAAyB;YAAE,OAAO,mBAAmB,CAAC;QAE1D,MAAM,aAAa,GACjB,WAAW,KAAK,YAAY;YAC1B,CAAC,CAAC,IAAI,KAAK,CAAC;gBACV,CAAC,CAAC,8BAA8B;gBAChC,CAAC,CAAC,0BAA0B;YAC9B,CAAC,CAAC,0BAA0B,CAAC;QACjC,OAAO,mBAAmB,CAAC,MAAM,GAAG,aAAa;YAC/C,CAAC,CAAC,gBAAgB,mBAAmB,CAAC,KAAK,CACvC,mBAAmB,CAAC,MAAM,GAAG,aAAa,CAC3C,EAAE;YACL,CAAC,CAAC,mBAAmB,CAAC;KACzB;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,MAAM,EAAE;YAC7C,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAClB;QACD,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAvCD,wDAuCC;AAED,SAAS,sBAAsB,CAAC,GAAW,EAAE,IAAY;IACvD,IAAI;QACF,OAAO,IAAA,iBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;KACzE;IAAC,WAAM;QACN,IAAI;YACF,OAAO,IAAA,iBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;SACxE;QAAC,WAAM;YACN,OAAO,EAAE,CAAC;SACX;KACF;AACH,CAAC"}
|