@nrwl/nx-cloud 15.3.4 → 15.4.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.
Files changed (28) hide show
  1. package/lib/core/api/error-reporter.api.js +36 -1
  2. package/lib/core/api/run-group.api.js +73 -1
  3. package/lib/core/file-storage/file-storage.js +4 -2
  4. package/lib/core/file-storage/file-storage.js.map +1 -1
  5. package/lib/core/models/cloud-task-runner-options.d.ts +1 -1
  6. package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +93 -1
  7. package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +320 -1
  8. package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +133 -1
  9. package/lib/core/runners/cloud-enabled/cloud-run.api.js +174 -1
  10. package/lib/core/runners/cloud-enabled/cloud-run.api.js.map +1 -1
  11. package/lib/core/runners/cloud-enabled/id-generator.js +16 -1
  12. package/lib/core/runners/distributed-agent/distributed-agent.api.js +93 -1
  13. package/lib/core/runners/distributed-agent/distributed-agent.impl.js +157 -1
  14. package/lib/core/runners/distributed-agent/execute-tasks.js +114 -1
  15. package/lib/core/runners/distributed-agent/invoke-tasks-using-nx-imperative-api.js +58 -1
  16. package/lib/core/runners/distributed-agent/invoke-tasks-using-run-many.js +97 -1
  17. package/lib/core/runners/distributed-execution/distributed-execution.api.js +152 -1
  18. package/lib/core/runners/distributed-execution/distributed-execution.runner.js +118 -1
  19. package/lib/core/runners/distributed-execution/process-task.js +45 -1
  20. package/lib/core/runners/distributed-execution/process-tasks.js +67 -1
  21. package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js +37 -1
  22. package/lib/core/runners/distributed-execution/task-graph-creator.js +100 -1
  23. package/lib/utilities/axios.js +8 -2
  24. package/lib/utilities/axios.js.map +1 -1
  25. package/lib/utilities/environment.d.ts +1 -1
  26. package/lib/utilities/environment.js +2 -0
  27. package/lib/utilities/environment.js.map +1 -1
  28. package/package.json +1 -1
@@ -1 +1,152 @@
1
- const a10_0x3126=['__esModule','../../../utilities/serializer-overrides','agentCount','throw','dteStart','createApiAxiosInstance','createStartRequest','error','defineProperty','Completing\x20with\x20an\x20error','serializeOverrides','Workspace\x20is\x20disabled.\x20Cannot\x20perform\x20distributed\x20task\x20executions.','axiosException','/nx-cloud/executions/start','../../../utilities/nx-imports','DistributedExecutionApi','NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT','parallel','../../../utilities/axios','then','stopAgentsOnFailure','true','__awaiter','/nx-cloud/executions/status','parseCommand','enabled','ciExecutionId:\x20','value','data','Starting\x20a\x20distributed\x20execution','dteStatus','response','../../../utilities/environment','project','maxParallel','stringify','hash','exit','target','NX_CLOUD_DISTRIBUTED_EXECUTION_STOP_AGENTS_ON_FAILURE','mapRespToPerfEntry','completeRunGroup','error:\x20','RUNNER_FAILURE_PERF_ENTRY','completeRunGroupWithError','map','start','recordMetric','/nx-cloud/executions/complete-run-group','false','note','axiosMultipleTries','runGroup:\x20','post','../../../utilities/metric-logger','apiAxiosInstance','ciExecutionEnv:\x20','createMetricRecorder','VERBOSE_LOGGING','message','next'];(function(_0x15403c,_0x312698){const _0x15b7a4=function(_0x2a49f6){while(--_0x2a49f6){_0x15403c['push'](_0x15403c['shift']());}};_0x15b7a4(++_0x312698);}(a10_0x3126,0xbd));const a10_0x15b7=function(_0x15403c,_0x312698){_0x15403c=_0x15403c-0x0;let _0x15b7a4=a10_0x3126[_0x15403c];return _0x15b7a4;};'use strict';var __awaiter=this&&this[a10_0x15b7('0x10')]||function(_0x50f286,_0x5a401a,_0x3960f5,_0x1ac25b){function _0x318c88(_0x284aff){return _0x284aff instanceof _0x3960f5?_0x284aff:new _0x3960f5(function(_0xbcbe77){_0xbcbe77(_0x284aff);});}return new(_0x3960f5||(_0x3960f5=Promise))(function(_0x51fd53,_0x34653d){function _0x35c175(_0x5912a3){try{_0x1cc84a(_0x1ac25b['next'](_0x5912a3));}catch(_0x456524){_0x34653d(_0x456524);}}function _0x57c810(_0x2fa80d){try{_0x1cc84a(_0x1ac25b[a10_0x15b7('0x3a')](_0x2fa80d));}catch(_0x27390f){_0x34653d(_0x27390f);}}function _0x1cc84a(_0x54c7ac){_0x54c7ac['done']?_0x51fd53(_0x54c7ac[a10_0x15b7('0x15')]):_0x318c88(_0x54c7ac[a10_0x15b7('0x15')])[a10_0x15b7('0xd')](_0x35c175,_0x57c810);}_0x1cc84a((_0x1ac25b=_0x1ac25b['apply'](_0x50f286,_0x5a401a||[]))[a10_0x15b7('0x36')]());});};Object[a10_0x15b7('0x2')](exports,a10_0x15b7('0x37'),{'value':!![]});exports[a10_0x15b7('0x0')]=exports['DistributedExecutionApi']=void 0x0;const axios_1=require(a10_0x15b7('0xc'));const environment_1=require(a10_0x15b7('0x1a'));const metric_logger_1=require(a10_0x15b7('0x30'));const serializer_overrides_1=require(a10_0x15b7('0x38'));const {output}=require(a10_0x15b7('0x8'));class DistributedExecutionApi{constructor(_0x48fc34){this['apiAxiosInstance']=(0x0,axios_1[a10_0x15b7('0x3c')])(_0x48fc34);}[a10_0x15b7('0x28')](_0x203c0d){var _0x2f9ff2;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x13c7bf=(0x0,metric_logger_1['createMetricRecorder'])(a10_0x15b7('0x3b'));let _0x392f60;if(environment_1[a10_0x15b7('0x34')]){output[a10_0x15b7('0x2c')]({'title':a10_0x15b7('0x17'),'bodyLines':[JSON[a10_0x15b7('0x1d')](_0x203c0d,null,0x2)]});}try{_0x392f60=yield(0x0,axios_1[a10_0x15b7('0x2d')])(()=>this[a10_0x15b7('0x31')]['post'](a10_0x15b7('0x7'),_0x203c0d));_0x13c7bf[a10_0x15b7('0x29')]((0x0,metric_logger_1[a10_0x15b7('0x22')])(_0x392f60));}catch(_0x36b8fe){_0x13c7bf[a10_0x15b7('0x29')](((_0x2f9ff2=_0x36b8fe===null||_0x36b8fe===void 0x0?void 0x0:_0x36b8fe[a10_0x15b7('0x6')])===null||_0x2f9ff2===void 0x0?void 0x0:_0x2f9ff2['response'])?(0x0,metric_logger_1[a10_0x15b7('0x22')])(_0x36b8fe['axiosException']['response']):metric_logger_1['RUNNER_FAILURE_PERF_ENTRY']);throw _0x36b8fe;}if(!_0x392f60[a10_0x15b7('0x16')][a10_0x15b7('0x13')]){throw new Error(a10_0x15b7('0x5'));}if(_0x392f60['data'][a10_0x15b7('0x1')]){throw new Error(_0x392f60[a10_0x15b7('0x16')][a10_0x15b7('0x1')]);}return _0x392f60[a10_0x15b7('0x16')]['id'];});}['status'](_0x118166){var _0x405fa7;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x22833d=(0x0,metric_logger_1[a10_0x15b7('0x33')])(a10_0x15b7('0x18'));try{const _0x1c17e7=yield(0x0,axios_1[a10_0x15b7('0x2d')])(()=>this[a10_0x15b7('0x31')][a10_0x15b7('0x2f')](a10_0x15b7('0x11'),{'id':_0x118166}));_0x22833d[a10_0x15b7('0x29')]((0x0,metric_logger_1[a10_0x15b7('0x22')])(_0x1c17e7));return _0x1c17e7[a10_0x15b7('0x16')];}catch(_0x8e13c5){_0x22833d['recordMetric'](((_0x405fa7=_0x8e13c5===null||_0x8e13c5===void 0x0?void 0x0:_0x8e13c5[a10_0x15b7('0x6')])===null||_0x405fa7===void 0x0?void 0x0:_0x405fa7[a10_0x15b7('0x19')])?(0x0,metric_logger_1[a10_0x15b7('0x22')])(_0x8e13c5['axiosException']['response']):metric_logger_1['RUNNER_FAILURE_PERF_ENTRY']);output[a10_0x15b7('0x1')]({'title':_0x8e13c5[a10_0x15b7('0x35')]});process[a10_0x15b7('0x1f')](0x1);}});}[a10_0x15b7('0x26')](_0x5b0315,_0x58d1bc,_0x3c062c,_0x1208bc,_0x27fd30){var _0x5daeff;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x52c310=(0x0,metric_logger_1['createMetricRecorder'])(a10_0x15b7('0x23'));if(environment_1[a10_0x15b7('0x34')]){output[a10_0x15b7('0x2c')]({'title':a10_0x15b7('0x3'),'bodyLines':[a10_0x15b7('0x14')+_0x3c062c,a10_0x15b7('0x32')+_0x1208bc,a10_0x15b7('0x2e')+_0x58d1bc,a10_0x15b7('0x24')+_0x27fd30]});}try{const _0x40f376=yield(0x0,axios_1[a10_0x15b7('0x2d')])(()=>this[a10_0x15b7('0x31')][a10_0x15b7('0x2f')](a10_0x15b7('0x2a'),{'runGroup':_0x58d1bc,'ciExecutionId':_0x3c062c,'ciExecutionEnv':_0x1208bc,'criticalErrorMessage':_0x27fd30}),0x3);_0x52c310[a10_0x15b7('0x29')]((0x0,metric_logger_1[a10_0x15b7('0x22')])(_0x40f376));}catch(_0x4934b0){_0x52c310[a10_0x15b7('0x29')](((_0x5daeff=_0x4934b0===null||_0x4934b0===void 0x0?void 0x0:_0x4934b0[a10_0x15b7('0x6')])===null||_0x5daeff===void 0x0?void 0x0:_0x5daeff['response'])?(0x0,metric_logger_1[a10_0x15b7('0x22')])(_0x4934b0[a10_0x15b7('0x6')][a10_0x15b7('0x19')]):metric_logger_1[a10_0x15b7('0x25')]);}});}}exports[a10_0x15b7('0x9')]=DistributedExecutionApi;function createStartRequest(_0x236b8f,_0x21cc4f,_0x5b768f,_0x53fffb,_0x4c9910,_0x40d6a7){const _0x42092e=_0x4c9910['map'](_0x2ae7e9=>{return _0x2ae7e9[a10_0x15b7('0x27')](_0x17e2a9=>{return{'taskId':_0x17e2a9['id'],'hash':_0x17e2a9[a10_0x15b7('0x1e')],'projectName':_0x17e2a9[a10_0x15b7('0x20')][a10_0x15b7('0x1b')],'target':_0x17e2a9[a10_0x15b7('0x20')][a10_0x15b7('0x20')],'configuration':_0x17e2a9[a10_0x15b7('0x20')]['configuration']||null,'params':(0x0,serializer_overrides_1[a10_0x15b7('0x4')])(_0x17e2a9)};});});const _0x2b0416={'command':(0x0,environment_1[a10_0x15b7('0x12')])(),'branch':_0x236b8f,'runGroup':_0x21cc4f,'ciExecutionId':_0x5b768f,'ciExecutionEnv':_0x53fffb,'tasks':_0x42092e,'maxParallel':calculateMaxParallel(_0x40d6a7)};if(environment_1[a10_0x15b7('0xa')]){_0x2b0416[a10_0x15b7('0x39')]=environment_1['NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT'];}if(!environment_1[a10_0x15b7('0x21')]){_0x2b0416[a10_0x15b7('0xe')]=![];}return _0x2b0416;}exports['createStartRequest']=createStartRequest;function calculateMaxParallel(_0x501ac2){if(_0x501ac2[a10_0x15b7('0xb')]===a10_0x15b7('0x2b')||_0x501ac2[a10_0x15b7('0xb')]===![]){return 0x1;}else if(_0x501ac2[a10_0x15b7('0xb')]===a10_0x15b7('0xf')||_0x501ac2[a10_0x15b7('0xb')]===!![]){return Number(_0x501ac2[a10_0x15b7('0x1c')]||0x3);}else if(_0x501ac2['parallel']===undefined){return _0x501ac2[a10_0x15b7('0x1c')]?Number(_0x501ac2['maxParallel']):0x3;}else{return Number(_0x501ac2[a10_0x15b7('0xb')])||0x3;}}
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(branch, runGroup, ciExecutionId, ciExecutionEnv, 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 with an error',
81
+ bodyLines: [
82
+ `ciExecutionId: ${ciExecutionId}`,
83
+ `ciExecutionEnv: ${ciExecutionEnv}`,
84
+ `runGroup: ${runGroup}`,
85
+ `error: ${error}`,
86
+ ],
87
+ });
88
+ }
89
+ try {
90
+ const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/complete-run-group', {
91
+ runGroup,
92
+ ciExecutionId,
93
+ ciExecutionEnv,
94
+ criticalErrorMessage: error,
95
+ }), 3);
96
+ recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
97
+ }
98
+ catch (e) {
99
+ recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
100
+ ? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
101
+ : metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
102
+ }
103
+ });
104
+ }
105
+ }
106
+ exports.DistributedExecutionApi = DistributedExecutionApi;
107
+ function createStartRequest(branch, runGroup, ciExecutionId, ciExecutionEnv, task, options) {
108
+ const tasksToExecute = task.map((arr) => {
109
+ return arr.map((t) => {
110
+ return {
111
+ taskId: t.id,
112
+ hash: t.hash,
113
+ projectName: t.target.project,
114
+ target: t.target.target,
115
+ configuration: t.target.configuration || null,
116
+ params: (0, serializer_overrides_1.serializeOverrides)(t),
117
+ };
118
+ });
119
+ });
120
+ const request = {
121
+ command: (0, environment_1.parseCommand)(),
122
+ branch,
123
+ runGroup,
124
+ ciExecutionId,
125
+ ciExecutionEnv,
126
+ tasks: tasksToExecute,
127
+ maxParallel: calculateMaxParallel(options),
128
+ };
129
+ if (environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT) {
130
+ request.agentCount = environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT;
131
+ }
132
+ if (!environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_STOP_AGENTS_ON_FAILURE) {
133
+ request.stopAgentsOnFailure = false;
134
+ }
135
+ return request;
136
+ }
137
+ exports.createStartRequest = createStartRequest;
138
+ function calculateMaxParallel(options) {
139
+ if (options.parallel === 'false' || options.parallel === false) {
140
+ return 1;
141
+ }
142
+ else if (options.parallel === 'true' || options.parallel === true) {
143
+ return Number(options.maxParallel || 3);
144
+ }
145
+ else if (options.parallel === undefined) {
146
+ return options.maxParallel ? Number(options.maxParallel) : 3;
147
+ }
148
+ else {
149
+ return Number(options.parallel) || 3;
150
+ }
151
+ }
152
+ //# sourceMappingURL=distributed-execution.api.js.map
@@ -1 +1,118 @@
1
- const a11_0x4902=['taskGraph','Main\x20job\x20was\x20terminated\x20via\x20SIGTERM','DTE\x20needs\x20the\x20cache\x20to\x20share\x20files\x20between\x20agents.','tasks','createTaskGraphCompat','SIGTERM','./process-tasks','createStartRequest','E2EEncryption','ENCRYPTION_KEY','projectGraph','../../../utilities/metric-logger','../../../utilities/dte-artifact-storage','printRunGroupError','note','DistributedExecutionApi','Main\x20job\x20was\x20terminated\x20via\x20SIGINT','See\x20run\x20details\x20at\x20','start','getRunGroup','../../api/error-reporter.api','error','commandStatus','Main\x20job\x20terminated\x20with\x20an\x20error:\x20\x22','SIGINT','submitRunMetrics','values','VERBOSE_LOGGING','value','next','then','lifeCycle','endTasks','defineProperty','Successfully\x20completed\x20running\x20the\x20command.','runUrl','success','nxCloudDistributedTasksRunner','canDetectRunGroup','message','skipNxCache','getBranch','startTask','../../file-storage/e2e-encryption','encryptionKey','exit','Starting\x20distributed\x20command\x20execution','completeRunGroupWithError','throw','log','./task-graph-creator','scheduleTask','__esModule','../../../utilities/environment','__awaiter','processTasks','getCIExecutionId','ErrorReporterApi','dte-main','../../file-storage/file-storage','--skip-nx-cache\x20is\x20ignored\x20when\x20using\x20distributed\x20tasks\x20execution\x20(DTE).','getCIExecutionEnv','./split-task-graph-into-stages'];(function(_0x3c2f57,_0x4902b6){const _0x32157e=function(_0x21ce81){while(--_0x21ce81){_0x3c2f57['push'](_0x3c2f57['shift']());}};_0x32157e(++_0x4902b6);}(a11_0x4902,0x161));const a11_0x3215=function(_0x3c2f57,_0x4902b6){_0x3c2f57=_0x3c2f57-0x0;let _0x32157e=a11_0x4902[_0x3c2f57];return _0x32157e;};'use strict';var __awaiter=this&&this[a11_0x3215('0x10')]||function(_0xc64d6c,_0x441d49,_0x3102da,_0x533fa3){function _0x54beb5(_0x368320){return _0x368320 instanceof _0x3102da?_0x368320:new _0x3102da(function(_0x2be948){_0x2be948(_0x368320);});}return new(_0x3102da||(_0x3102da=Promise))(function(_0x46ed1b,_0x5d0606){function _0x2a58c7(_0xefb1b){try{_0x55485c(_0x533fa3[a11_0x3215('0x36')](_0xefb1b));}catch(_0x15f4f9){_0x5d0606(_0x15f4f9);}}function _0x2c158d(_0x85c2bf){try{_0x55485c(_0x533fa3[a11_0x3215('0xa')](_0x85c2bf));}catch(_0x1fd3f9){_0x5d0606(_0x1fd3f9);}}function _0x55485c(_0x441ee2){_0x441ee2['done']?_0x46ed1b(_0x441ee2[a11_0x3215('0x35')]):_0x54beb5(_0x441ee2[a11_0x3215('0x35')])[a11_0x3215('0x37')](_0x2a58c7,_0x2c158d);}_0x55485c((_0x533fa3=_0x533fa3['apply'](_0xc64d6c,_0x441d49||[]))['next']());});};Object[a11_0x3215('0x3a')](exports,a11_0x3215('0xe'),{'value':!![]});exports['nxCloudDistributedTasksRunner']=void 0x0;const environment_1=require(a11_0x3215('0xf'));const metric_logger_1=require(a11_0x3215('0x24'));const error_reporter_api_1=require(a11_0x3215('0x2d'));const print_run_group_error_1=require('../../error/print-run-group-error');const e2e_encryption_1=require(a11_0x3215('0x5'));const file_storage_1=require(a11_0x3215('0x15'));const distributed_execution_api_1=require('./distributed-execution.api');const split_task_graph_into_stages_1=require(a11_0x3215('0x18'));const task_graph_creator_1=require(a11_0x3215('0xc'));const process_tasks_1=require(a11_0x3215('0x1f'));const dte_artifact_storage_1=require(a11_0x3215('0x25'));const {output}=require('../../../utilities/nx-imports');class NoopLifeCycle{[a11_0x3215('0xd')](_0x56bc91){}[a11_0x3215('0x4')](_0x2476f5){}[a11_0x3215('0x39')](_0x1a648c){}}const nxCloudDistributedTasksRunner=(_0x4a2720,_0x53c4fa,_0x1cfd75)=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){if(_0x53c4fa[a11_0x3215('0x2')]){output['warn']({'title':a11_0x3215('0x16'),'bodyLine':[a11_0x3215('0x1b')]});}if(environment_1[a11_0x3215('0x34')]){output[a11_0x3215('0x27')]({'title':a11_0x3215('0x8')});}_0x53c4fa[a11_0x3215('0x38')]=new NoopLifeCycle();const _0xe38185=(0x0,environment_1[a11_0x3215('0x3')])();const _0x2d0f70=(0x0,environment_1[a11_0x3215('0x2c')])();const _0x1dbbee=(0x0,environment_1[a11_0x3215('0x12')])();const _0x927c8c=(0x0,environment_1[a11_0x3215('0x17')])();if(!(0x0,print_run_group_error_1[a11_0x3215('0x0')])(_0x2d0f70,_0x1dbbee)){(0x0,print_run_group_error_1[a11_0x3215('0x26')])();process[a11_0x3215('0x7')](0x1);}const _0x49dd23=new e2e_encryption_1[(a11_0x3215('0x21'))](environment_1[a11_0x3215('0x22')]||_0x53c4fa[a11_0x3215('0x6')]);const _0x4cd9fa=new error_reporter_api_1[(a11_0x3215('0x13'))](_0x53c4fa);const _0x2e5290=new dte_artifact_storage_1['DteArtifactStorage'](new file_storage_1['FileStorage'](_0x49dd23,_0x4cd9fa,_0x53c4fa,a11_0x3215('0x14')),(0x0,environment_1['getNxCacheDirectory'])(_0x53c4fa));const _0x110b7f=new distributed_execution_api_1[(a11_0x3215('0x28'))](_0x53c4fa);attachSignalListenersToCompleteRunGroupOnError(_0x110b7f,_0xe38185,_0x2d0f70,_0x1dbbee,_0x927c8c);try{const _0x368a91=getTaskGraph(_0x1cfd75,_0x4a2720,_0x53c4fa);const _0x43ce17=yield runDistributedExecution(_0x110b7f,_0x53c4fa,_0x2e5290,_0xe38185,_0x2d0f70,_0x1dbbee,_0x927c8c,_0x368a91);if(_0x43ce17[a11_0x3215('0x2f')]===0x0){output[a11_0x3215('0x3d')]({'title':a11_0x3215('0x3b'),'bodyLines':[a11_0x3215('0x2a')+_0x43ce17['runUrl']]});}else{output['error']({'title':'Command\x20execution\x20failed.','bodyLines':['See\x20run\x20details\x20at\x20'+_0x43ce17[a11_0x3215('0x3c')]]});}yield(0x0,metric_logger_1[a11_0x3215('0x32')])(_0x53c4fa);process[a11_0x3215('0x7')](_0x43ce17[a11_0x3215('0x2f')]);}catch(_0x31f54d){output[a11_0x3215('0x2e')]({'title':'Unable\x20to\x20complete\x20a\x20run.','bodyLines':[_0x31f54d[a11_0x3215('0x1')]]});if(_0x31f54d['axiosException']){console[a11_0x3215('0xb')](_0x31f54d['axiosException']);}else{console[a11_0x3215('0xb')](_0x31f54d);}try{yield _0x110b7f[a11_0x3215('0x9')](_0xe38185,_0x2d0f70,_0x1dbbee,_0x927c8c,a11_0x3215('0x30')+_0x31f54d[a11_0x3215('0x1')]+'\x22');}finally{process['exit'](0x1);}}});exports[a11_0x3215('0x3e')]=nxCloudDistributedTasksRunner;function getTaskGraph(_0x3f04e2,_0x1c006a,_0x5dc904){if(_0x3f04e2[a11_0x3215('0x19')]){return _0x3f04e2[a11_0x3215('0x19')];}else{return(0x0,task_graph_creator_1[a11_0x3215('0x1d')])(_0x5dc904,_0x3f04e2[a11_0x3215('0x23')],_0x1c006a);}}function attachSignalListenersToCompleteRunGroupOnError(_0x47f41c,_0x770b02,_0x513619,_0x5f5df1,_0x248c51){process['on'](a11_0x3215('0x31'),()=>__awaiter(this,void 0x0,void 0x0,function*(){yield _0x47f41c[a11_0x3215('0x9')](_0x770b02,_0x513619,_0x5f5df1,_0x248c51,a11_0x3215('0x29'));process['exit'](0x1);}));process['on'](a11_0x3215('0x1e'),()=>__awaiter(this,void 0x0,void 0x0,function*(){yield _0x47f41c['completeRunGroupWithError'](_0x770b02,_0x513619,_0x5f5df1,_0x248c51,a11_0x3215('0x1a'));process[a11_0x3215('0x7')](0x1);}));}function runDistributedExecution(_0x3743ea,_0x75cecc,_0x29680f,_0x157611,_0x482bf9,_0x5a2182,_0x455991,_0x522d98){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x2c7b45=yield _0x3743ea[a11_0x3215('0x2b')]((0x0,distributed_execution_api_1[a11_0x3215('0x20')])(_0x157611,_0x482bf9,_0x5a2182,_0x455991,(0x0,split_task_graph_into_stages_1['splitTasksIntoStages'])(_0x522d98),_0x75cecc));return yield(0x0,process_tasks_1[a11_0x3215('0x11')])(_0x3743ea,_0x29680f,_0x2c7b45,Object[a11_0x3215('0x33')](_0x522d98[a11_0x3215('0x1c')]));});}
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 branch = (0, environment_1.getBranch)();
44
+ const runGroup = (0, environment_1.getRunGroup)();
45
+ const ciExecutionId = (0, environment_1.getCIExecutionId)();
46
+ const ciExecutionEnv = (0, environment_1.getCIExecutionEnv)();
47
+ if (!(0, print_run_group_error_1.canDetectRunGroup)(runGroup, ciExecutionId)) {
48
+ (0, print_run_group_error_1.printRunGroupError)();
49
+ process.exit(1);
50
+ }
51
+ const encryption = new e2e_encryption_1.E2EEncryption(environment_1.ENCRYPTION_KEY || options.encryptionKey);
52
+ const errorReporter = new error_reporter_api_1.ErrorReporterApi(options);
53
+ const dteArtifactStorage = new dte_artifact_storage_1.DteArtifactStorage(new file_storage_1.FileStorage(encryption, errorReporter, options, 'dte-main'), (0, environment_1.getNxCacheDirectory)(options));
54
+ const api = new distributed_execution_api_1.DistributedExecutionApi(options);
55
+ attachSignalListenersToCompleteRunGroupOnError(api, branch, runGroup, ciExecutionId, ciExecutionEnv);
56
+ try {
57
+ const taskGraph = getTaskGraph(context, tasks, options);
58
+ const r = yield runDistributedExecution(api, options, dteArtifactStorage, branch, runGroup, ciExecutionId, ciExecutionEnv, taskGraph);
59
+ if (r.commandStatus === 0) {
60
+ output.success({
61
+ title: 'Successfully completed running the command.',
62
+ bodyLines: [`See run details at ${r.runUrl}`],
63
+ });
64
+ }
65
+ else {
66
+ output.error({
67
+ title: 'Command execution failed.',
68
+ bodyLines: [`See run details at ${r.runUrl}`],
69
+ });
70
+ }
71
+ yield (0, metric_logger_1.submitRunMetrics)(options);
72
+ process.exit(r.commandStatus);
73
+ }
74
+ catch (e) {
75
+ output.error({
76
+ title: 'Unable to complete a run.',
77
+ bodyLines: [e.message],
78
+ });
79
+ if (e.axiosException) {
80
+ console.log(e.axiosException);
81
+ }
82
+ else {
83
+ console.log(e);
84
+ }
85
+ try {
86
+ yield api.completeRunGroupWithError(branch, runGroup, ciExecutionId, ciExecutionEnv, `Main job terminated with an error: "${e.message}"`);
87
+ }
88
+ finally {
89
+ process.exit(1);
90
+ }
91
+ }
92
+ });
93
+ exports.nxCloudDistributedTasksRunner = nxCloudDistributedTasksRunner;
94
+ function getTaskGraph(context, tasks, options) {
95
+ if (context.taskGraph) {
96
+ return context.taskGraph;
97
+ }
98
+ else {
99
+ return (0, task_graph_creator_1.createTaskGraphCompat)(options, context.projectGraph, tasks);
100
+ }
101
+ }
102
+ function attachSignalListenersToCompleteRunGroupOnError(api, branch, runGroup, ciExecutionId, ciExecutionEnv) {
103
+ process.on('SIGINT', () => __awaiter(this, void 0, void 0, function* () {
104
+ yield api.completeRunGroupWithError(branch, runGroup, ciExecutionId, ciExecutionEnv, 'Main job was terminated via SIGINT');
105
+ process.exit(1);
106
+ }));
107
+ process.on('SIGTERM', () => __awaiter(this, void 0, void 0, function* () {
108
+ yield api.completeRunGroupWithError(branch, runGroup, ciExecutionId, ciExecutionEnv, 'Main job was terminated via SIGTERM');
109
+ process.exit(1);
110
+ }));
111
+ }
112
+ function runDistributedExecution(api, options, dteArtifactStorage, branch, runGroup, ciExecutionId, ciExecutionEnv, taskGraph) {
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ const id = yield api.start((0, distributed_execution_api_1.createStartRequest)(branch, runGroup, ciExecutionId, ciExecutionEnv, (0, split_task_graph_into_stages_1.splitTasksIntoStages)(taskGraph), options));
115
+ return yield (0, process_tasks_1.processTasks)(api, dteArtifactStorage, id, Object.values(taskGraph.tasks));
116
+ });
117
+ }
118
+ //# sourceMappingURL=distributed-execution.runner.js.map
@@ -1 +1,45 @@
1
- const a12_0x3250=['url','configuration','processTask','VERBOSE_LOGGING','logCommand','../../../utilities/nx-imports','write','__awaiter','run','next','hash','throw','then','target','done','defineProperty','apply','stdout','taskId','retrieveAndExtract','serializeOverrides','Found\x20unknown\x20task:\x20','value','addVerticalSeparator','../../../utilities/environment','../../../utilities/serializer-overrides','find'];(function(_0x40c698,_0x325002){const _0x57ec76=function(_0x25cd9e){while(--_0x25cd9e){_0x40c698['push'](_0x40c698['shift']());}};_0x57ec76(++_0x325002);}(a12_0x3250,0x74));const a12_0x57ec=function(_0x40c698,_0x325002){_0x40c698=_0x40c698-0x0;let _0x57ec76=a12_0x3250[_0x40c698];return _0x57ec76;};'use strict';var __awaiter=this&&this[a12_0x57ec('0x1a')]||function(_0x4912ba,_0x889592,_0x31141d,_0x1d3979){function _0x4a3670(_0x2fdf8e){return _0x2fdf8e instanceof _0x31141d?_0x2fdf8e:new _0x31141d(function(_0x59b04c){_0x59b04c(_0x2fdf8e);});}return new(_0x31141d||(_0x31141d=Promise))(function(_0x500bf5,_0x23d467){function _0x514ca7(_0x3e2e3f){try{_0xc48fd3(_0x1d3979[a12_0x57ec('0x1')](_0x3e2e3f));}catch(_0x53c8c9){_0x23d467(_0x53c8c9);}}function _0x2dff6b(_0x2b5d51){try{_0xc48fd3(_0x1d3979[a12_0x57ec('0x3')](_0x2b5d51));}catch(_0x29b1a9){_0x23d467(_0x29b1a9);}}function _0xc48fd3(_0x5d3b42){_0x5d3b42[a12_0x57ec('0x6')]?_0x500bf5(_0x5d3b42[a12_0x57ec('0xe')]):_0x4a3670(_0x5d3b42['value'])[a12_0x57ec('0x4')](_0x514ca7,_0x2dff6b);}_0xc48fd3((_0x1d3979=_0x1d3979[a12_0x57ec('0x8')](_0x4912ba,_0x889592||[]))[a12_0x57ec('0x1')]());});};Object[a12_0x57ec('0x7')](exports,'__esModule',{'value':!![]});exports[a12_0x57ec('0x15')]=void 0x0;const environment_1=require(a12_0x57ec('0x10'));const serializer_overrides_1=require(a12_0x57ec('0x11'));const {output}=require(a12_0x57ec('0x18'));function processTask(_0x2e99f9,_0x502aa6,_0x377e08){return __awaiter(this,void 0x0,void 0x0,function*(){if(environment_1[a12_0x57ec('0x16')]){output['note']({'title':'Processing\x20task\x20'+_0x377e08[a12_0x57ec('0xa')]});}const _0x523bea=_0x502aa6[a12_0x57ec('0x12')](_0xa4067e=>_0x377e08['taskId']===_0xa4067e['id']);if(!_0x523bea){throw new Error(a12_0x57ec('0xd')+_0x377e08['taskId']);}const _0x3848bf=yield _0x2e99f9[a12_0x57ec('0xb')](_0x377e08[a12_0x57ec('0x2')],_0x377e08[a12_0x57ec('0x13')]);output[a12_0x57ec('0x17')](getCommand(_0x523bea));process[a12_0x57ec('0x9')][a12_0x57ec('0x19')](_0x3848bf);output[a12_0x57ec('0xf')]();});}exports['processTask']=processTask;function getCommand(_0x56f054){const _0xdb7da4=_0x56f054[a12_0x57ec('0x5')][a12_0x57ec('0x14')]?':'+_0x56f054[a12_0x57ec('0x5')]['configuration']:'';return['nx',a12_0x57ec('0x0'),_0x56f054['target']['project']+':'+_0x56f054['target'][a12_0x57ec('0x5')]+_0xdb7da4,(0x0,serializer_overrides_1[a12_0x57ec('0xc')])(_0x56f054)]['join']('\x20');}
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.processTask = void 0;
13
+ const environment_1 = require("../../../utilities/environment");
14
+ const serializer_overrides_1 = require("../../../utilities/serializer-overrides");
15
+ const { output } = require('../../../utilities/nx-imports');
16
+ function processTask(dteArtifactStorage, tasks, completedTask) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ if (environment_1.VERBOSE_LOGGING) {
19
+ output.note({
20
+ title: `Processing task ${completedTask.taskId}`,
21
+ });
22
+ }
23
+ const matchingTask = tasks.find((tt) => completedTask.taskId === tt.id);
24
+ if (!matchingTask) {
25
+ throw new Error(`Found unknown task: ${completedTask.taskId}`);
26
+ }
27
+ const terminalOutput = yield dteArtifactStorage.retrieveAndExtract(completedTask.hash, completedTask.url);
28
+ output.logCommand(getCommand(matchingTask));
29
+ process.stdout.write(terminalOutput);
30
+ output.addVerticalSeparator();
31
+ });
32
+ }
33
+ exports.processTask = processTask;
34
+ function getCommand(task) {
35
+ const config = task.target.configuration
36
+ ? `:${task.target.configuration}`
37
+ : '';
38
+ return [
39
+ 'nx',
40
+ 'run',
41
+ `${task.target.project}:${task.target.target}${config}`,
42
+ (0, serializer_overrides_1.serializeOverrides)(task),
43
+ ].join(' ');
44
+ }
45
+ //# sourceMappingURL=process-task.js.map
@@ -1 +1,67 @@
1
- const a13_0x263b=['commandStatus','error:\x20','status','note','apply','then','defineProperty','../../../utilities/nx-imports','../../../utilities/waiter','VERBOSE_LOGGING','executionId:\x20','__awaiter','criticalErrorMessage','executionStatus','reset','Waiting...','processTasks','../../../utilities/environment','NO_COMPLETED_TASKS_TIMEOUT','No\x20new\x20completed\x20tasks\x20after\x20','error','value','throw','completedTasks','taskId','\x20seconds.','done','wait','length','COMPLETED','../../../utilities/create-unchanged-value-timeout','__esModule','next','processTask','runUrl','createUnchangedValueTimeout'];(function(_0x2b05f6,_0x263b8c){const _0x172b5e=function(_0x157b31){while(--_0x157b31){_0x2b05f6['push'](_0x2b05f6['shift']());}};_0x172b5e(++_0x263b8c);}(a13_0x263b,0x118));const a13_0x172b=function(_0x2b05f6,_0x263b8c){_0x2b05f6=_0x2b05f6-0x0;let _0x172b5e=a13_0x263b[_0x2b05f6];return _0x172b5e;};'use strict';var __awaiter=this&&this[a13_0x172b('0x13')]||function(_0x3c5032,_0x2248b1,_0x3cef4f,_0x2546db){function _0x5690cf(_0x549d97){return _0x549d97 instanceof _0x3cef4f?_0x549d97:new _0x3cef4f(function(_0x144fd4){_0x144fd4(_0x549d97);});}return new(_0x3cef4f||(_0x3cef4f=Promise))(function(_0x3fba03,_0x69672c){function _0x39a600(_0x41f406){try{_0x13df15(_0x2546db['next'](_0x41f406));}catch(_0x4f342e){_0x69672c(_0x4f342e);}}function _0x499c0d(_0x271460){try{_0x13df15(_0x2546db[a13_0x172b('0x1e')](_0x271460));}catch(_0x2babf2){_0x69672c(_0x2babf2);}}function _0x13df15(_0x413e95){_0x413e95[a13_0x172b('0x22')]?_0x3fba03(_0x413e95['value']):_0x5690cf(_0x413e95[a13_0x172b('0x1d')])[a13_0x172b('0xd')](_0x39a600,_0x499c0d);}_0x13df15((_0x2546db=_0x2546db[a13_0x172b('0xc')](_0x3c5032,_0x2248b1||[]))[a13_0x172b('0x4')]());});};Object[a13_0x172b('0xe')](exports,a13_0x172b('0x3'),{'value':!![]});exports[a13_0x172b('0x18')]=void 0x0;const create_unchanged_value_timeout_1=require(a13_0x172b('0x2'));const environment_1=require(a13_0x172b('0x19'));const waiter_1=require(a13_0x172b('0x10'));const process_task_1=require('./process-task');const {output}=require(a13_0x172b('0xf'));function processTasks(_0x29a46c,_0xb26520,_0x328c99,_0x116d66){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x31ac1e={};const _0x3b6265=(0x0,create_unchanged_value_timeout_1[a13_0x172b('0x7')])({'title':a13_0x172b('0x1b')+environment_1[a13_0x172b('0x1a')]/0x3e8+a13_0x172b('0x21'),'timeout':environment_1['NO_COMPLETED_TASKS_TIMEOUT']});const _0xbef8ff=new waiter_1['Waiter']();while(!![]){if(environment_1['VERBOSE_LOGGING']){output[a13_0x172b('0xb')]({'title':a13_0x172b('0x17')});}yield _0xbef8ff[a13_0x172b('0x23')]();const _0x3ed055=yield _0x29a46c[a13_0x172b('0xa')](_0x328c99);if(environment_1[a13_0x172b('0x11')]){output[a13_0x172b('0xb')]({'title':'Status\x20update','bodyLines':[a13_0x172b('0x12')+_0x328c99,'executionStatus:\x20'+_0x3ed055[a13_0x172b('0x15')],'number\x20of\x20completed\x20tasks:\x20'+_0x3ed055[a13_0x172b('0x1f')][a13_0x172b('0x0')],a13_0x172b('0x9')+_0x3ed055[a13_0x172b('0x14')]]});}if(_0x3ed055[a13_0x172b('0x14')]){output[a13_0x172b('0x1c')]({'title':'Distributed\x20Execution\x20Terminated','bodyLines':['Error:',_0x3ed055[a13_0x172b('0x14')]]});process['exit'](0x1);}_0x3b6265(_0x3ed055['completedTasks'][a13_0x172b('0x0')]);for(const _0x4420c9 of _0x3ed055[a13_0x172b('0x1f')]){if(_0x31ac1e[_0x4420c9['taskId']])continue;yield(0x0,process_task_1[a13_0x172b('0x5')])(_0xb26520,_0x116d66,_0x4420c9);_0xbef8ff[a13_0x172b('0x16')]();_0x31ac1e[_0x4420c9[a13_0x172b('0x20')]]=!![];}if(_0x3ed055[a13_0x172b('0x15')]===a13_0x172b('0x1')){return{'commandStatus':_0x3ed055[a13_0x172b('0x8')],'runUrl':_0x3ed055[a13_0x172b('0x6')]};}}});}exports[a13_0x172b('0x18')]=processTasks;
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.processTasks = 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 process_task_1 = require("./process-task");
17
+ const { output } = require('../../../utilities/nx-imports');
18
+ function processTasks(api, dteArtifactStorage, executionId, tasks) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const processedTasks = {};
21
+ const failIfNumberOfCompletedTasksDoesNotChangeAfterTimeout = (0, create_unchanged_value_timeout_1.createUnchangedValueTimeout)({
22
+ title: `No new completed tasks after ${environment_1.NO_COMPLETED_TASKS_TIMEOUT / 1000} seconds.`,
23
+ timeout: environment_1.NO_COMPLETED_TASKS_TIMEOUT,
24
+ });
25
+ const waiter = new waiter_1.Waiter();
26
+ while (true) {
27
+ if (environment_1.VERBOSE_LOGGING) {
28
+ output.note({
29
+ title: 'Waiting...',
30
+ });
31
+ }
32
+ yield waiter.wait();
33
+ const r = yield api.status(executionId);
34
+ if (environment_1.VERBOSE_LOGGING) {
35
+ output.note({
36
+ title: `Status update`,
37
+ bodyLines: [
38
+ `executionId: ${executionId}`,
39
+ `executionStatus: ${r.executionStatus}`,
40
+ `number of completed tasks: ${r.completedTasks.length}`,
41
+ `error: ${r.criticalErrorMessage}`,
42
+ ],
43
+ });
44
+ }
45
+ if (r.criticalErrorMessage) {
46
+ output.error({
47
+ title: 'Distributed Execution Terminated',
48
+ bodyLines: ['Error:', r.criticalErrorMessage],
49
+ });
50
+ process.exit(1);
51
+ }
52
+ failIfNumberOfCompletedTasksDoesNotChangeAfterTimeout(r.completedTasks.length);
53
+ for (const t of r.completedTasks) {
54
+ if (processedTasks[t.taskId])
55
+ continue;
56
+ yield (0, process_task_1.processTask)(dteArtifactStorage, tasks, t);
57
+ waiter.reset();
58
+ processedTasks[t.taskId] = true;
59
+ }
60
+ if (r.executionStatus === 'COMPLETED') {
61
+ return { commandStatus: r.commandStatus, runUrl: r.runUrl };
62
+ }
63
+ }
64
+ });
65
+ }
66
+ exports.processTasks = processTasks;
67
+ //# sourceMappingURL=process-tasks.js.map
@@ -1 +1,37 @@
1
- const a14_0x566d=['values','push','size','splitTasksIntoStages','map','tasks'];(function(_0x11518b,_0x566dda){const _0x5cb3af=function(_0x4a9868){while(--_0x4a9868){_0x11518b['push'](_0x11518b['shift']());}};_0x5cb3af(++_0x566dda);}(a14_0x566d,0xac));const a14_0x5cb3=function(_0x11518b,_0x566dda){_0x11518b=_0x11518b-0x0;let _0x5cb3af=a14_0x566d[_0x11518b];return _0x5cb3af;};'use strict';Object['defineProperty'](exports,'__esModule',{'value':!![]});exports[a14_0x5cb3('0x5')]=void 0x0;function splitTasksIntoStages(_0x3acedb){const _0x14f23f=[];const _0x2f5a53=new Set(Object[a14_0x5cb3('0x2')](_0x3acedb[a14_0x5cb3('0x1')])[a14_0x5cb3('0x0')](_0x5829f6=>_0x5829f6['id']));let _0x37396c=0x0;while(_0x2f5a53[a14_0x5cb3('0x4')]>0x0){const _0x802160=_0x14f23f[_0x37396c]=[];for(const _0x230f74 of _0x2f5a53){let _0x1ca7e1=!![];for(const _0x3ec06e of _0x3acedb['dependencies'][_0x230f74]){if(_0x2f5a53['has'](_0x3ec06e)){_0x1ca7e1=![];break;}}if(!_0x1ca7e1){continue;}const _0x44d80c=_0x3acedb[a14_0x5cb3('0x1')][_0x230f74];_0x802160[a14_0x5cb3('0x3')](_0x44d80c);}for(const _0x5c2684 of _0x802160){_0x2f5a53['delete'](_0x5c2684['id']);}_0x37396c++;}return _0x14f23f;}exports[a14_0x5cb3('0x5')]=splitTasksIntoStages;
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,100 @@
1
- const a15_0x2521=['defaultTargetDependencies','TaskGraphCreator','findTask','keys','map','filter','strip-json-comments','indexOf','target','defineProperty','parse','projectGraph','../../../utilities/nx-imports','addTaskToGraph','project','push','self','dependencies','addDependencies','projects','__esModule','find','addTaskDependencies','has','strictlyOrderedTargets','createTaskGraph','tasks','createTaskGraphCompat','/nx.json','readFileSync','add','roots'];(function(_0x6ed1ed,_0x25211c){const _0x5d4895=function(_0x9e6dad){while(--_0x9e6dad){_0x6ed1ed['push'](_0x6ed1ed['shift']());}};_0x5d4895(++_0x25211c);}(a15_0x2521,0x81));const a15_0x5d48=function(_0x6ed1ed,_0x25211c){_0x6ed1ed=_0x6ed1ed-0x0;let _0x5d4895=a15_0x2521[_0x6ed1ed];return _0x5d4895;};'use strict';Object[a15_0x5d48('0x8')](exports,a15_0x5d48('0x13'),{'value':!![]});exports[a15_0x5d48('0x0')]=exports['createTaskGraphCompat']=void 0x0;const stripJsonComments=require(a15_0x5d48('0x5'));const fs_1=require('fs');const {getDependencyConfigs,workspaceRoot}=require(a15_0x5d48('0xb'));function createTaskGraphCompat(_0x55ad80,_0x1dfb0e,_0xe6ea6){const _0xb27e00=JSON[a15_0x5d48('0x9')](stripJsonComments((0x0,fs_1[a15_0x5d48('0x1c')])(workspaceRoot+a15_0x5d48('0x1b'))['toString']()));return new TaskGraphCreator(_0x1dfb0e,getDefaultDependencyConfigs(_0xb27e00,_0x55ad80))[a15_0x5d48('0x18')](_0xe6ea6);}exports[a15_0x5d48('0x1a')]=createTaskGraphCompat;function getDefaultDependencyConfigs(_0x15e1d2,_0x17facc){var _0x2a191d,_0x3f10ac;const _0x35bfdf=(_0x2a191d=_0x15e1d2['targetDependencies'])!==null&&_0x2a191d!==void 0x0?_0x2a191d:{};const _0xaa198=_0x17facc?(_0x3f10ac=_0x17facc[a15_0x5d48('0x17')])!==null&&_0x3f10ac!==void 0x0?_0x3f10ac:['build']:[];for(const _0x421696 of _0xaa198){_0x35bfdf[_0x421696]=_0x35bfdf[_0x421696]||[];_0x35bfdf[_0x421696][a15_0x5d48('0xe')]({'target':_0x421696,'projects':a15_0x5d48('0x10')});}return _0x35bfdf;}class TaskGraphCreator{constructor(_0x130c46,_0x269161){this[a15_0x5d48('0xa')]=_0x130c46;this['defaultTargetDependencies']=_0x269161;}[a15_0x5d48('0x18')](_0x2384ff){const _0x168db8={'roots':[],'tasks':{},'dependencies':{}};for(const _0x3f349d of _0x2384ff){this[a15_0x5d48('0xc')](_0x3f349d,_0x168db8);const _0x3b4839=getDependencyConfigs(_0x3f349d[a15_0x5d48('0x7')],this[a15_0x5d48('0x1f')],this[a15_0x5d48('0xa')]);if(!_0x3b4839){continue;}this[a15_0x5d48('0x15')](_0x3f349d,_0x3b4839,_0x2384ff,_0x168db8);}_0x168db8[a15_0x5d48('0x1e')]=Object[a15_0x5d48('0x2')](_0x168db8[a15_0x5d48('0x10')])[a15_0x5d48('0x4')](_0x4fb338=>_0x168db8[a15_0x5d48('0x10')][_0x4fb338]['length']===0x0);return _0x168db8;}['addTaskDependencies'](_0x4478cb,_0x4a436d,_0xcedde7,_0x56c690){for(const _0x1b4d33 of _0x4a436d){if(_0x1b4d33['projects']===a15_0x5d48('0xf')){for(const _0x5050e6 of _0xcedde7){if(_0x5050e6[a15_0x5d48('0x7')][a15_0x5d48('0xd')]===_0x4478cb[a15_0x5d48('0x7')][a15_0x5d48('0xd')]&&_0x5050e6[a15_0x5d48('0x7')][a15_0x5d48('0x7')]===_0x1b4d33[a15_0x5d48('0x7')]){_0x56c690['dependencies'][_0x4478cb['id']][a15_0x5d48('0xe')](_0x5050e6['id']);}}}else if(_0x1b4d33[a15_0x5d48('0x12')]==='dependencies'){const _0x4b8bb7=new Set();this[a15_0x5d48('0x11')](_0x4478cb[a15_0x5d48('0x7')]['project'],_0x1b4d33['target'],_0xcedde7,_0x56c690,_0x4478cb['id'],_0x4b8bb7);}}}['addDependencies'](_0x2b542b,_0x28f4ba,_0x1c72cc,_0x243ec0,_0x31a178,_0x4c2efa){_0x4c2efa[a15_0x5d48('0x1d')](_0x2b542b);const _0x432308=this[a15_0x5d48('0xa')][a15_0x5d48('0x10')][_0x2b542b];if(_0x432308){const _0xf36762=_0x432308[a15_0x5d48('0x3')](_0x10a589=>_0x10a589[a15_0x5d48('0x7')]);for(const _0x59306f of _0xf36762){if(_0x4c2efa[a15_0x5d48('0x16')](_0x59306f)){continue;}const _0x466221=this[a15_0x5d48('0x1')]({'project':_0x59306f,'target':_0x28f4ba},_0x1c72cc);if(_0x466221){if(_0x243ec0[a15_0x5d48('0x10')][_0x31a178][a15_0x5d48('0x6')](_0x466221['id'])===-0x1){_0x243ec0[a15_0x5d48('0x10')][_0x31a178][a15_0x5d48('0xe')](_0x466221['id']);}}else{this[a15_0x5d48('0x11')](_0x59306f,_0x28f4ba,_0x1c72cc,_0x243ec0,_0x31a178,_0x4c2efa);}}}}[a15_0x5d48('0x1')]({project,target},_0x11c229){return _0x11c229[a15_0x5d48('0x14')](_0x26955c=>_0x26955c['target'][a15_0x5d48('0xd')]===project&&_0x26955c[a15_0x5d48('0x7')]['target']===target);}['addTaskToGraph'](_0x29e093,_0x17b718){_0x17b718[a15_0x5d48('0x19')][_0x29e093['id']]=_0x29e093;_0x17b718[a15_0x5d48('0x10')][_0x29e093['id']]=[];}}exports[a15_0x5d48('0x0')]=TaskGraphCreator;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaskGraphCreator = exports.createTaskGraphCompat = void 0;
4
+ const stripJsonComments = require("strip-json-comments");
5
+ const fs_1 = require("fs");
6
+ const { getDependencyConfigs, workspaceRoot, } = require('../../../utilities/nx-imports');
7
+ function createTaskGraphCompat(options, projectGraph, tasks) {
8
+ const nxjson = JSON.parse(stripJsonComments((0, fs_1.readFileSync)(`${workspaceRoot}/nx.json`).toString()));
9
+ return new TaskGraphCreator(projectGraph, getDefaultDependencyConfigs(nxjson, options)).createTaskGraph(tasks);
10
+ }
11
+ exports.createTaskGraphCompat = createTaskGraphCompat;
12
+ function getDefaultDependencyConfigs(nxJson, runnerOptions) {
13
+ var _a, _b;
14
+ const defaults = (_a = nxJson.targetDependencies) !== null && _a !== void 0 ? _a : {};
15
+ const strictlyOrderedTargets = runnerOptions
16
+ ? (_b = runnerOptions.strictlyOrderedTargets) !== null && _b !== void 0 ? _b : ['build']
17
+ : [];
18
+ // Strictly Ordered Targets depend on their dependencies
19
+ for (const target of strictlyOrderedTargets) {
20
+ defaults[target] = defaults[target] || [];
21
+ defaults[target].push({
22
+ target,
23
+ projects: 'dependencies',
24
+ });
25
+ }
26
+ return defaults;
27
+ }
28
+ /**
29
+ * This is only used for versions of Nx prior to 14 where the task graph
30
+ * wasn't part of the context so we have to recreate it
31
+ */
32
+ class TaskGraphCreator {
33
+ constructor(projectGraph, defaultTargetDependencies) {
34
+ this.projectGraph = projectGraph;
35
+ this.defaultTargetDependencies = defaultTargetDependencies;
36
+ }
37
+ createTaskGraph(tasks) {
38
+ const graph = {
39
+ roots: [],
40
+ tasks: {},
41
+ dependencies: {},
42
+ };
43
+ for (const task of tasks) {
44
+ this.addTaskToGraph(task, graph);
45
+ const dependencyConfigs = getDependencyConfigs(task.target, this.defaultTargetDependencies, this.projectGraph);
46
+ if (!dependencyConfigs) {
47
+ continue;
48
+ }
49
+ this.addTaskDependencies(task, dependencyConfigs, tasks, graph);
50
+ }
51
+ graph.roots = Object.keys(graph.dependencies).filter((k) => graph.dependencies[k].length === 0);
52
+ return graph;
53
+ }
54
+ addTaskDependencies(task, dependencyConfigs, tasks, graph) {
55
+ for (const dependencyConfig of dependencyConfigs) {
56
+ if (dependencyConfig.projects === 'self') {
57
+ for (const t of tasks) {
58
+ if (t.target.project === task.target.project &&
59
+ t.target.target === dependencyConfig.target) {
60
+ graph.dependencies[task.id].push(t.id);
61
+ }
62
+ }
63
+ }
64
+ else if (dependencyConfig.projects === 'dependencies') {
65
+ const seen = new Set();
66
+ this.addDependencies(task.target.project, dependencyConfig.target, tasks, graph, task.id, seen);
67
+ }
68
+ }
69
+ }
70
+ addDependencies(project, target, tasks, graph, taskId, seen) {
71
+ seen.add(project);
72
+ const dependencies = this.projectGraph.dependencies[project];
73
+ if (dependencies) {
74
+ const projectDependencies = dependencies.map((dependency) => dependency.target);
75
+ for (const projectDependency of projectDependencies) {
76
+ if (seen.has(projectDependency)) {
77
+ continue;
78
+ }
79
+ const dependency = this.findTask({ project: projectDependency, target }, tasks);
80
+ if (dependency) {
81
+ if (graph.dependencies[taskId].indexOf(dependency.id) === -1) {
82
+ graph.dependencies[taskId].push(dependency.id);
83
+ }
84
+ }
85
+ else {
86
+ this.addDependencies(projectDependency, target, tasks, graph, taskId, seen);
87
+ }
88
+ }
89
+ }
90
+ }
91
+ findTask({ project, target }, tasks) {
92
+ return tasks.find((t) => t.target.project === project && t.target.target === target);
93
+ }
94
+ addTaskToGraph(task, graph) {
95
+ graph.tasks[task.id] = task;
96
+ graph.dependencies[task.id] = [];
97
+ }
98
+ }
99
+ exports.TaskGraphCreator = TaskGraphCreator;
100
+ //# sourceMappingURL=task-graph-creator.js.map
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.axiosMultipleTries = exports.printDuration = exports.createApiAxiosInstance = exports.AxiosException = void 0;
13
13
  const environment_1 = require("./environment");
14
14
  const waiter_1 = require("./waiter");
15
+ const path_1 = require("path");
15
16
  const { output } = require('./nx-imports');
16
17
  const axios = require('axios');
17
18
  class AxiosException {
@@ -23,16 +24,21 @@ class AxiosException {
23
24
  }
24
25
  exports.AxiosException = AxiosException;
25
26
  function createApiAxiosInstance(options) {
27
+ let axiosConfigBuilder = (axiosConfig) => axiosConfig;
26
28
  const baseUrl = options.url || 'https://cloud.nx.app';
27
29
  const accessToken = environment_1.ACCESS_TOKEN ? environment_1.ACCESS_TOKEN : options.accessToken;
28
30
  if (!accessToken) {
29
31
  throw new Error(`Unable to authenticate. Either define accessToken in nx.json or set the NX_CLOUD_ACCESS_TOKEN env variable.`);
30
32
  }
31
- return axios.create({
33
+ if (options.customProxyConfigPath) {
34
+ const { nxCloudProxyConfig } = require((0, path_1.join)(process.cwd(), options.customProxyConfigPath));
35
+ axiosConfigBuilder = nxCloudProxyConfig !== null && nxCloudProxyConfig !== void 0 ? nxCloudProxyConfig : axiosConfigBuilder;
36
+ }
37
+ return axios.create(axiosConfigBuilder({
32
38
  baseURL: baseUrl,
33
39
  timeout: environment_1.NX_CLOUD_NO_TIMEOUTS ? environment_1.UNLIMITED_TIMEOUT : 10000,
34
40
  headers: { authorization: accessToken },
35
- });
41
+ }));
36
42
  }
37
43
  exports.createApiAxiosInstance = createApiAxiosInstance;
38
44
  function printDuration(description, callback) {
@@ -1 +1 @@
1
- {"version":3,"file":"axios.js","sourceRoot":"","sources":["../../../../../../libs/nx-packages/nx-cloud/lib/utilities/axios.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAMuB;AACvB,qCAAgC;AAGhC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAE3C,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/B,MAAa,cAAc;IACzB,YACkB,IAA2B,EAC3B,OAAe,EACf,cAAmB;QAFnB,SAAI,GAAJ,IAAI,CAAuB;QAC3B,YAAO,GAAP,OAAO,CAAQ;QACf,mBAAc,GAAd,cAAc,CAAK;IAClC,CAAC;CACL;AAND,wCAMC;AAED,SAAgB,sBAAsB,CAAC,OAA+B;IACpE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,IAAI,sBAAsB,CAAC;IACtD,MAAM,WAAW,GAAG,0BAAY,CAAC,CAAC,CAAC,0BAAY,CAAC,CAAC,CAAC,OAAO,CAAC,WAAY,CAAC;IAEvE,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CACb,6GAA6G,CAC9G,CAAC;KACH;IAED,OAAO,KAAK,CAAC,MAAM,CAAC;QAClB,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,kCAAoB,CAAC,CAAC,CAAC,+BAAiB,CAAC,CAAC,CAAC,KAAK;QACzD,OAAO,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE;KACxC,CAAC,CAAC;AACL,CAAC;AAfD,wDAeC;AAED,SAAsB,aAAa,CAAC,WAAmB,EAAE,QAAkB;;QACzE,MAAM,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,GAAG,GAAG,MAAM,QAAQ,EAAE,CAAC;QAC7B,MAAM,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QAErB,IAAI,6BAAe,EAAE;Y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