@nrwl/nx-cloud 15.2.0-beta.6 → 15.2.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/generators.json CHANGED
@@ -5,7 +5,8 @@
5
5
  "init": {
6
6
  "factory": "./lib/generators/init/init#generator",
7
7
  "schema": "./lib/generators/init/schema.json",
8
- "description": "Initialize the @nrwl/nx-cloud plugin"
8
+ "description": "Initialize the @nrwl/nx-cloud plugin",
9
+ "hidden": true
9
10
  }
10
11
  }
11
12
  }
@@ -1,36 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.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_0x4a9f=['../../utilities/nx-imports','then','__awaiter','done','../../utilities/axios','defineProperty','apiAxiosInstance','post','next','value','warn','__esModule','ErrorReporterApi','createApiAxiosInstance','/nx-cloud/report-client-error','axiosMultipleTries','message','apply'];(function(_0x17aa40,_0x4a9ff0){const _0x44b2c3=function(_0x2ebf86){while(--_0x2ebf86){_0x17aa40['push'](_0x17aa40['shift']());}};_0x44b2c3(++_0x4a9ff0);}(a0_0x4a9f,0xc7));const a0_0x44b2=function(_0x17aa40,_0x4a9ff0){_0x17aa40=_0x17aa40-0x0;let _0x44b2c3=a0_0x4a9f[_0x17aa40];return _0x44b2c3;};'use strict';var __awaiter=this&&this[a0_0x44b2('0x1')]||function(_0x540e8d,_0x395646,_0x569a53,_0x21d152){function _0x323930(_0x43959d){return _0x43959d instanceof _0x569a53?_0x43959d:new _0x569a53(function(_0x4e7d07){_0x4e7d07(_0x43959d);});}return new(_0x569a53||(_0x569a53=Promise))(function(_0x30ee1d,_0x25b546){function _0x334e27(_0x294cce){try{_0x36f1b6(_0x21d152[a0_0x44b2('0x7')](_0x294cce));}catch(_0x257a66){_0x25b546(_0x257a66);}}function _0x383762(_0x538b8c){try{_0x36f1b6(_0x21d152['throw'](_0x538b8c));}catch(_0xef1a01){_0x25b546(_0xef1a01);}}function _0x36f1b6(_0xe1eefb){_0xe1eefb[a0_0x44b2('0x2')]?_0x30ee1d(_0xe1eefb[a0_0x44b2('0x8')]):_0x323930(_0xe1eefb['value'])[a0_0x44b2('0x0')](_0x334e27,_0x383762);}_0x36f1b6((_0x21d152=_0x21d152[a0_0x44b2('0x10')](_0x540e8d,_0x395646||[]))[a0_0x44b2('0x7')]());});};Object[a0_0x44b2('0x4')](exports,a0_0x44b2('0xa'),{'value':!![]});exports[a0_0x44b2('0xb')]=void 0x0;const axios_1=require(a0_0x44b2('0x3'));const {output}=require(a0_0x44b2('0x11'));class ErrorReporterApi{constructor(_0x3c7f94){this[a0_0x44b2('0x5')]=(0x0,axios_1[a0_0x44b2('0xc')])(_0x3c7f94);}['reportError'](_0x459c92){return __awaiter(this,void 0x0,void 0x0,function*(){try{yield(0x0,axios_1[a0_0x44b2('0xe')])(()=>this[a0_0x44b2('0x5')][a0_0x44b2('0x6')](a0_0x44b2('0xd'),{'message':_0x459c92}));}catch(_0x1d2cf7){output[a0_0x44b2('0x9')]({'title':'Unable\x20to\x20record\x20the\x20following\x20error:\x20\x27'+_0x459c92+'\x27','bodyLines':[_0x1d2cf7[a0_0x44b2('0xf')]]});}});}}exports[a0_0x44b2('0xb')]=ErrorReporterApi;
@@ -1,68 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.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_0x2b3f=['__esModule','axiosMultipleTries','defineProperty','/nx-cloud/executions/create-run-group','createMetricRecorder','message','next','value','done','apiAxiosInstance','/nx-cloud/executions/complete-run-group','recordMetric','response','axiosException','../../utilities/nx-imports','createApiAxiosInstance','RUNNER_FAILURE_PERF_ENTRY','error','mapRespToPerfEntry','throw','createRunGroup','post','../../utilities/metric-logger','RunGroupApi','apply','exit'];(function(_0x33884e,_0x2b3fa8){const _0x2eb918=function(_0x4b0dee){while(--_0x4b0dee){_0x33884e['push'](_0x33884e['shift']());}};_0x2eb918(++_0x2b3fa8);}(a1_0x2b3f,0x13c));const a1_0x2eb9=function(_0x33884e,_0x2b3fa8){_0x33884e=_0x33884e-0x0;let _0x2eb918=a1_0x2b3f[_0x33884e];return _0x2eb918;};'use strict';var __awaiter=this&&this['__awaiter']||function(_0x5378ff,_0x59b95b,_0x52f17d,_0x28daca){function _0x86589e(_0x3e14a1){return _0x3e14a1 instanceof _0x52f17d?_0x3e14a1:new _0x52f17d(function(_0x1aa820){_0x1aa820(_0x3e14a1);});}return new(_0x52f17d||(_0x52f17d=Promise))(function(_0x380a65,_0x308a01){function _0x4c595d(_0x2eaa2d){try{_0x52c6d5(_0x28daca[a1_0x2eb9('0x2')](_0x2eaa2d));}catch(_0x22adcf){_0x308a01(_0x22adcf);}}function _0x491e50(_0x4ad714){try{_0x52c6d5(_0x28daca[a1_0x2eb9('0xf')](_0x4ad714));}catch(_0x38536c){_0x308a01(_0x38536c);}}function _0x52c6d5(_0x25368e){_0x25368e[a1_0x2eb9('0x4')]?_0x380a65(_0x25368e['value']):_0x86589e(_0x25368e[a1_0x2eb9('0x3')])['then'](_0x4c595d,_0x491e50);}_0x52c6d5((_0x28daca=_0x28daca[a1_0x2eb9('0x14')](_0x5378ff,_0x59b95b||[]))[a1_0x2eb9('0x2')]());});};Object[a1_0x2eb9('0x18')](exports,a1_0x2eb9('0x16'),{'value':!![]});exports[a1_0x2eb9('0x13')]=void 0x0;const axios_1=require('../../utilities/axios');const metric_logger_1=require(a1_0x2eb9('0x12'));const {output}=require(a1_0x2eb9('0xa'));class RunGroupApi{constructor(_0xad0cea){this[a1_0x2eb9('0x5')]=(0x0,axios_1[a1_0x2eb9('0xb')])(_0xad0cea);}[a1_0x2eb9('0x10')](_0x42d1f4,_0x56ea8a,_0x1dce67,_0xad0744,_0x2c6817){var _0x5486ca;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x248bba=(0x0,metric_logger_1[a1_0x2eb9('0x0')])(a1_0x2eb9('0x10'));try{const _0x1a5ca3=yield(0x0,axios_1[a1_0x2eb9('0x17')])(()=>this[a1_0x2eb9('0x5')]['post'](a1_0x2eb9('0x19'),{'branch':_0x42d1f4,'runGroup':_0x56ea8a,'stopAgentsOnFailure':_0x1dce67,'agentCount':_0xad0744,'stopAgentsAfter':_0x2c6817}));_0x248bba[a1_0x2eb9('0x7')]((0x0,metric_logger_1[a1_0x2eb9('0xe')])(_0x1a5ca3));}catch(_0x31fc45){_0x248bba[a1_0x2eb9('0x7')](((_0x5486ca=_0x31fc45===null||_0x31fc45===void 0x0?void 0x0:_0x31fc45[a1_0x2eb9('0x9')])===null||_0x5486ca===void 0x0?void 0x0:_0x5486ca[a1_0x2eb9('0x8')])?(0x0,metric_logger_1['mapRespToPerfEntry'])(_0x31fc45[a1_0x2eb9('0x9')][a1_0x2eb9('0x8')]):metric_logger_1[a1_0x2eb9('0xc')]);output[a1_0x2eb9('0xd')]({'title':_0x31fc45[a1_0x2eb9('0x1')]});process[a1_0x2eb9('0x15')](0x1);}});}['completeRunGroup'](_0x1254b5){var _0x29a2e7;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x295687=(0x0,metric_logger_1[a1_0x2eb9('0x0')])(a1_0x2eb9('0x10'));try{const _0x307a51=yield(0x0,axios_1[a1_0x2eb9('0x17')])(()=>this['apiAxiosInstance'][a1_0x2eb9('0x11')](a1_0x2eb9('0x6'),{'runGroup':_0x1254b5}));_0x295687[a1_0x2eb9('0x7')]((0x0,metric_logger_1[a1_0x2eb9('0xe')])(_0x307a51));}catch(_0x1b817d){_0x295687[a1_0x2eb9('0x7')](((_0x29a2e7=_0x1b817d===null||_0x1b817d===void 0x0?void 0x0:_0x1b817d['axiosException'])===null||_0x29a2e7===void 0x0?void 0x0:_0x29a2e7[a1_0x2eb9('0x8')])?(0x0,metric_logger_1['mapRespToPerfEntry'])(_0x1b817d[a1_0x2eb9('0x9')][a1_0x2eb9('0x8')]):metric_logger_1['RUNNER_FAILURE_PERF_ENTRY']);output[a1_0x2eb9('0xd')]({'title':_0x1b817d['message']});process['exit'](0x1);}});}}exports[a1_0x2eb9('0x13')]=RunGroupApi;
@@ -1,93 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CloudEnabledLifeCycle = void 0;
4
- const serializer_overrides_1 = require("../../../utilities/serializer-overrides");
5
- const read_task_terminal_output_1 = require("../../terminal-output/read-task-terminal-output");
6
- class CloudEnabledLifeCycle {
7
- constructor(runContext, cacheDirectory, collectTerminalOutput, cacheableOperations, outputObfuscator, tasks) {
8
- this.runContext = runContext;
9
- this.cacheDirectory = cacheDirectory;
10
- this.collectTerminalOutput = collectTerminalOutput;
11
- this.cacheableOperations = cacheableOperations;
12
- this.outputObfuscator = outputObfuscator;
13
- this.tasks = tasks;
14
- }
15
- scheduleTask(task) {
16
- this.runContext.scheduledTasks.push(task);
17
- }
18
- // this gets called for every tasks that starts.
19
- startTask(task) {
20
- this.tasks.push({
21
- taskId: task.id,
22
- startTime: new Date().toISOString(),
23
- target: task.target.target,
24
- projectName: task.target.project,
25
- hash: task.hash,
26
- hashDetails: this.cleanUpHashDetails(task.hashDetails),
27
- params: (0, serializer_overrides_1.serializeOverrides)(task),
28
- uploadedToStorage: false,
29
- });
30
- }
31
- endTasks(tasks) {
32
- // this can be called multiple times changing this time.
33
- for (let t of tasks) {
34
- let cacheStatus;
35
- const taskIsRemoteCacheHit = t.status === 'remote-cache';
36
- const taskIsLocalCacheHitPreNx135 = t.status === 'cache';
37
- const taskIsLocalCacheHit = t.status === 'local-cache' ||
38
- t.status === 'local-cache-kept-existing' ||
39
- taskIsLocalCacheHitPreNx135;
40
- if (this.runContext.statuses[t.task.hash]) {
41
- cacheStatus = this.runContext.statuses[t.task.hash];
42
- }
43
- else if (taskIsRemoteCacheHit) {
44
- cacheStatus = 'remote-cache-hit';
45
- }
46
- else if (taskIsLocalCacheHit) {
47
- cacheStatus = 'local-cache-hit';
48
- }
49
- else {
50
- cacheStatus = 'cache-miss';
51
- }
52
- this.updateStartedTask(t, cacheStatus);
53
- }
54
- }
55
- endCommand() { }
56
- updateStartedTask(result, cacheStatus) {
57
- const startedTask = this.tasks.find((t) => t.taskId === result.task.id);
58
- if (!startedTask) {
59
- throw new Error(`Cannot find task ${result.task.id}`);
60
- }
61
- if ((result === null || result === void 0 ? void 0 : result.startTime) && (result === null || result === void 0 ? void 0 : result.endTime)) {
62
- startedTask.startTime = new Date(result.startTime).toISOString();
63
- startedTask.endTime = new Date(result.endTime).toISOString();
64
- }
65
- else {
66
- startedTask.endTime = new Date().toISOString();
67
- }
68
- startedTask.status = result.code;
69
- startedTask.params = this.outputObfuscator.obfuscate(startedTask.params);
70
- startedTask.cacheStatus = cacheStatus;
71
- if (this.collectTerminalOutput) {
72
- startedTask.terminalOutput = this.getTerminalOutput(result.task.hash, startedTask.cacheStatus, result.code);
73
- }
74
- }
75
- getTerminalOutput(hash, cacheStatus, code) {
76
- return (0, read_task_terminal_output_1.readTaskTerminalOutput)(this.cacheDirectory, this.outputObfuscator, hash, cacheStatus, code);
77
- }
78
- cleanUpHashDetails(hashDetails) {
79
- const nodes = {};
80
- Object.keys(hashDetails.nodes)
81
- .filter((k) => !k.startsWith('npm:'))
82
- .forEach((k) => {
83
- nodes[k] = hashDetails.nodes[k];
84
- });
85
- return {
86
- nodes,
87
- runtime: hashDetails.runtime,
88
- implicitDeps: hashDetails.implicitDeps,
89
- };
90
- }
91
- }
92
- exports.CloudEnabledLifeCycle = CloudEnabledLifeCycle;
93
- //# sourceMappingURL=cloud-enabled-life-cycle.js.map
1
+ const a0_0x192c=['cacheDirectory','startTime','remote-cache','startTask','__esModule','project','cache-miss','updateStartedTask','serializeOverrides','defineProperty','hash','readTaskTerminalOutput','code','endCommand','cleanUpHashDetails','../../../utilities/serializer-overrides','remote-cache-hit','tasks','find','endTasks','status','hashDetails','runContext','statuses','endTime','local-cache-hit','params','npm:','task','outputObfuscator','../../terminal-output/read-task-terminal-output','local-cache','toISOString','cacheStatus','obfuscate','filter','local-cache-kept-existing','collectTerminalOutput','target','scheduledTasks','push','startsWith','taskId','getTerminalOutput','keys','cache','CloudEnabledLifeCycle','scheduleTask','forEach'];(function(_0x11d493,_0x192c24){const _0x32a486=function(_0x1611b1){while(--_0x1611b1){_0x11d493['push'](_0x11d493['shift']());}};_0x32a486(++_0x192c24);}(a0_0x192c,0xae));const a0_0x32a4=function(_0x11d493,_0x192c24){_0x11d493=_0x11d493-0x0;let _0x32a486=a0_0x192c[_0x11d493];return _0x32a486;};'use strict';Object[a0_0x32a4('0x1f')](exports,a0_0x32a4('0x1a'),{'value':!![]});exports[a0_0x32a4('0x13')]=void 0x0;const serializer_overrides_1=require(a0_0x32a4('0x25'));const read_task_terminal_output_1=require(a0_0x32a4('0x3'));class CloudEnabledLifeCycle{constructor(_0x5365e4,_0x4395ee,_0x4e1f45,_0x49a4bc,_0x2cfe67,_0x253c3c){this['runContext']=_0x5365e4;this[a0_0x32a4('0x16')]=_0x4395ee;this[a0_0x32a4('0xa')]=_0x4e1f45;this['cacheableOperations']=_0x49a4bc;this[a0_0x32a4('0x2')]=_0x2cfe67;this[a0_0x32a4('0x27')]=_0x253c3c;}[a0_0x32a4('0x14')](_0x38b335){this['runContext'][a0_0x32a4('0xc')][a0_0x32a4('0xd')](_0x38b335);}[a0_0x32a4('0x19')](_0x4734e3){this[a0_0x32a4('0x27')][a0_0x32a4('0xd')]({'taskId':_0x4734e3['id'],'startTime':new Date()[a0_0x32a4('0x5')](),'target':_0x4734e3['target'][a0_0x32a4('0xb')],'projectName':_0x4734e3['target'][a0_0x32a4('0x1b')],'hash':_0x4734e3[a0_0x32a4('0x20')],'hashDetails':this['cleanUpHashDetails'](_0x4734e3[a0_0x32a4('0x2b')]),'params':(0x0,serializer_overrides_1[a0_0x32a4('0x1e')])(_0x4734e3),'uploadedToStorage':![]});}[a0_0x32a4('0x29')](_0x13e3e7){for(let _0xa0d96b of _0x13e3e7){let _0x246bcc;const _0x1844bb=_0xa0d96b[a0_0x32a4('0x2a')]===a0_0x32a4('0x18');const _0x585b30=_0xa0d96b[a0_0x32a4('0x2a')]===a0_0x32a4('0x12');const _0x321970=_0xa0d96b[a0_0x32a4('0x2a')]===a0_0x32a4('0x4')||_0xa0d96b['status']===a0_0x32a4('0x9')||_0x585b30;if(this[a0_0x32a4('0x2c')][a0_0x32a4('0x2d')][_0xa0d96b['task'][a0_0x32a4('0x20')]]){_0x246bcc=this['runContext']['statuses'][_0xa0d96b[a0_0x32a4('0x1')]['hash']];}else if(_0x1844bb){_0x246bcc=a0_0x32a4('0x26');}else if(_0x321970){_0x246bcc=a0_0x32a4('0x2f');}else{_0x246bcc=a0_0x32a4('0x1c');}this[a0_0x32a4('0x1d')](_0xa0d96b,_0x246bcc);}}[a0_0x32a4('0x23')](){}[a0_0x32a4('0x1d')](_0x558ae5,_0x246b8a){const _0x1c93cf=this[a0_0x32a4('0x27')][a0_0x32a4('0x28')](_0x2121fb=>_0x2121fb[a0_0x32a4('0xf')]===_0x558ae5['task']['id']);if(!_0x1c93cf){throw new Error('Cannot\x20find\x20task\x20'+_0x558ae5[a0_0x32a4('0x1')]['id']);}if((_0x558ae5===null||_0x558ae5===void 0x0?void 0x0:_0x558ae5[a0_0x32a4('0x17')])&&(_0x558ae5===null||_0x558ae5===void 0x0?void 0x0:_0x558ae5[a0_0x32a4('0x2e')])){_0x1c93cf[a0_0x32a4('0x17')]=new Date(_0x558ae5[a0_0x32a4('0x17')])[a0_0x32a4('0x5')]();_0x1c93cf['endTime']=new Date(_0x558ae5['endTime'])[a0_0x32a4('0x5')]();}else{_0x1c93cf[a0_0x32a4('0x2e')]=new Date()['toISOString']();}_0x1c93cf[a0_0x32a4('0x2a')]=_0x558ae5[a0_0x32a4('0x22')];_0x1c93cf['params']=this[a0_0x32a4('0x2')][a0_0x32a4('0x7')](_0x1c93cf[a0_0x32a4('0x30')]);_0x1c93cf['cacheStatus']=_0x246b8a;if(this[a0_0x32a4('0xa')]){_0x1c93cf['terminalOutput']=this[a0_0x32a4('0x10')](_0x558ae5[a0_0x32a4('0x1')][a0_0x32a4('0x20')],_0x1c93cf[a0_0x32a4('0x6')],_0x558ae5['code']);}}[a0_0x32a4('0x10')](_0x1c6baf,_0x2fa62a,_0x222f4e){return(0x0,read_task_terminal_output_1[a0_0x32a4('0x21')])(this[a0_0x32a4('0x16')],this[a0_0x32a4('0x2')],_0x1c6baf,_0x2fa62a,_0x222f4e);}[a0_0x32a4('0x24')](_0x2dfd01){const _0x22e9d1={};Object[a0_0x32a4('0x11')](_0x2dfd01['nodes'])[a0_0x32a4('0x8')](_0x429a4b=>!_0x429a4b[a0_0x32a4('0xe')](a0_0x32a4('0x0')))[a0_0x32a4('0x15')](_0x3a10fb=>{_0x22e9d1[_0x3a10fb]=_0x2dfd01['nodes'][_0x3a10fb];});return{'nodes':_0x22e9d1,'runtime':_0x2dfd01['runtime'],'implicitDeps':_0x2dfd01['implicitDeps']};}}exports[a0_0x32a4('0x13')]=CloudEnabledLifeCycle;
@@ -1,316 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.cloudEnabledTasksRunner = void 0;
13
- const message_reporter_1 = require("../../terminal-output/message-reporter");
14
- const end_of_run_message_1 = require("../../terminal-output/end-of-run-message");
15
- const output_obfuscator_1 = require("../../terminal-output/output-obfuscator");
16
- const cloud_enabled_life_cycle_1 = require("./cloud-enabled-life-cycle");
17
- const file_storage_1 = require("../../file-storage/file-storage");
18
- const e2e_encryption_1 = require("../../file-storage/e2e-encryption");
19
- const environment_1 = require("../../../utilities/environment");
20
- const cloud_remote_cache_1 = require("./cloud-remote-cache");
21
- const cloud_run_api_1 = require("./cloud-run.api");
22
- const fs_1 = require("fs");
23
- const path = require("path");
24
- const path_1 = require("path");
25
- const metric_logger_1 = require("../../../utilities/metric-logger");
26
- const error_reporter_api_1 = require("../../api/error-reporter.api");
27
- const fs_extra_1 = require("fs-extra");
28
- const id_generator_1 = require("./id-generator");
29
- const { tasksRunner, output } = require('../../../utilities/nx-imports');
30
- function createApi(errors, options, runContext) {
31
- const machineInfo = (0, environment_1.getMachineInfo)(options);
32
- return new cloud_run_api_1.CloudRunApi(errors, runContext, options, machineInfo);
33
- }
34
- function storeTaskHashes(taskExecutions, directory, distributedExecutionId) {
35
- const hashes = JSON.stringify(taskExecutions.map((t) => ({
36
- taskId: t.taskId,
37
- hash: t.hash,
38
- })));
39
- if (environment_1.VERBOSE_LOGGING) {
40
- output.note({
41
- title: `Executed tasks with hashes: ${hashes}`,
42
- });
43
- }
44
- (0, fs_1.writeFileSync)(path.join(directory, `tasks-hashes-${distributedExecutionId}`), hashes);
45
- }
46
- /*
47
- * It can happen that a task is executed multiple times on an agent, say for DTE1 and DTE2.
48
- * When it runs for DTE2, it will be a local cache hit, so it will be marked as completed.
49
- * However, Nx won't upload an artifact to S3 in this case. Usually this isn't a problem,
50
- * cause the first DTE would have uploaded it. But if you are using a DTE, with a read-only token,
51
- * the uploaded artifact will have a different scoped hash.
52
- *
53
- * To address this: we are finding all local cache hits, and upload everything that has a put url.
54
- */
55
- function storeLocalCacheHits(taskExecutions, remoteCache, nxCacheDirectory) {
56
- const hashes = taskExecutions
57
- .filter((t) => t.cacheStatus === 'local-cache-hit')
58
- .map((t) => t.hash);
59
- hashes.forEach((hash) => remoteCache.store(hash, nxCacheDirectory));
60
- }
61
- function onComplete({ daemon, options, fileStorage, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner, encryptionKey, storeInCurrentProcess, distributedExecutionId, runContext, }) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- const runEndTime = new Date().toISOString();
64
- const branch = (0, environment_1.getBranch)();
65
- const runData = {
66
- command: outputObfuscator.obfuscate((0, environment_1.parseCommand)()),
67
- startTime: runStartTime,
68
- endTime: runEndTime,
69
- distributedExecutionId,
70
- branch: branch,
71
- scan: true,
72
- runGroup: (0, environment_1.getRunGroup)(),
73
- // only set sha if branch is set because we invoke a separate process,
74
- // which adds a few millis
75
- sha: branch ? (0, environment_1.extractGitSha)() : undefined,
76
- inner: inner,
77
- };
78
- if (storeInCurrentProcess) {
79
- if ((0, environment_1.agentRunningInDistributedExecution)(distributedExecutionId)) {
80
- const nxCacheDirectory = (0, environment_1.getNxCacheDirectory)(options);
81
- storeTaskHashes(taskExecutions, nxCacheDirectory, distributedExecutionId);
82
- storeLocalCacheHits(taskExecutions, remoteCache, nxCacheDirectory);
83
- }
84
- try {
85
- yield remoteCache.waitForStoreRequestsToComplete();
86
- }
87
- catch (e) {
88
- output.error({
89
- title: `Nx Cloud wasn't able to store artifacts.`,
90
- });
91
- messages.printMessages();
92
- return false;
93
- }
94
- for (const hash of fileStorage.storedHashes) {
95
- const matchingTask = taskExecutions.find((t) => t.hash === hash);
96
- if (!matchingTask) {
97
- throw new Error(`Task with hash ${hash} isn't recorded`);
98
- }
99
- matchingTask.uploadedToStorage = true;
100
- }
101
- try {
102
- yield api.endRun(runData, taskExecutions);
103
- }
104
- catch (e) {
105
- output.error({
106
- title: `Nx Cloud wasn't able to record its run.`,
107
- });
108
- messages.printMessages();
109
- return false;
110
- }
111
- yield (0, metric_logger_1.submitRunMetrics)(options);
112
- return true;
113
- }
114
- else {
115
- try {
116
- const accessToken = environment_1.ACCESS_TOKEN ? environment_1.ACCESS_TOKEN : options.accessToken;
117
- const linkId = (0, id_generator_1.generateUniqueLinkId)();
118
- yield daemon.processInBackground('@nrwl/nx-cloud/lib/daemon/process-run-end', {
119
- encryptionKey,
120
- runnerOptions: Object.assign(Object.assign({}, options), { accessToken }),
121
- delayedStoreRequests: remoteCache.delayedStoreRequests,
122
- runEnd: {
123
- runData,
124
- taskExecutions,
125
- linkId,
126
- },
127
- });
128
- runContext.runUrl = `${options.url || 'https://nx.app'}/runs/${linkId}`;
129
- return true;
130
- }
131
- catch (e) {
132
- output.warn({
133
- title: `Nx Cloud Problems`,
134
- bodyLines: [e.message || e.toString()],
135
- });
136
- return false;
137
- }
138
- }
139
- // this workaround is required because prior to Nx 13.3 we printed
140
- // the end message after the runner completes, so we need to wait for the
141
- // message to appear in the right place
142
- if (versionOfNxBefore133) {
143
- setTimeout(() => {
144
- messages.printMessages();
145
- if (!messages.anyErrors && !inner) {
146
- endOfRunMessage.printCacheHitsMessage();
147
- }
148
- }, 0);
149
- }
150
- else {
151
- messages.printMessages();
152
- if (!messages.anyErrors && !inner) {
153
- endOfRunMessage.printCacheHitsMessage();
154
- }
155
- }
156
- });
157
- }
158
- function createLifeCycle(runContext, options, outputObfuscator, tasks) {
159
- const cloudEnabledLifeCycle = new cloud_enabled_life_cycle_1.CloudEnabledLifeCycle(runContext, (0, environment_1.getNxCacheDirectory)(options), options.scan === undefined ? true : options.scan, options.cacheableOperations || [], outputObfuscator, tasks);
160
- try {
161
- const { CompositeLifeCycle } = require('../../../utilities/nx-imports');
162
- if (!CompositeLifeCycle)
163
- return cloudEnabledLifeCycle;
164
- return new CompositeLifeCycle([options.lifeCycle, cloudEnabledLifeCycle]);
165
- }
166
- catch (e) {
167
- return cloudEnabledLifeCycle;
168
- }
169
- }
170
- function fetchUrlsForKnownHashesUpfront(api, runContext, tasks, options, distributedExecutionId) {
171
- return __awaiter(this, void 0, void 0, function* () {
172
- let hashes = tasks.map((t) => t.hash).filter((h) => !!h);
173
- const cachePath = (0, environment_1.getNxCacheDirectory)(options);
174
- if (!options.skipNxCache) {
175
- // filter out the urls that don't have artifact stored locally
176
- const promises = yield Promise.all(hashes.map((hash) => {
177
- const tdCommit = (0, path_1.join)(cachePath, `${hash}.commit`);
178
- return (0, fs_extra_1.pathExists)(tdCommit);
179
- }));
180
- const missingHashes = [];
181
- for (let i = 0; i < promises.length; ++i) {
182
- if (promises[i]) {
183
- missingHashes.push(hashes[i]);
184
- }
185
- }
186
- hashes = missingHashes;
187
- }
188
- if (hashes.length > 0) {
189
- const startRunRequest = api.startRun(distributedExecutionId, hashes);
190
- for (const hash of hashes) {
191
- runContext.requests[hash] = startRunRequest;
192
- }
193
- }
194
- });
195
- }
196
- function cloudEnabledTasksRunner(tasks, options, context, inner = false) {
197
- var _a;
198
- const distributedExecutionId = process.env.NX_CLOUD_DISTRIBUTED_EXECUTION_ID;
199
- const runContext = {
200
- statuses: {},
201
- scheduledTasks: [],
202
- requests: {},
203
- allTasks: tasks,
204
- };
205
- const versionOfNxBefore133 = options.lifeCycle === undefined;
206
- const taskExecutions = [];
207
- const messages = new message_reporter_1.MessageReporter(options);
208
- const api = createApi(messages, options, runContext);
209
- const endOfRunMessage = new end_of_run_message_1.EndOfRunMessage(runContext, taskExecutions, distributedExecutionId);
210
- const outputObfuscator = new output_obfuscator_1.OutputObfuscator(options.maskedProperties);
211
- const runStartTime = new Date().toISOString();
212
- const lifeCycle = createLifeCycle(runContext, options, outputObfuscator, taskExecutions);
213
- const encryptionKey = environment_1.ENCRYPTION_KEY || options.encryptionKey;
214
- const encryption = new e2e_encryption_1.E2EEncryption(encryptionKey);
215
- const errorApi = new error_reporter_api_1.ErrorReporterApi(options);
216
- const storeInCurrentProcess = (0, environment_1.agentRunningInDistributedExecution)(distributedExecutionId) ||
217
- !((_a = context.daemon) === null || _a === void 0 ? void 0 : _a.enabled());
218
- const fileStorage = new file_storage_1.FileStorage(encryption, errorApi);
219
- const remoteCache = new cloud_remote_cache_1.CloudRemoteCache(messages, api, runContext, fileStorage, distributedExecutionId, storeInCurrentProcess);
220
- // we don't await for it cause this step is optional
221
- fetchUrlsForKnownHashesUpfront(api, runContext, tasks, options, distributedExecutionId);
222
- // have to reset it so we don't capture inner tasks
223
- delete process.env.NX_CLOUD_DISTRIBUTED_EXECUTION_ID;
224
- const res = tasksRunner(tasks, Object.assign(Object.assign({}, options), { remoteCache, lifeCycle }), context);
225
- // observable -> legacy
226
- if (res.subscribe) {
227
- const { Subject } = require('rxjs/internal/Subject');
228
- const wrappedRes = new Subject();
229
- res.subscribe({
230
- next: (value) => wrappedRes.next(value),
231
- error: (err) => wrappedRes.error(err),
232
- complete: () => __awaiter(this, void 0, void 0, function* () {
233
- const success = yield onComplete({
234
- daemon: context.daemon,
235
- options,
236
- fileStorage,
237
- remoteCache,
238
- api,
239
- outputObfuscator,
240
- runStartTime,
241
- messages,
242
- endOfRunMessage,
243
- taskExecutions,
244
- versionOfNxBefore133,
245
- inner,
246
- encryptionKey,
247
- storeInCurrentProcess,
248
- runContext,
249
- distributedExecutionId,
250
- });
251
- if (!success &&
252
- (0, environment_1.agentRunningInDistributedExecution)(distributedExecutionId)) {
253
- process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
254
- }
255
- wrappedRes.complete();
256
- }),
257
- });
258
- return wrappedRes;
259
- // promise
260
- }
261
- else {
262
- return res
263
- .then((r) => __awaiter(this, void 0, void 0, function* () {
264
- const success = yield onComplete({
265
- daemon: context.daemon,
266
- options,
267
- fileStorage,
268
- remoteCache,
269
- api,
270
- outputObfuscator,
271
- runStartTime,
272
- messages,
273
- endOfRunMessage,
274
- taskExecutions,
275
- versionOfNxBefore133,
276
- inner,
277
- encryptionKey,
278
- storeInCurrentProcess,
279
- runContext,
280
- distributedExecutionId,
281
- });
282
- if (!success &&
283
- (0, environment_1.agentRunningInDistributedExecution)(distributedExecutionId)) {
284
- process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
285
- }
286
- return r;
287
- }))
288
- .catch((e) => __awaiter(this, void 0, void 0, function* () {
289
- const success = yield onComplete({
290
- daemon: context.daemon,
291
- options,
292
- fileStorage,
293
- remoteCache,
294
- api,
295
- outputObfuscator,
296
- runStartTime,
297
- messages,
298
- endOfRunMessage,
299
- taskExecutions,
300
- versionOfNxBefore133,
301
- inner,
302
- encryptionKey,
303
- storeInCurrentProcess,
304
- runContext,
305
- distributedExecutionId,
306
- });
307
- if (!success &&
308
- (0, environment_1.agentRunningInDistributedExecution)(distributedExecutionId)) {
309
- process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
310
- }
311
- throw e;
312
- }));
313
- }
314
- }
315
- exports.cloudEnabledTasksRunner = cloudEnabledTasksRunner;
316
- //# sourceMappingURL=cloud-enabled.runner.js.map
1
+ const a1_0x2e5d=['find','encryptionKey','apply','E2EEncryption','defineProperty','daemon','subscribe','../../terminal-output/output-obfuscator','rxjs/internal/Subject','note','@nrwl/nx-cloud/lib/daemon/process-run-end','ACCESS_TOKEN','throw','ENCRYPTION_KEY','cacheableOperations','../../../utilities/nx-imports','Nx\x20Cloud\x20Problems','getMachineInfo','env','local-cache-hit','filter','cacheStatus','skipNxCache','../../../utilities/metric-logger','scan','storedHashes','delayedStoreRequests','OutputObfuscator','./id-generator','/runs/','getBranch','__awaiter','next','writeFileSync','waitForStoreRequestsToComplete','done','join','CloudRemoteCache','runUrl','url','Nx\x20Cloud\x20wasn\x27t\x20able\x20to\x20store\x20artifacts.','enabled','all','MessageReporter','uploadedToStorage','maskedProperties','value','../../../utilities/environment','agentRunningInDistributedExecution','hash','https://nx.app','VERBOSE_LOGGING','printMessages','../../file-storage/file-storage','warn','./cloud-run.api','Nx\x20Cloud\x20wasn\x27t\x20able\x20to\x20record\x20its\x20run.','toISOString','NX_CLOUD_DISTRIBUTED_EXECUTION_ID','../../api/error-reporter.api','startRun','forEach','lifeCycle','path','complete','accessToken','DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE','length','Executed\x20tasks\x20with\x20hashes:\x20','getRunGroup','endRun','extractGitSha','Task\x20with\x20hash\x20','then','stringify','printCacheHitsMessage','message','assign','tasks-hashes-','cloudEnabledTasksRunner','exit','store','.commit','map','anyErrors','push','\x20isn\x27t\x20recorded','../../terminal-output/message-reporter','error','./cloud-remote-cache','processInBackground','requests','generateUniqueLinkId'];(function(_0x4a77c2,_0x2e5d98){const _0x251580=function(_0x73af99){while(--_0x73af99){_0x4a77c2['push'](_0x4a77c2['shift']());}};_0x251580(++_0x2e5d98);}(a1_0x2e5d,0x19d));const a1_0x2515=function(_0x4a77c2,_0x2e5d98){_0x4a77c2=_0x4a77c2-0x0;let _0x251580=a1_0x2e5d[_0x4a77c2];return _0x251580;};'use strict';var __awaiter=this&&this[a1_0x2515('0x53')]||function(_0x4b9ffd,_0x2adbdc,_0x32c702,_0x2d9423){function _0xeab10a(_0x18cea3){return _0x18cea3 instanceof _0x32c702?_0x18cea3:new _0x32c702(function(_0x5aceb6){_0x5aceb6(_0x18cea3);});}return new(_0x32c702||(_0x32c702=Promise))(function(_0x522702,_0x518818){function _0x12e602(_0x3f9f3e){try{_0x1110ce(_0x2d9423[a1_0x2515('0x54')](_0x3f9f3e));}catch(_0x4b5017){_0x518818(_0x4b5017);}}function _0x15dbc0(_0x42f939){try{_0x1110ce(_0x2d9423[a1_0x2515('0x40')](_0x42f939));}catch(_0x9d91d2){_0x518818(_0x9d91d2);}}function _0x1110ce(_0x1cefcc){_0x1cefcc[a1_0x2515('0x57')]?_0x522702(_0x1cefcc[a1_0x2515('0x5')]):_0xeab10a(_0x1cefcc[a1_0x2515('0x5')])[a1_0x2515('0x20')](_0x12e602,_0x15dbc0);}_0x1110ce((_0x2d9423=_0x2d9423[a1_0x2515('0x36')](_0x4b9ffd,_0x2adbdc||[]))[a1_0x2515('0x54')]());});};Object[a1_0x2515('0x38')](exports,'__esModule',{'value':!![]});exports[a1_0x2515('0x26')]=void 0x0;const message_reporter_1=require(a1_0x2515('0x2e'));const end_of_run_message_1=require('../../terminal-output/end-of-run-message');const output_obfuscator_1=require(a1_0x2515('0x3b'));const cloud_enabled_life_cycle_1=require('./cloud-enabled-life-cycle');const file_storage_1=require(a1_0x2515('0xc'));const e2e_encryption_1=require('../../file-storage/e2e-encryption');const environment_1=require(a1_0x2515('0x6'));const cloud_remote_cache_1=require(a1_0x2515('0x30'));const cloud_run_api_1=require(a1_0x2515('0xe'));const fs_1=require('fs');const path=require(a1_0x2515('0x16'));const path_1=require(a1_0x2515('0x16'));const metric_logger_1=require(a1_0x2515('0x4b'));const error_reporter_api_1=require(a1_0x2515('0x12'));const fs_extra_1=require('fs-extra');const id_generator_1=require(a1_0x2515('0x50'));const {tasksRunner,output}=require(a1_0x2515('0x43'));function createApi(_0x1a1a2b,_0x2aed30,_0x34ca56){const _0x34d5be=(0x0,environment_1[a1_0x2515('0x45')])(_0x2aed30);return new cloud_run_api_1['CloudRunApi'](_0x1a1a2b,_0x34ca56,_0x2aed30,_0x34d5be);}function storeTaskHashes(_0x3f3099,_0x555890,_0x1692d9){const _0x809d62=JSON[a1_0x2515('0x21')](_0x3f3099[a1_0x2515('0x2a')](_0xa98748=>({'taskId':_0xa98748['taskId'],'hash':_0xa98748[a1_0x2515('0x8')]})));if(environment_1[a1_0x2515('0xa')]){output[a1_0x2515('0x3d')]({'title':a1_0x2515('0x1b')+_0x809d62});}(0x0,fs_1[a1_0x2515('0x55')])(path[a1_0x2515('0x58')](_0x555890,a1_0x2515('0x25')+_0x1692d9),_0x809d62);}function storeLocalCacheHits(_0x528b8f,_0x265b94,_0x17b0aa){const _0x23f1b2=_0x528b8f[a1_0x2515('0x48')](_0xf447ba=>_0xf447ba[a1_0x2515('0x49')]===a1_0x2515('0x47'))[a1_0x2515('0x2a')](_0xb310e9=>_0xb310e9[a1_0x2515('0x8')]);_0x23f1b2[a1_0x2515('0x14')](_0x3c1f41=>_0x265b94[a1_0x2515('0x28')](_0x3c1f41,_0x17b0aa));}function onComplete({daemon,options,fileStorage,remoteCache,api,outputObfuscator,runStartTime,messages,endOfRunMessage,taskExecutions,versionOfNxBefore133,inner,encryptionKey,storeInCurrentProcess,distributedExecutionId,runContext}){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x8546a7=new Date()[a1_0x2515('0x10')]();const _0x138afd=(0x0,environment_1[a1_0x2515('0x52')])();const _0x492a21={'command':outputObfuscator['obfuscate']((0x0,environment_1['parseCommand'])()),'startTime':runStartTime,'endTime':_0x8546a7,'distributedExecutionId':distributedExecutionId,'branch':_0x138afd,'scan':!![],'runGroup':(0x0,environment_1[a1_0x2515('0x1c')])(),'sha':_0x138afd?(0x0,environment_1[a1_0x2515('0x1e')])():undefined,'inner':inner};if(storeInCurrentProcess){if((0x0,environment_1[a1_0x2515('0x7')])(distributedExecutionId)){const _0x29d751=(0x0,environment_1['getNxCacheDirectory'])(options);storeTaskHashes(taskExecutions,_0x29d751,distributedExecutionId);storeLocalCacheHits(taskExecutions,remoteCache,_0x29d751);}try{yield remoteCache[a1_0x2515('0x56')]();}catch(_0x34cf83){output[a1_0x2515('0x2f')]({'title':a1_0x2515('0x5c')});messages[a1_0x2515('0xb')]();return![];}for(const _0x1e5166 of fileStorage[a1_0x2515('0x4d')]){const _0xb43234=taskExecutions[a1_0x2515('0x34')](_0x48f3a3=>_0x48f3a3[a1_0x2515('0x8')]===_0x1e5166);if(!_0xb43234){throw new Error(a1_0x2515('0x1f')+_0x1e5166+a1_0x2515('0x2d'));}_0xb43234[a1_0x2515('0x3')]=!![];}try{yield api[a1_0x2515('0x1d')](_0x492a21,taskExecutions);}catch(_0x339a15){output['error']({'title':a1_0x2515('0xf')});messages[a1_0x2515('0xb')]();return![];}yield(0x0,metric_logger_1['submitRunMetrics'])(options);return!![];}else{try{const _0x23dd02=environment_1[a1_0x2515('0x3f')]?environment_1[a1_0x2515('0x3f')]:options[a1_0x2515('0x18')];const _0xe1a6fb=(0x0,id_generator_1[a1_0x2515('0x33')])();yield daemon[a1_0x2515('0x31')](a1_0x2515('0x3e'),{'encryptionKey':encryptionKey,'runnerOptions':Object[a1_0x2515('0x24')](Object[a1_0x2515('0x24')]({},options),{'accessToken':_0x23dd02}),'delayedStoreRequests':remoteCache[a1_0x2515('0x4e')],'runEnd':{'runData':_0x492a21,'taskExecutions':taskExecutions,'linkId':_0xe1a6fb}});runContext[a1_0x2515('0x5a')]=(options[a1_0x2515('0x5b')]||a1_0x2515('0x9'))+a1_0x2515('0x51')+_0xe1a6fb;return!![];}catch(_0x166fe8){output[a1_0x2515('0xd')]({'title':a1_0x2515('0x44'),'bodyLines':[_0x166fe8[a1_0x2515('0x23')]||_0x166fe8['toString']()]});return![];}}if(versionOfNxBefore133){setTimeout(()=>{messages[a1_0x2515('0xb')]();if(!messages[a1_0x2515('0x2b')]&&!inner){endOfRunMessage['printCacheHitsMessage']();}},0x0);}else{messages[a1_0x2515('0xb')]();if(!messages[a1_0x2515('0x2b')]&&!inner){endOfRunMessage[a1_0x2515('0x22')]();}}});}function createLifeCycle(_0x1944ef,_0x3588cf,_0x3e7b36,_0x29cdde){const _0x5ae1ea=new cloud_enabled_life_cycle_1['CloudEnabledLifeCycle'](_0x1944ef,(0x0,environment_1['getNxCacheDirectory'])(_0x3588cf),_0x3588cf[a1_0x2515('0x4c')]===undefined?!![]:_0x3588cf[a1_0x2515('0x4c')],_0x3588cf[a1_0x2515('0x42')]||[],_0x3e7b36,_0x29cdde);try{const {CompositeLifeCycle}=require(a1_0x2515('0x43'));if(!CompositeLifeCycle)return _0x5ae1ea;return new CompositeLifeCycle([_0x3588cf[a1_0x2515('0x15')],_0x5ae1ea]);}catch(_0x5a91e7){return _0x5ae1ea;}}function fetchUrlsForKnownHashesUpfront(_0x579e34,_0x37b5c1,_0xcf6440,_0x19cd75,_0x5e5b94){return __awaiter(this,void 0x0,void 0x0,function*(){let _0x484712=_0xcf6440[a1_0x2515('0x2a')](_0x351a2b=>_0x351a2b[a1_0x2515('0x8')])[a1_0x2515('0x48')](_0x212273=>!!_0x212273);const _0x7deec9=(0x0,environment_1['getNxCacheDirectory'])(_0x19cd75);if(!_0x19cd75[a1_0x2515('0x4a')]){const _0x1f0b47=yield Promise[a1_0x2515('0x1')](_0x484712[a1_0x2515('0x2a')](_0x4d18e8=>{const _0x34abe3=(0x0,path_1[a1_0x2515('0x58')])(_0x7deec9,_0x4d18e8+a1_0x2515('0x29'));return(0x0,fs_extra_1['pathExists'])(_0x34abe3);}));const _0x535bc2=[];for(let _0xbc25b4=0x0;_0xbc25b4<_0x1f0b47[a1_0x2515('0x1a')];++_0xbc25b4){if(_0x1f0b47[_0xbc25b4]){_0x535bc2[a1_0x2515('0x2c')](_0x484712[_0xbc25b4]);}}_0x484712=_0x535bc2;}if(_0x484712['length']>0x0){const _0xba82e6=_0x579e34[a1_0x2515('0x13')](_0x5e5b94,_0x484712);for(const _0x4c86e5 of _0x484712){_0x37b5c1[a1_0x2515('0x32')][_0x4c86e5]=_0xba82e6;}}});}function cloudEnabledTasksRunner(_0xaa31b9,_0x4b1c9d,_0x3daa17,_0x25c52a=![]){var _0x3f1768;const _0x244acc=process['env'][a1_0x2515('0x11')];const _0x897728={'statuses':{},'scheduledTasks':[],'requests':{},'allTasks':_0xaa31b9};const _0x3be434=_0x4b1c9d['lifeCycle']===undefined;const _0x51cc36=[];const _0x46047f=new message_reporter_1[(a1_0x2515('0x2'))](_0x4b1c9d);const _0x19b4cc=createApi(_0x46047f,_0x4b1c9d,_0x897728);const _0x1f93db=new end_of_run_message_1['EndOfRunMessage'](_0x897728,_0x51cc36,_0x244acc);const _0x463218=new output_obfuscator_1[(a1_0x2515('0x4f'))](_0x4b1c9d[a1_0x2515('0x4')]);const _0x125c83=new Date()[a1_0x2515('0x10')]();const _0x461c2d=createLifeCycle(_0x897728,_0x4b1c9d,_0x463218,_0x51cc36);const _0x3d17d1=environment_1[a1_0x2515('0x41')]||_0x4b1c9d[a1_0x2515('0x35')];const _0x26f7f1=new e2e_encryption_1[(a1_0x2515('0x37'))](_0x3d17d1);const _0x22dd0a=new error_reporter_api_1['ErrorReporterApi'](_0x4b1c9d);const _0x4052ec=(0x0,environment_1[a1_0x2515('0x7')])(_0x244acc)||!((_0x3f1768=_0x3daa17[a1_0x2515('0x39')])===null||_0x3f1768===void 0x0?void 0x0:_0x3f1768[a1_0x2515('0x0')]());const _0x5e0c12=new file_storage_1['FileStorage'](_0x26f7f1,_0x22dd0a);const _0x21010d=new cloud_remote_cache_1[(a1_0x2515('0x59'))](_0x46047f,_0x19b4cc,_0x897728,_0x5e0c12,_0x244acc,_0x4052ec);fetchUrlsForKnownHashesUpfront(_0x19b4cc,_0x897728,_0xaa31b9,_0x4b1c9d,_0x244acc);delete process[a1_0x2515('0x46')][a1_0x2515('0x11')];const _0x5d876d=tasksRunner(_0xaa31b9,Object[a1_0x2515('0x24')](Object['assign']({},_0x4b1c9d),{'remoteCache':_0x21010d,'lifeCycle':_0x461c2d}),_0x3daa17);if(_0x5d876d[a1_0x2515('0x3a')]){const {Subject}=require(a1_0x2515('0x3c'));const _0x543ef5=new Subject();_0x5d876d['subscribe']({'next':_0x324ebd=>_0x543ef5[a1_0x2515('0x54')](_0x324ebd),'error':_0x1518c1=>_0x543ef5[a1_0x2515('0x2f')](_0x1518c1),'complete':()=>__awaiter(this,void 0x0,void 0x0,function*(){const _0x102f86=yield onComplete({'daemon':_0x3daa17[a1_0x2515('0x39')],'options':_0x4b1c9d,'fileStorage':_0x5e0c12,'remoteCache':_0x21010d,'api':_0x19b4cc,'outputObfuscator':_0x463218,'runStartTime':_0x125c83,'messages':_0x46047f,'endOfRunMessage':_0x1f93db,'taskExecutions':_0x51cc36,'versionOfNxBefore133':_0x3be434,'inner':_0x25c52a,'encryptionKey':_0x3d17d1,'storeInCurrentProcess':_0x4052ec,'runContext':_0x897728,'distributedExecutionId':_0x244acc});if(!_0x102f86&&(0x0,environment_1[a1_0x2515('0x7')])(_0x244acc)){process[a1_0x2515('0x27')](environment_1[a1_0x2515('0x19')]);}_0x543ef5[a1_0x2515('0x17')]();})});return _0x543ef5;}else{return _0x5d876d[a1_0x2515('0x20')](_0xa0f3ab=>__awaiter(this,void 0x0,void 0x0,function*(){const _0x45dee3=yield onComplete({'daemon':_0x3daa17[a1_0x2515('0x39')],'options':_0x4b1c9d,'fileStorage':_0x5e0c12,'remoteCache':_0x21010d,'api':_0x19b4cc,'outputObfuscator':_0x463218,'runStartTime':_0x125c83,'messages':_0x46047f,'endOfRunMessage':_0x1f93db,'taskExecutions':_0x51cc36,'versionOfNxBefore133':_0x3be434,'inner':_0x25c52a,'encryptionKey':_0x3d17d1,'storeInCurrentProcess':_0x4052ec,'runContext':_0x897728,'distributedExecutionId':_0x244acc});if(!_0x45dee3&&(0x0,environment_1[a1_0x2515('0x7')])(_0x244acc)){process[a1_0x2515('0x27')](environment_1['DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE']);}return _0xa0f3ab;}))['catch'](_0x51dad5=>__awaiter(this,void 0x0,void 0x0,function*(){const _0x1c3921=yield onComplete({'daemon':_0x3daa17[a1_0x2515('0x39')],'options':_0x4b1c9d,'fileStorage':_0x5e0c12,'remoteCache':_0x21010d,'api':_0x19b4cc,'outputObfuscator':_0x463218,'runStartTime':_0x125c83,'messages':_0x46047f,'endOfRunMessage':_0x1f93db,'taskExecutions':_0x51cc36,'versionOfNxBefore133':_0x3be434,'inner':_0x25c52a,'encryptionKey':_0x3d17d1,'storeInCurrentProcess':_0x4052ec,'runContext':_0x897728,'distributedExecutionId':_0x244acc});if(!_0x1c3921&&(0x0,environment_1[a1_0x2515('0x7')])(_0x244acc)){process[a1_0x2515('0x27')](environment_1[a1_0x2515('0x19')]);}throw _0x51dad5;}));}}exports[a1_0x2515('0x26')]=cloudEnabledTasksRunner;