@nrwl/nx-cloud 14.4.0-beta.2 → 14.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/api/error-reporter.api.js +1 -36
- package/lib/core/api/run-group.api.js +1 -65
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +1 -156
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +1 -176
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +1 -113
- package/lib/core/runners/cloud-enabled/cloud-run.api.js +1 -166
- package/lib/core/runners/distributed-agent/distributed-agent.api.js +1 -79
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js +1 -252
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js.map +1 -1
- package/lib/core/runners/distributed-execution/distributed-execution.api.js +1 -143
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js +1 -217
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js +1 -37
- package/lib/core/runners/distributed-execution/task-graph-creator.js +1 -77
- package/package.json +1 -1
- package/tsconfig.spec.json +2 -1
|
@@ -1,36 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ErrorReporterApi = void 0;
|
|
13
|
-
const axios_1 = require("../../utilities/axios");
|
|
14
|
-
const { output } = require('../../utilities/nx-imports');
|
|
15
|
-
class ErrorReporterApi {
|
|
16
|
-
constructor(options) {
|
|
17
|
-
this.apiAxiosInstance = (0, axios_1.createApiAxiosInstance)(options);
|
|
18
|
-
}
|
|
19
|
-
reportError(message) {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
try {
|
|
22
|
-
yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/report-client-error', {
|
|
23
|
-
message,
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
output.warn({
|
|
28
|
-
title: `Unable to record the following error: '${message}'`,
|
|
29
|
-
bodyLines: [e.message],
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.ErrorReporterApi = ErrorReporterApi;
|
|
36
|
-
//# sourceMappingURL=error-reporter.api.js.map
|
|
1
|
+
const a0_0x37a7=['value','message','defineProperty','/nx-cloud/report-client-error','apiAxiosInstance','apply','reportError','post','done','__awaiter','../../utilities/nx-imports','next','axiosMultipleTries','createApiAxiosInstance','ErrorReporterApi','throw','../../utilities/axios'];(function(_0x55dcd9,_0x37a7fc){const _0x34e4d5=function(_0x2ee2fd){while(--_0x2ee2fd){_0x55dcd9['push'](_0x55dcd9['shift']());}};_0x34e4d5(++_0x37a7fc);}(a0_0x37a7,0x7a));const a0_0x34e4=function(_0x55dcd9,_0x37a7fc){_0x55dcd9=_0x55dcd9-0x0;let _0x34e4d5=a0_0x37a7[_0x55dcd9];return _0x34e4d5;};'use strict';var __awaiter=this&&this[a0_0x34e4('0x6')]||function(_0x3af607,_0x1f7a3a,_0x56750e,_0x46e509){function _0x443d94(_0x513175){return _0x513175 instanceof _0x56750e?_0x513175:new _0x56750e(function(_0x1bddec){_0x1bddec(_0x513175);});}return new(_0x56750e||(_0x56750e=Promise))(function(_0x3b5aad,_0x59962f){function _0x4a984a(_0x439a8f){try{_0x3df56f(_0x46e509[a0_0x34e4('0x8')](_0x439a8f));}catch(_0x3f04c1){_0x59962f(_0x3f04c1);}}function _0x3b0f2e(_0x3ba5e6){try{_0x3df56f(_0x46e509[a0_0x34e4('0xc')](_0x3ba5e6));}catch(_0x1a259d){_0x59962f(_0x1a259d);}}function _0x3df56f(_0x101a75){_0x101a75[a0_0x34e4('0x5')]?_0x3b5aad(_0x101a75[a0_0x34e4('0xe')]):_0x443d94(_0x101a75[a0_0x34e4('0xe')])['then'](_0x4a984a,_0x3b0f2e);}_0x3df56f((_0x46e509=_0x46e509[a0_0x34e4('0x2')](_0x3af607,_0x1f7a3a||[]))[a0_0x34e4('0x8')]());});};Object[a0_0x34e4('0x10')](exports,'__esModule',{'value':!![]});exports[a0_0x34e4('0xb')]=void 0x0;const axios_1=require(a0_0x34e4('0xd'));const {output}=require(a0_0x34e4('0x7'));class ErrorReporterApi{constructor(_0x5f2229){this[a0_0x34e4('0x1')]=(0x0,axios_1[a0_0x34e4('0xa')])(_0x5f2229);}[a0_0x34e4('0x3')](_0x56ed22){return __awaiter(this,void 0x0,void 0x0,function*(){try{yield(0x0,axios_1[a0_0x34e4('0x9')])(()=>this[a0_0x34e4('0x1')][a0_0x34e4('0x4')](a0_0x34e4('0x0'),{'message':_0x56ed22}));}catch(_0xf1a76a){output['warn']({'title':'Unable\x20to\x20record\x20the\x20following\x20error:\x20\x27'+_0x56ed22+'\x27','bodyLines':[_0xf1a76a[a0_0x34e4('0xf')]]});}});}}exports[a0_0x34e4('0xb')]=ErrorReporterApi;
|
|
@@ -1,65 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RunGroupApi = void 0;
|
|
13
|
-
const axios_1 = require("../../utilities/axios");
|
|
14
|
-
const metric_logger_1 = require("../../utilities/metric-logger");
|
|
15
|
-
const { output } = require('../../utilities/nx-imports');
|
|
16
|
-
class RunGroupApi {
|
|
17
|
-
constructor(options) {
|
|
18
|
-
this.apiAxiosInstance = (0, axios_1.createApiAxiosInstance)(options);
|
|
19
|
-
}
|
|
20
|
-
createRunGroup(branch, runGroup) {
|
|
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: branch,
|
|
27
|
-
runGroup: runGroup,
|
|
28
|
-
}));
|
|
29
|
-
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
30
|
-
}
|
|
31
|
-
catch (e) {
|
|
32
|
-
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
33
|
-
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
34
|
-
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
35
|
-
output.error({
|
|
36
|
-
title: e.message,
|
|
37
|
-
});
|
|
38
|
-
process.exit(1);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
completeRunGroup(runGroup) {
|
|
43
|
-
var _a;
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const recorder = (0, metric_logger_1.createMetricRecorder)('createRunGroup');
|
|
46
|
-
try {
|
|
47
|
-
const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/complete-run-group', {
|
|
48
|
-
runGroup: runGroup,
|
|
49
|
-
}));
|
|
50
|
-
recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
|
|
51
|
-
}
|
|
52
|
-
catch (e) {
|
|
53
|
-
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
54
|
-
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
55
|
-
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
56
|
-
output.error({
|
|
57
|
-
title: e.message,
|
|
58
|
-
});
|
|
59
|
-
process.exit(1);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.RunGroupApi = RunGroupApi;
|
|
65
|
-
//# sourceMappingURL=run-group.api.js.map
|
|
1
|
+
const a1_0x39ae=['__esModule','apply','RunGroupApi','recordMetric','mapRespToPerfEntry','next','../../utilities/metric-logger','createRunGroup','../../utilities/axios','then','response','/nx-cloud/executions/create-run-group','message','RUNNER_FAILURE_PERF_ENTRY','axiosMultipleTries','defineProperty','value','post','throw','error','createApiAxiosInstance','done','exit','__awaiter','axiosException','apiAxiosInstance','createMetricRecorder'];(function(_0x2b7a18,_0x39ae8d){const _0x28a0a3=function(_0x9b1555){while(--_0x9b1555){_0x2b7a18['push'](_0x2b7a18['shift']());}};_0x28a0a3(++_0x39ae8d);}(a1_0x39ae,0x11a));const a1_0x28a0=function(_0x2b7a18,_0x39ae8d){_0x2b7a18=_0x2b7a18-0x0;let _0x28a0a3=a1_0x39ae[_0x2b7a18];return _0x28a0a3;};'use strict';var __awaiter=this&&this[a1_0x28a0('0xb')]||function(_0x5a175d,_0x50e4a1,_0x460ea7,_0x9bae3c){function _0x46e298(_0x434fe4){return _0x434fe4 instanceof _0x460ea7?_0x434fe4:new _0x460ea7(function(_0x3902f0){_0x3902f0(_0x434fe4);});}return new(_0x460ea7||(_0x460ea7=Promise))(function(_0x17b8b7,_0x141ef7){function _0x5c4ec8(_0x33dfc6){try{_0x4c8c45(_0x9bae3c['next'](_0x33dfc6));}catch(_0x1afe9e){_0x141ef7(_0x1afe9e);}}function _0x263924(_0x794413){try{_0x4c8c45(_0x9bae3c[a1_0x28a0('0x6')](_0x794413));}catch(_0x293d3f){_0x141ef7(_0x293d3f);}}function _0x4c8c45(_0x5c4146){_0x5c4146[a1_0x28a0('0x9')]?_0x17b8b7(_0x5c4146[a1_0x28a0('0x4')]):_0x46e298(_0x5c4146['value'])[a1_0x28a0('0x18')](_0x5c4ec8,_0x263924);}_0x4c8c45((_0x9bae3c=_0x9bae3c[a1_0x28a0('0x10')](_0x5a175d,_0x50e4a1||[]))[a1_0x28a0('0x14')]());});};Object[a1_0x28a0('0x3')](exports,a1_0x28a0('0xf'),{'value':!![]});exports[a1_0x28a0('0x11')]=void 0x0;const axios_1=require(a1_0x28a0('0x17'));const metric_logger_1=require(a1_0x28a0('0x15'));const {output}=require('../../utilities/nx-imports');class RunGroupApi{constructor(_0x13dbec){this[a1_0x28a0('0xd')]=(0x0,axios_1[a1_0x28a0('0x8')])(_0x13dbec);}['createRunGroup'](_0x5bdd93,_0x194245){var _0x21c379;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x1a5f72=(0x0,metric_logger_1[a1_0x28a0('0xe')])(a1_0x28a0('0x16'));try{const _0x1c2827=yield(0x0,axios_1[a1_0x28a0('0x2')])(()=>this['apiAxiosInstance'][a1_0x28a0('0x5')](a1_0x28a0('0x1a'),{'branch':_0x5bdd93,'runGroup':_0x194245}));_0x1a5f72[a1_0x28a0('0x12')]((0x0,metric_logger_1['mapRespToPerfEntry'])(_0x1c2827));}catch(_0x37d1c1){_0x1a5f72[a1_0x28a0('0x12')](((_0x21c379=_0x37d1c1===null||_0x37d1c1===void 0x0?void 0x0:_0x37d1c1[a1_0x28a0('0xc')])===null||_0x21c379===void 0x0?void 0x0:_0x21c379[a1_0x28a0('0x19')])?(0x0,metric_logger_1[a1_0x28a0('0x13')])(_0x37d1c1[a1_0x28a0('0xc')][a1_0x28a0('0x19')]):metric_logger_1[a1_0x28a0('0x1')]);output['error']({'title':_0x37d1c1['message']});process['exit'](0x1);}});}['completeRunGroup'](_0x16c318){var _0x4af3ea;return __awaiter(this,void 0x0,void 0x0,function*(){const _0x5daf2e=(0x0,metric_logger_1[a1_0x28a0('0xe')])(a1_0x28a0('0x16'));try{const _0x578072=yield(0x0,axios_1[a1_0x28a0('0x2')])(()=>this[a1_0x28a0('0xd')]['post']('/nx-cloud/executions/complete-run-group',{'runGroup':_0x16c318}));_0x5daf2e[a1_0x28a0('0x12')]((0x0,metric_logger_1[a1_0x28a0('0x13')])(_0x578072));}catch(_0x29a8e4){_0x5daf2e[a1_0x28a0('0x12')](((_0x4af3ea=_0x29a8e4===null||_0x29a8e4===void 0x0?void 0x0:_0x29a8e4[a1_0x28a0('0xc')])===null||_0x4af3ea===void 0x0?void 0x0:_0x4af3ea[a1_0x28a0('0x19')])?(0x0,metric_logger_1[a1_0x28a0('0x13')])(_0x29a8e4['axiosException'][a1_0x28a0('0x19')]):metric_logger_1[a1_0x28a0('0x1')]);output[a1_0x28a0('0x7')]({'title':_0x29a8e4[a1_0x28a0('0x0')]});process[a1_0x28a0('0xa')](0x1);}});}}exports[a1_0x28a0('0x11')]=RunGroupApi;
|
|
@@ -1,156 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CloudEnabledLifeCycle = void 0;
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const fs_1 = require("fs");
|
|
7
|
-
const environment_1 = require("../../../utilities/environment");
|
|
8
|
-
const serializer_overrides_1 = require("../../../utilities/serializer-overrides");
|
|
9
|
-
const { workspaceRoot } = require('../../../utilities/nx-imports');
|
|
10
|
-
class CloudEnabledLifeCycle {
|
|
11
|
-
constructor(runContext, cacheDirectory, skipNxCache, collectTerminalOutput, cacheableOperations, outputObfuscator, tasks) {
|
|
12
|
-
this.runContext = runContext;
|
|
13
|
-
this.cacheDirectory = cacheDirectory;
|
|
14
|
-
this.skipNxCache = skipNxCache;
|
|
15
|
-
this.collectTerminalOutput = collectTerminalOutput;
|
|
16
|
-
this.cacheableOperations = cacheableOperations;
|
|
17
|
-
this.outputObfuscator = outputObfuscator;
|
|
18
|
-
this.tasks = tasks;
|
|
19
|
-
}
|
|
20
|
-
scheduleTask(task) {
|
|
21
|
-
this.runContext.scheduledTasks.push(task);
|
|
22
|
-
}
|
|
23
|
-
startTask(task) {
|
|
24
|
-
this.tasks.push({
|
|
25
|
-
taskId: task.id,
|
|
26
|
-
startTime: new Date().toISOString(),
|
|
27
|
-
target: task.target.target,
|
|
28
|
-
projectName: task.target.project,
|
|
29
|
-
hash: task.hash,
|
|
30
|
-
hashDetails: this.cleanUpHashDetails(task.hashDetails),
|
|
31
|
-
params: (0, serializer_overrides_1.serializeOverrides)(task),
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
// Used for older version for Nx. Remove in Dec 2022
|
|
35
|
-
endTask(task, code) {
|
|
36
|
-
let cacheStatus;
|
|
37
|
-
if (this.runContext.statuses[task.hash]) {
|
|
38
|
-
cacheStatus = this.runContext.statuses[task.hash];
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
if (this.cacheableOperations.indexOf(task.target.target) > -1 &&
|
|
42
|
-
!this.skipNxCache) {
|
|
43
|
-
cacheStatus = 'local-cache-hit';
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
cacheStatus = 'cache-miss';
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
this.updateStartedTask(task, code, cacheStatus);
|
|
50
|
-
}
|
|
51
|
-
endTasks(tasks) {
|
|
52
|
-
for (let t of tasks) {
|
|
53
|
-
let cacheStatus;
|
|
54
|
-
const taskIsRemoteCacheHit = t.status === 'remote-cache';
|
|
55
|
-
const taskIsLocalCacheHitPreNx135 = t.status === 'cache';
|
|
56
|
-
const taskIsLocalCacheHit = t.status === 'local-cache' ||
|
|
57
|
-
t.status === 'local-cache-kept-existing' ||
|
|
58
|
-
taskIsLocalCacheHitPreNx135;
|
|
59
|
-
if (this.runContext.statuses[t.task.hash]) {
|
|
60
|
-
cacheStatus = this.runContext.statuses[t.task.hash];
|
|
61
|
-
}
|
|
62
|
-
else if (taskIsRemoteCacheHit) {
|
|
63
|
-
cacheStatus = 'remote-cache-hit';
|
|
64
|
-
}
|
|
65
|
-
else if (taskIsLocalCacheHit) {
|
|
66
|
-
cacheStatus = 'local-cache-hit';
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
if (this.cacheableOperations.indexOf(t.task.target.target) > -1 &&
|
|
70
|
-
!this.skipNxCache) {
|
|
71
|
-
cacheStatus = 'local-cache-hit';
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
cacheStatus = 'cache-miss';
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
this.updateStartedTask(t.task, t.code, cacheStatus);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
endCommand() { }
|
|
81
|
-
updateStartedTask(task, code, cacheStatus) {
|
|
82
|
-
const startedTask = this.tasks.find((t) => t.taskId === task.id);
|
|
83
|
-
if (!startedTask) {
|
|
84
|
-
throw new Error(`Cannot find task ${task.id}`);
|
|
85
|
-
}
|
|
86
|
-
startedTask.endTime = new Date().toISOString();
|
|
87
|
-
startedTask.status = code;
|
|
88
|
-
startedTask.params = this.outputObfuscator.obfuscate(startedTask.params);
|
|
89
|
-
startedTask.cacheStatus = cacheStatus;
|
|
90
|
-
if (this.collectTerminalOutput) {
|
|
91
|
-
startedTask.terminalOutput = this.getTerminalOutput(task.hash, startedTask.cacheStatus, code);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
getTerminalOutput(hash, cacheStatus, code) {
|
|
95
|
-
let dir;
|
|
96
|
-
if (this.cacheDirectory) {
|
|
97
|
-
if (this.cacheDirectory.startsWith('./')) {
|
|
98
|
-
dir = (0, path_1.join)(workspaceRoot, this.cacheDirectory);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
dir = this.cacheDirectory;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
dir = (0, path_1.join)(workspaceRoot, 'node_modules', '.cache', 'nx');
|
|
106
|
-
}
|
|
107
|
-
try {
|
|
108
|
-
const taskOutput = this.readTerminalOutputFile(dir, hash);
|
|
109
|
-
const taskOutputSanitized = this.outputObfuscator.obfuscate(taskOutput);
|
|
110
|
-
if (environment_1.NX_CLOUD_UNLIMITED_OUTPUT)
|
|
111
|
-
return taskOutputSanitized;
|
|
112
|
-
const maxCharacters = cacheStatus === 'cache-miss'
|
|
113
|
-
? code === 0
|
|
114
|
-
? CloudEnabledLifeCycle.MAX_CHARACTERS_SUCCESSFUL_TASK
|
|
115
|
-
: CloudEnabledLifeCycle.MAX_CHARACTERS_FAILED_TASK
|
|
116
|
-
: CloudEnabledLifeCycle.MAX_CHARACTERS_CACHED_TASK;
|
|
117
|
-
return taskOutputSanitized.length > maxCharacters
|
|
118
|
-
? `TRUNCATED\n\n${taskOutputSanitized.slice(taskOutputSanitized.length - maxCharacters)}`
|
|
119
|
-
: taskOutputSanitized;
|
|
120
|
-
}
|
|
121
|
-
catch (e) {
|
|
122
|
-
return '';
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
cleanUpHashDetails(hashDetails) {
|
|
126
|
-
const nodes = {};
|
|
127
|
-
Object.keys(hashDetails.nodes)
|
|
128
|
-
.filter((k) => !k.startsWith('npm:'))
|
|
129
|
-
.forEach((k) => {
|
|
130
|
-
nodes[k] = hashDetails.nodes[k];
|
|
131
|
-
});
|
|
132
|
-
return {
|
|
133
|
-
nodes,
|
|
134
|
-
runtime: hashDetails.runtime,
|
|
135
|
-
implicitDeps: hashDetails.implicitDeps,
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
readTerminalOutputFile(dir, hash) {
|
|
139
|
-
try {
|
|
140
|
-
return (0, fs_1.readFileSync)(path.join(dir, 'terminalOutputs', hash)).toString();
|
|
141
|
-
}
|
|
142
|
-
catch (_a) {
|
|
143
|
-
try {
|
|
144
|
-
return (0, fs_1.readFileSync)(path.join(dir, hash, 'terminalOutput')).toString();
|
|
145
|
-
}
|
|
146
|
-
catch (_b) {
|
|
147
|
-
return '';
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
exports.CloudEnabledLifeCycle = CloudEnabledLifeCycle;
|
|
153
|
-
CloudEnabledLifeCycle.MAX_CHARACTERS_FAILED_TASK = 200000;
|
|
154
|
-
CloudEnabledLifeCycle.MAX_CHARACTERS_SUCCESSFUL_TASK = 20000;
|
|
155
|
-
CloudEnabledLifeCycle.MAX_CHARACTERS_CACHED_TASK = 20000;
|
|
156
|
-
//# sourceMappingURL=cloud-enabled-life-cycle.js.map
|
|
1
|
+
const a0_0x17e9=['tasks','MAX_CHARACTERS_SUCCESSFUL_TASK','node_modules','endCommand','taskId','terminalOutputs','npm:','length','statuses','indexOf','startTask','local-cache-hit','readFileSync','endTime','local-cache','keys','skipNxCache','startsWith','push','join','cache-miss','getTerminalOutput','MAX_CHARACTERS_FAILED_TASK','filter','path','../../../utilities/environment','status','runtime','MAX_CHARACTERS_CACHED_TASK','nodes','cacheableOperations','readTerminalOutputFile','CloudEnabledLifeCycle','remote-cache-hit','task','updateStartedTask','scheduleTask','../../../utilities/serializer-overrides','cacheDirectory','params','Cannot\x20find\x20task\x20','runContext','implicitDeps','.cache','terminalOutput','local-cache-kept-existing','toString','cacheStatus','target','collectTerminalOutput','toISOString','project','cleanUpHashDetails','remote-cache','obfuscate','hash','slice'];(function(_0x4c996f,_0x17e964){const _0xe92cb1=function(_0x4a56ac){while(--_0x4a56ac){_0x4c996f['push'](_0x4c996f['shift']());}};_0xe92cb1(++_0x17e964);}(a0_0x17e9,0x1a6));const a0_0xe92c=function(_0x4c996f,_0x17e964){_0x4c996f=_0x4c996f-0x0;let _0xe92cb1=a0_0x17e9[_0x4c996f];return _0xe92cb1;};'use strict';Object['defineProperty'](exports,'__esModule',{'value':!![]});exports[a0_0xe92c('0x9')]=void 0x0;const path=require(a0_0xe92c('0x1'));const path_1=require(a0_0xe92c('0x1'));const fs_1=require('fs');const environment_1=require(a0_0xe92c('0x2'));const serializer_overrides_1=require(a0_0xe92c('0xe'));const {workspaceRoot}=require('../../../utilities/nx-imports');class CloudEnabledLifeCycle{constructor(_0xacd90c,_0x2c1e2a,_0xac956d,_0x555885,_0x17cff0,_0x2d70d0,_0xae4dfb){this['runContext']=_0xacd90c;this[a0_0xe92c('0xf')]=_0x2c1e2a;this[a0_0xe92c('0x32')]=_0xac956d;this[a0_0xe92c('0x1a')]=_0x555885;this[a0_0xe92c('0x7')]=_0x17cff0;this['outputObfuscator']=_0x2d70d0;this[a0_0xe92c('0x22')]=_0xae4dfb;}[a0_0xe92c('0xd')](_0x2cb4fa){this['runContext']['scheduledTasks'][a0_0xe92c('0x34')](_0x2cb4fa);}[a0_0xe92c('0x2c')](_0x522c44){this[a0_0xe92c('0x22')][a0_0xe92c('0x34')]({'taskId':_0x522c44['id'],'startTime':new Date()[a0_0xe92c('0x1b')](),'target':_0x522c44[a0_0xe92c('0x19')][a0_0xe92c('0x19')],'projectName':_0x522c44[a0_0xe92c('0x19')][a0_0xe92c('0x1c')],'hash':_0x522c44['hash'],'hashDetails':this['cleanUpHashDetails'](_0x522c44['hashDetails']),'params':(0x0,serializer_overrides_1['serializeOverrides'])(_0x522c44)});}['endTask'](_0x161fa4,_0x45d562){let _0x2b9352;if(this[a0_0xe92c('0x12')]['statuses'][_0x161fa4['hash']]){_0x2b9352=this[a0_0xe92c('0x12')][a0_0xe92c('0x2a')][_0x161fa4[a0_0xe92c('0x20')]];}else{if(this['cacheableOperations'][a0_0xe92c('0x2b')](_0x161fa4[a0_0xe92c('0x19')][a0_0xe92c('0x19')])>-0x1&&!this[a0_0xe92c('0x32')]){_0x2b9352='local-cache-hit';}else{_0x2b9352=a0_0xe92c('0x36');}}this[a0_0xe92c('0xc')](_0x161fa4,_0x45d562,_0x2b9352);}['endTasks'](_0x2088e0){for(let _0x4775b9 of _0x2088e0){let _0x39bc76;const _0x57b309=_0x4775b9[a0_0xe92c('0x3')]===a0_0xe92c('0x1e');const _0x591fcc=_0x4775b9[a0_0xe92c('0x3')]==='cache';const _0x540db7=_0x4775b9['status']===a0_0xe92c('0x30')||_0x4775b9[a0_0xe92c('0x3')]===a0_0xe92c('0x16')||_0x591fcc;if(this[a0_0xe92c('0x12')][a0_0xe92c('0x2a')][_0x4775b9[a0_0xe92c('0xb')][a0_0xe92c('0x20')]]){_0x39bc76=this[a0_0xe92c('0x12')][a0_0xe92c('0x2a')][_0x4775b9[a0_0xe92c('0xb')][a0_0xe92c('0x20')]];}else if(_0x57b309){_0x39bc76=a0_0xe92c('0xa');}else if(_0x540db7){_0x39bc76=a0_0xe92c('0x2d');}else{if(this[a0_0xe92c('0x7')][a0_0xe92c('0x2b')](_0x4775b9[a0_0xe92c('0xb')]['target'][a0_0xe92c('0x19')])>-0x1&&!this[a0_0xe92c('0x32')]){_0x39bc76='local-cache-hit';}else{_0x39bc76=a0_0xe92c('0x36');}}this[a0_0xe92c('0xc')](_0x4775b9[a0_0xe92c('0xb')],_0x4775b9['code'],_0x39bc76);}}[a0_0xe92c('0x25')](){}[a0_0xe92c('0xc')](_0x31ef11,_0xa653b2,_0x21e2a6){const _0x5a759c=this[a0_0xe92c('0x22')]['find'](_0x5d74b6=>_0x5d74b6[a0_0xe92c('0x26')]===_0x31ef11['id']);if(!_0x5a759c){throw new Error(a0_0xe92c('0x11')+_0x31ef11['id']);}_0x5a759c[a0_0xe92c('0x2f')]=new Date()[a0_0xe92c('0x1b')]();_0x5a759c[a0_0xe92c('0x3')]=_0xa653b2;_0x5a759c[a0_0xe92c('0x10')]=this['outputObfuscator'][a0_0xe92c('0x1f')](_0x5a759c[a0_0xe92c('0x10')]);_0x5a759c[a0_0xe92c('0x18')]=_0x21e2a6;if(this[a0_0xe92c('0x1a')]){_0x5a759c[a0_0xe92c('0x15')]=this[a0_0xe92c('0x37')](_0x31ef11[a0_0xe92c('0x20')],_0x5a759c[a0_0xe92c('0x18')],_0xa653b2);}}['getTerminalOutput'](_0x50c66a,_0x3440c3,_0x183ac8){let _0x2d06a0;if(this[a0_0xe92c('0xf')]){if(this[a0_0xe92c('0xf')][a0_0xe92c('0x33')]('./')){_0x2d06a0=(0x0,path_1['join'])(workspaceRoot,this[a0_0xe92c('0xf')]);}else{_0x2d06a0=this[a0_0xe92c('0xf')];}}else{_0x2d06a0=(0x0,path_1[a0_0xe92c('0x35')])(workspaceRoot,a0_0xe92c('0x24'),a0_0xe92c('0x14'),'nx');}try{const _0x2d0b3d=this[a0_0xe92c('0x8')](_0x2d06a0,_0x50c66a);const _0x181dfe=this['outputObfuscator'][a0_0xe92c('0x1f')](_0x2d0b3d);if(environment_1['NX_CLOUD_UNLIMITED_OUTPUT'])return _0x181dfe;const _0x22bd10=_0x3440c3===a0_0xe92c('0x36')?_0x183ac8===0x0?CloudEnabledLifeCycle[a0_0xe92c('0x23')]:CloudEnabledLifeCycle[a0_0xe92c('0x38')]:CloudEnabledLifeCycle[a0_0xe92c('0x5')];return _0x181dfe[a0_0xe92c('0x29')]>_0x22bd10?'TRUNCATED\x0a\x0a'+_0x181dfe[a0_0xe92c('0x21')](_0x181dfe['length']-_0x22bd10):_0x181dfe;}catch(_0x107b23){return'';}}[a0_0xe92c('0x1d')](_0x18196a){const _0x144798={};Object[a0_0xe92c('0x31')](_0x18196a['nodes'])[a0_0xe92c('0x0')](_0x535bd9=>!_0x535bd9[a0_0xe92c('0x33')](a0_0xe92c('0x28')))['forEach'](_0xc308b5=>{_0x144798[_0xc308b5]=_0x18196a[a0_0xe92c('0x6')][_0xc308b5];});return{'nodes':_0x144798,'runtime':_0x18196a[a0_0xe92c('0x4')],'implicitDeps':_0x18196a[a0_0xe92c('0x13')]};}['readTerminalOutputFile'](_0x4a5f84,_0x37248f){try{return(0x0,fs_1['readFileSync'])(path[a0_0xe92c('0x35')](_0x4a5f84,a0_0xe92c('0x27'),_0x37248f))[a0_0xe92c('0x17')]();}catch(_0x265336){try{return(0x0,fs_1[a0_0xe92c('0x2e')])(path[a0_0xe92c('0x35')](_0x4a5f84,_0x37248f,a0_0xe92c('0x15')))[a0_0xe92c('0x17')]();}catch(_0x5d2dcb){return'';}}}}exports['CloudEnabledLifeCycle']=CloudEnabledLifeCycle;CloudEnabledLifeCycle[a0_0xe92c('0x38')]=0x30d40;CloudEnabledLifeCycle['MAX_CHARACTERS_SUCCESSFUL_TASK']=0x4e20;CloudEnabledLifeCycle['MAX_CHARACTERS_CACHED_TASK']=0x4e20;
|
|
@@ -1,176 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.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 metric_logger_1 = require("../../../utilities/metric-logger");
|
|
25
|
-
const error_reporter_api_1 = require("../../api/error-reporter.api");
|
|
26
|
-
const { tasksRunner, output } = require('../../../utilities/nx-imports');
|
|
27
|
-
function createApi(errors, options, runContext) {
|
|
28
|
-
const machineInfo = (0, environment_1.getMachineInfo)(options);
|
|
29
|
-
return new cloud_run_api_1.CloudRunApi(errors, runContext, options, machineInfo);
|
|
30
|
-
}
|
|
31
|
-
function storeTaskHashes(taskExecutions, directory, distributedExecutionId) {
|
|
32
|
-
const hashes = JSON.stringify(taskExecutions.map((t) => ({
|
|
33
|
-
taskId: t.taskId,
|
|
34
|
-
hash: t.hash,
|
|
35
|
-
})));
|
|
36
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
37
|
-
output.note({
|
|
38
|
-
title: `Executed tasks with hashes: ${hashes}`,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
(0, fs_1.writeFileSync)(path.join(directory, `tasks-hashes-${distributedExecutionId}`), hashes);
|
|
42
|
-
}
|
|
43
|
-
function onComplete(lifeCycle, options, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner) {
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const runEndTime = new Date().toISOString();
|
|
46
|
-
const branch = (0, environment_1.getBranch)();
|
|
47
|
-
const runData = {
|
|
48
|
-
command: outputObfuscator.obfuscate((0, environment_1.parseCommand)()),
|
|
49
|
-
startTime: runStartTime,
|
|
50
|
-
endTime: runEndTime,
|
|
51
|
-
distributedExecutionId: environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID,
|
|
52
|
-
branch: branch,
|
|
53
|
-
scan: true,
|
|
54
|
-
runGroup: (0, environment_1.getRunGroup)(),
|
|
55
|
-
// only set sha if branch is set because we invoke a separate process,
|
|
56
|
-
// which adds a few millis
|
|
57
|
-
sha: branch ? (0, environment_1.extractGitSha)() : undefined,
|
|
58
|
-
inner: inner,
|
|
59
|
-
};
|
|
60
|
-
if (environment_1.AGENT_RUNNING_IN_DISTRIBUTED_EXECUTION) {
|
|
61
|
-
storeTaskHashes(taskExecutions, options.cacheDirectory || './node_modules/.cache/nx', environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID);
|
|
62
|
-
try {
|
|
63
|
-
yield remoteCache.waitForStoreRequestsToComplete();
|
|
64
|
-
}
|
|
65
|
-
catch (e) {
|
|
66
|
-
output.error({
|
|
67
|
-
title: `Agent wasn't able to store artifacts`,
|
|
68
|
-
});
|
|
69
|
-
messages.printMessages();
|
|
70
|
-
process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
|
|
71
|
-
}
|
|
72
|
-
try {
|
|
73
|
-
yield api.endRun(runData, taskExecutions);
|
|
74
|
-
}
|
|
75
|
-
catch (e) {
|
|
76
|
-
output.error({
|
|
77
|
-
title: `Agent wasn't able to record its run`,
|
|
78
|
-
});
|
|
79
|
-
messages.printMessages();
|
|
80
|
-
process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
yield Promise.all([
|
|
85
|
-
remoteCache.waitForStoreRequestsToComplete(),
|
|
86
|
-
api.endRun(runData, taskExecutions),
|
|
87
|
-
]);
|
|
88
|
-
}
|
|
89
|
-
// this workaround is required because prior to Nx 13.3 we printed
|
|
90
|
-
// the end message after the runner completes, so we need to wait for the
|
|
91
|
-
// message to appear in the right place
|
|
92
|
-
if (versionOfNxBefore133) {
|
|
93
|
-
setTimeout(() => {
|
|
94
|
-
messages.printMessages();
|
|
95
|
-
if (!messages.anyErrors && !inner) {
|
|
96
|
-
endOfRunMessage.printCacheHitsMessage();
|
|
97
|
-
}
|
|
98
|
-
}, 0);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
messages.printMessages();
|
|
102
|
-
if (!messages.anyErrors && !inner) {
|
|
103
|
-
endOfRunMessage.printCacheHitsMessage();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
yield (0, metric_logger_1.submitRunMetrics)(options);
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
function createLifeCycle(runContext, options, outputObfuscator, tasks) {
|
|
110
|
-
const cloudEnabledLifeCycle = new cloud_enabled_life_cycle_1.CloudEnabledLifeCycle(runContext, options.cacheDirectory, !!options.skipNxCache, options.scan === undefined ? true : options.scan, options.cacheableOperations || [], outputObfuscator, tasks);
|
|
111
|
-
try {
|
|
112
|
-
const { CompositeLifeCycle } = require('../../../utilities/nx-imports');
|
|
113
|
-
if (!CompositeLifeCycle)
|
|
114
|
-
return cloudEnabledLifeCycle;
|
|
115
|
-
return new CompositeLifeCycle([options.lifeCycle, cloudEnabledLifeCycle]);
|
|
116
|
-
}
|
|
117
|
-
catch (e) {
|
|
118
|
-
return cloudEnabledLifeCycle;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function cloudEnabledTasksRunner(tasks, options, context, inner = false) {
|
|
122
|
-
const runContext = {
|
|
123
|
-
statuses: {},
|
|
124
|
-
scheduledTasks: [],
|
|
125
|
-
requests: {},
|
|
126
|
-
allTasks: tasks,
|
|
127
|
-
};
|
|
128
|
-
const versionOfNxBefore133 = options.lifeCycle === undefined;
|
|
129
|
-
const taskExecutions = [];
|
|
130
|
-
const messages = new message_reporter_1.MessageReporter(options);
|
|
131
|
-
const api = createApi(messages, options, runContext);
|
|
132
|
-
const endOfRunMessage = new end_of_run_message_1.EndOfRunMessage(runContext, taskExecutions);
|
|
133
|
-
const outputObfuscator = new output_obfuscator_1.OutputObfuscator(options.maskedProperties);
|
|
134
|
-
const hashes = tasks.map((t) => t.hash).filter((h) => !!h);
|
|
135
|
-
const startRunRequest = api.startRun(environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID, hashes);
|
|
136
|
-
hashes.forEach((hash) => {
|
|
137
|
-
runContext.requests[hash] = startRunRequest;
|
|
138
|
-
});
|
|
139
|
-
const runStartTime = new Date().toISOString();
|
|
140
|
-
const lifeCycle = createLifeCycle(runContext, options, outputObfuscator, taskExecutions);
|
|
141
|
-
const encryption = new e2e_encryption_1.E2EEncryption(environment_1.ENCRYPTION_KEY || options.encryptionKey);
|
|
142
|
-
const errorApi = new error_reporter_api_1.ErrorReporterApi(options);
|
|
143
|
-
const fileStorage = new file_storage_1.FileStorage(encryption, errorApi, false);
|
|
144
|
-
const remoteCache = new cloud_remote_cache_1.CloudRemoteCache(messages, api, runContext, fileStorage);
|
|
145
|
-
// have to reset it so we don't capture inner tasks
|
|
146
|
-
delete process.env.NX_CLOUD_DISTRIBUTED_EXECUTION_ID;
|
|
147
|
-
const res = tasksRunner(tasks, Object.assign(Object.assign({}, options), { remoteCache, lifeCycle }), context);
|
|
148
|
-
// observable -> legacy
|
|
149
|
-
if (res.subscribe) {
|
|
150
|
-
const { Subject } = require('rxjs/internal/Subject');
|
|
151
|
-
const wrappedRes = new Subject();
|
|
152
|
-
res.subscribe({
|
|
153
|
-
next: (value) => wrappedRes.next(value),
|
|
154
|
-
error: (err) => wrappedRes.error(err),
|
|
155
|
-
complete: () => __awaiter(this, void 0, void 0, function* () {
|
|
156
|
-
yield onComplete(lifeCycle, options, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner);
|
|
157
|
-
wrappedRes.complete();
|
|
158
|
-
}),
|
|
159
|
-
});
|
|
160
|
-
return wrappedRes;
|
|
161
|
-
// promise
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
return res
|
|
165
|
-
.then((r) => __awaiter(this, void 0, void 0, function* () {
|
|
166
|
-
yield onComplete(lifeCycle, options, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner);
|
|
167
|
-
return r;
|
|
168
|
-
}))
|
|
169
|
-
.catch((e) => __awaiter(this, void 0, void 0, function* () {
|
|
170
|
-
yield onComplete(lifeCycle, options, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner);
|
|
171
|
-
throw e;
|
|
172
|
-
}));
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
exports.cloudEnabledTasksRunner = cloudEnabledTasksRunner;
|
|
176
|
-
//# sourceMappingURL=cloud-enabled.runner.js.map
|
|
1
|
+
const a1_0x1a87=['filter','requests','../../../utilities/nx-imports','toISOString','Agent\x20wasn\x27t\x20able\x20to\x20store\x20artifacts','taskId','../../../utilities/environment','MessageReporter','complete','ErrorReporterApi','env','map','DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE','../../../utilities/metric-logger','rxjs/internal/Subject','forEach','catch','join','../../file-storage/file-storage','OutputObfuscator','skipNxCache','endRun','subscribe','cacheableOperations','assign','./cloud-enabled-life-cycle','printMessages','./node_modules/.cache/nx','cloudEnabledTasksRunner','./cloud-run.api','anyErrors','value','Agent\x20wasn\x27t\x20able\x20to\x20record\x20its\x20run','ENCRYPTION_KEY','tasks-hashes-','printCacheHitsMessage','throw','exit','extractGitSha','path','getRunGroup','error','../../terminal-output/output-obfuscator','hash','writeFileSync','../../terminal-output/message-reporter','CloudEnabledLifeCycle','Executed\x20tasks\x20with\x20hashes:\x20','stringify','apply','next','all','waitForStoreRequestsToComplete','cacheDirectory','getMachineInfo','parseCommand','CloudRunApi','startRun','NX_CLOUD_DISTRIBUTED_EXECUTION_ID','scan','VERBOSE_LOGGING','../../file-storage/e2e-encryption'];(function(_0x486484,_0x1a8758){const _0x1acf29=function(_0x525fb8){while(--_0x525fb8){_0x486484['push'](_0x486484['shift']());}};_0x1acf29(++_0x1a8758);}(a1_0x1a87,0x194));const a1_0x1acf=function(_0x486484,_0x1a8758){_0x486484=_0x486484-0x0;let _0x1acf29=a1_0x1a87[_0x486484];return _0x1acf29;};'use strict';var __awaiter=this&&this['__awaiter']||function(_0xb78e8b,_0x1ec661,_0x43edab,_0x42c9ad){function _0x287895(_0xb468d5){return _0xb468d5 instanceof _0x43edab?_0xb468d5:new _0x43edab(function(_0x1a0677){_0x1a0677(_0xb468d5);});}return new(_0x43edab||(_0x43edab=Promise))(function(_0x3df26a,_0x4905c0){function _0x3795c6(_0x47f439){try{_0x35532b(_0x42c9ad[a1_0x1acf('0x12')](_0x47f439));}catch(_0x329344){_0x4905c0(_0x329344);}}function _0xeba836(_0x4900fd){try{_0x35532b(_0x42c9ad[a1_0x1acf('0x4')](_0x4900fd));}catch(_0x32b347){_0x4905c0(_0x32b347);}}function _0x35532b(_0x16d77b){_0x16d77b['done']?_0x3df26a(_0x16d77b[a1_0x1acf('0x3d')]):_0x287895(_0x16d77b['value'])['then'](_0x3795c6,_0xeba836);}_0x35532b((_0x42c9ad=_0x42c9ad[a1_0x1acf('0x11')](_0xb78e8b,_0x1ec661||[]))[a1_0x1acf('0x12')]());});};Object['defineProperty'](exports,'__esModule',{'value':!![]});exports[a1_0x1acf('0x3a')]=void 0x0;const message_reporter_1=require(a1_0x1acf('0xd'));const end_of_run_message_1=require('../../terminal-output/end-of-run-message');const output_obfuscator_1=require(a1_0x1acf('0xa'));const cloud_enabled_life_cycle_1=require(a1_0x1acf('0x37'));const file_storage_1=require(a1_0x1acf('0x30'));const e2e_encryption_1=require(a1_0x1acf('0x1d'));const environment_1=require(a1_0x1acf('0x24'));const cloud_remote_cache_1=require('./cloud-remote-cache');const cloud_run_api_1=require(a1_0x1acf('0x3b'));const fs_1=require('fs');const path=require(a1_0x1acf('0x7'));const metric_logger_1=require(a1_0x1acf('0x2b'));const error_reporter_api_1=require('../../api/error-reporter.api');const {tasksRunner,output}=require(a1_0x1acf('0x20'));function createApi(_0x15fb12,_0x210f5b,_0xf473fa){const _0x19b013=(0x0,environment_1[a1_0x1acf('0x16')])(_0x210f5b);return new cloud_run_api_1[(a1_0x1acf('0x18'))](_0x15fb12,_0xf473fa,_0x210f5b,_0x19b013);}function storeTaskHashes(_0x18035c,_0x52e437,_0x43d746){const _0x1df351=JSON[a1_0x1acf('0x10')](_0x18035c[a1_0x1acf('0x29')](_0xeeb9b9=>({'taskId':_0xeeb9b9[a1_0x1acf('0x23')],'hash':_0xeeb9b9[a1_0x1acf('0xb')]})));if(environment_1[a1_0x1acf('0x1c')]){output['note']({'title':a1_0x1acf('0xf')+_0x1df351});}(0x0,fs_1[a1_0x1acf('0xc')])(path[a1_0x1acf('0x2f')](_0x52e437,a1_0x1acf('0x2')+_0x43d746),_0x1df351);}function onComplete(_0x28b235,_0xb65a58,_0x58e209,_0x1bb6dd,_0x26dcd0,_0x2f8bc5,_0x31b266,_0x168fd7,_0x2afab8,_0x5e4c26,_0x53f711){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x20bdb4=new Date()['toISOString']();const _0x440bf6=(0x0,environment_1['getBranch'])();const _0xf258cb={'command':_0x26dcd0['obfuscate']((0x0,environment_1[a1_0x1acf('0x17')])()),'startTime':_0x2f8bc5,'endTime':_0x20bdb4,'distributedExecutionId':environment_1[a1_0x1acf('0x1a')],'branch':_0x440bf6,'scan':!![],'runGroup':(0x0,environment_1[a1_0x1acf('0x8')])(),'sha':_0x440bf6?(0x0,environment_1[a1_0x1acf('0x6')])():undefined,'inner':_0x53f711};if(environment_1['AGENT_RUNNING_IN_DISTRIBUTED_EXECUTION']){storeTaskHashes(_0x2afab8,_0xb65a58[a1_0x1acf('0x15')]||a1_0x1acf('0x39'),environment_1[a1_0x1acf('0x1a')]);try{yield _0x58e209[a1_0x1acf('0x14')]();}catch(_0x448c4e){output[a1_0x1acf('0x9')]({'title':a1_0x1acf('0x22')});_0x31b266[a1_0x1acf('0x38')]();process['exit'](environment_1[a1_0x1acf('0x2a')]);}try{yield _0x1bb6dd[a1_0x1acf('0x33')](_0xf258cb,_0x2afab8);}catch(_0x536af0){output[a1_0x1acf('0x9')]({'title':a1_0x1acf('0x0')});_0x31b266[a1_0x1acf('0x38')]();process[a1_0x1acf('0x5')](environment_1[a1_0x1acf('0x2a')]);}}else{yield Promise[a1_0x1acf('0x13')]([_0x58e209[a1_0x1acf('0x14')](),_0x1bb6dd[a1_0x1acf('0x33')](_0xf258cb,_0x2afab8)]);}if(_0x5e4c26){setTimeout(()=>{_0x31b266[a1_0x1acf('0x38')]();if(!_0x31b266[a1_0x1acf('0x3c')]&&!_0x53f711){_0x168fd7['printCacheHitsMessage']();}},0x0);}else{_0x31b266[a1_0x1acf('0x38')]();if(!_0x31b266[a1_0x1acf('0x3c')]&&!_0x53f711){_0x168fd7[a1_0x1acf('0x3')]();}}yield(0x0,metric_logger_1['submitRunMetrics'])(_0xb65a58);});}function createLifeCycle(_0x5ba68c,_0x29c958,_0x54f1e6,_0x4d4c35){const _0x11c793=new cloud_enabled_life_cycle_1[(a1_0x1acf('0xe'))](_0x5ba68c,_0x29c958['cacheDirectory'],!!_0x29c958[a1_0x1acf('0x32')],_0x29c958[a1_0x1acf('0x1b')]===undefined?!![]:_0x29c958['scan'],_0x29c958[a1_0x1acf('0x35')]||[],_0x54f1e6,_0x4d4c35);try{const {CompositeLifeCycle}=require('../../../utilities/nx-imports');if(!CompositeLifeCycle)return _0x11c793;return new CompositeLifeCycle([_0x29c958['lifeCycle'],_0x11c793]);}catch(_0x539e7d){return _0x11c793;}}function cloudEnabledTasksRunner(_0x25e19f,_0x35b812,_0x1397ed,_0xd30fc0=![]){const _0x3d9118={'statuses':{},'scheduledTasks':[],'requests':{},'allTasks':_0x25e19f};const _0x29cedd=_0x35b812['lifeCycle']===undefined;const _0x59cbbd=[];const _0x616ede=new message_reporter_1[(a1_0x1acf('0x25'))](_0x35b812);const _0x424883=createApi(_0x616ede,_0x35b812,_0x3d9118);const _0x4ded8a=new end_of_run_message_1['EndOfRunMessage'](_0x3d9118,_0x59cbbd);const _0x234db7=new output_obfuscator_1[(a1_0x1acf('0x31'))](_0x35b812['maskedProperties']);const _0x52fdbb=_0x25e19f[a1_0x1acf('0x29')](_0x4cbaf2=>_0x4cbaf2[a1_0x1acf('0xb')])[a1_0x1acf('0x1e')](_0x513be4=>!!_0x513be4);const _0x5ce5ff=_0x424883[a1_0x1acf('0x19')](environment_1[a1_0x1acf('0x1a')],_0x52fdbb);_0x52fdbb[a1_0x1acf('0x2d')](_0x4bdceb=>{_0x3d9118[a1_0x1acf('0x1f')][_0x4bdceb]=_0x5ce5ff;});const _0x101a9c=new Date()[a1_0x1acf('0x21')]();const _0x39b3b6=createLifeCycle(_0x3d9118,_0x35b812,_0x234db7,_0x59cbbd);const _0x3da444=new e2e_encryption_1['E2EEncryption'](environment_1[a1_0x1acf('0x1')]||_0x35b812['encryptionKey']);const _0x498fcd=new error_reporter_api_1[(a1_0x1acf('0x27'))](_0x35b812);const _0x26c13c=new file_storage_1['FileStorage'](_0x3da444,_0x498fcd,![]);const _0x2daffe=new cloud_remote_cache_1['CloudRemoteCache'](_0x616ede,_0x424883,_0x3d9118,_0x26c13c);delete process[a1_0x1acf('0x28')][a1_0x1acf('0x1a')];const _0x5e3192=tasksRunner(_0x25e19f,Object[a1_0x1acf('0x36')](Object[a1_0x1acf('0x36')]({},_0x35b812),{'remoteCache':_0x2daffe,'lifeCycle':_0x39b3b6}),_0x1397ed);if(_0x5e3192[a1_0x1acf('0x34')]){const {Subject}=require(a1_0x1acf('0x2c'));const _0x441b6d=new Subject();_0x5e3192[a1_0x1acf('0x34')]({'next':_0x2c608c=>_0x441b6d[a1_0x1acf('0x12')](_0x2c608c),'error':_0x23c1e5=>_0x441b6d[a1_0x1acf('0x9')](_0x23c1e5),'complete':()=>__awaiter(this,void 0x0,void 0x0,function*(){yield onComplete(_0x39b3b6,_0x35b812,_0x2daffe,_0x424883,_0x234db7,_0x101a9c,_0x616ede,_0x4ded8a,_0x59cbbd,_0x29cedd,_0xd30fc0);_0x441b6d[a1_0x1acf('0x26')]();})});return _0x441b6d;}else{return _0x5e3192['then'](_0x2c656b=>__awaiter(this,void 0x0,void 0x0,function*(){yield onComplete(_0x39b3b6,_0x35b812,_0x2daffe,_0x424883,_0x234db7,_0x101a9c,_0x616ede,_0x4ded8a,_0x59cbbd,_0x29cedd,_0xd30fc0);return _0x2c656b;}))[a1_0x1acf('0x2e')](_0x23dc9a=>__awaiter(this,void 0x0,void 0x0,function*(){yield onComplete(_0x39b3b6,_0x35b812,_0x2daffe,_0x424883,_0x234db7,_0x101a9c,_0x616ede,_0x4ded8a,_0x59cbbd,_0x29cedd,_0xd30fc0);throw _0x23dc9a;}));}}exports[a1_0x1acf('0x3a')]=cloudEnabledTasksRunner;
|
|
@@ -1,113 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CloudRemoteCache = void 0;
|
|
13
|
-
const environment_1 = require("../../../utilities/environment");
|
|
14
|
-
const { output } = require('../../../utilities/nx-imports');
|
|
15
|
-
class CloudRemoteCache {
|
|
16
|
-
constructor(messages, api, runContext, fileStorage) {
|
|
17
|
-
this.messages = messages;
|
|
18
|
-
this.api = api;
|
|
19
|
-
this.runContext = runContext;
|
|
20
|
-
this.fileStorage = fileStorage;
|
|
21
|
-
this.storeRequests = [];
|
|
22
|
-
}
|
|
23
|
-
retrieve(hash, cacheDirectory) {
|
|
24
|
-
var _a;
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
if (this.messages.cacheError)
|
|
27
|
-
return false;
|
|
28
|
-
const hashUrls = yield this.hashUrls(hash);
|
|
29
|
-
if (!hashUrls || !hashUrls.get) {
|
|
30
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
31
|
-
output.note({ title: `Nx Cloud: Cache miss ${hash}.` });
|
|
32
|
-
}
|
|
33
|
-
this.runContext.statuses[hash] = 'cache-miss';
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
yield this.fileStorage.retrieve(hash, hashUrls.get, cacheDirectory);
|
|
38
|
-
this.runContext.statuses[hash] = 'remote-cache-hit';
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
catch (ee) {
|
|
42
|
-
const e = (_a = ee.axiosException) !== null && _a !== void 0 ? _a : ee;
|
|
43
|
-
if (e.response && e.response.status === 404) {
|
|
44
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
45
|
-
output.note({ title: `Nx Cloud: Cache miss ${hash}. Status 404.` });
|
|
46
|
-
}
|
|
47
|
-
// cache miss. print nothing
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
this.messages.cacheError = this.messages.extractErrorMessage(e, 'storage');
|
|
51
|
-
}
|
|
52
|
-
this.runContext.statuses[hash] = 'cache-miss';
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
store(hash, cacheDirectory) {
|
|
58
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
if (this.messages.cacheError)
|
|
60
|
-
return false;
|
|
61
|
-
const res = Promise.resolve().then(() => __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
var _a;
|
|
63
|
-
const hashUrls = yield this.hashUrls(hash);
|
|
64
|
-
if (!hashUrls)
|
|
65
|
-
return false;
|
|
66
|
-
if (!hashUrls.put) {
|
|
67
|
-
if (environment_1.VERBOSE_LOGGING) {
|
|
68
|
-
output.note({
|
|
69
|
-
title: `Nx Cloud: Skipping storing ${hash}. Read only token is used.`,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
try {
|
|
75
|
-
yield this.fileStorage.store(hash, hashUrls.put, cacheDirectory);
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
catch (ee) {
|
|
79
|
-
const e = (_a = ee.axiosException) !== null && _a !== void 0 ? _a : ee;
|
|
80
|
-
this.messages.cacheError = this.messages.extractErrorMessage(e, 'storage');
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
}));
|
|
84
|
-
this.storeRequests.push(res);
|
|
85
|
-
return res;
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
hashUrls(hash) {
|
|
89
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
if (hash in this.runContext.requests) {
|
|
91
|
-
return (yield this.runContext.requests[hash])[hash];
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
const scheduledTaskHashesWithoutRequests = this.runContext.scheduledTasks
|
|
95
|
-
.filter((t) => !this.runContext.requests[t.hash])
|
|
96
|
-
.map((t) => t.hash);
|
|
97
|
-
if (scheduledTaskHashesWithoutRequests.indexOf(hash) === -1) {
|
|
98
|
-
scheduledTaskHashesWithoutRequests.push(hash);
|
|
99
|
-
}
|
|
100
|
-
const request = this.api.startRun(environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID, scheduledTaskHashesWithoutRequests);
|
|
101
|
-
scheduledTaskHashesWithoutRequests.forEach((taskHash) => {
|
|
102
|
-
this.runContext.requests[taskHash] = request;
|
|
103
|
-
});
|
|
104
|
-
return (yield request)[hash];
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
waitForStoreRequestsToComplete() {
|
|
109
|
-
return Promise.all(this.storeRequests).then((r) => r.reduce((a, b) => a && b, true));
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
exports.CloudRemoteCache = CloudRemoteCache;
|
|
113
|
-
//# sourceMappingURL=cloud-remote-cache.js.map
|
|
1
|
+
const a2_0x1555=['messages','all','storage','status','hashUrls','throw','fileStorage','runContext','CloudRemoteCache','value','extractErrorMessage','push','note','cache-miss','Nx\x20Cloud:\x20Cache\x20miss\x20','store','get','.\x20Read\x20only\x20token\x20is\x20used.','reduce','apply','requests','Nx\x20Cloud:\x20Skipping\x20storing\x20','put','storeRequests','indexOf','forEach','VERBOSE_LOGGING','NX_CLOUD_DISTRIBUTED_EXECUTION_ID','api','then','statuses','axiosException','../../../utilities/nx-imports','response','cacheError','startRun','scheduledTasks','../../../utilities/environment','retrieve','resolve'];(function(_0x32fa6e,_0x155555){const _0x33384f=function(_0x5ddd1d){while(--_0x5ddd1d){_0x32fa6e['push'](_0x32fa6e['shift']());}};_0x33384f(++_0x155555);}(a2_0x1555,0x13a));const a2_0x3338=function(_0x32fa6e,_0x155555){_0x32fa6e=_0x32fa6e-0x0;let _0x33384f=a2_0x1555[_0x32fa6e];return _0x33384f;};'use strict';var __awaiter=this&&this['__awaiter']||function(_0x1c8b75,_0x3b34c9,_0xaf879e,_0x529e21){function _0x8e6eba(_0xca54f3){return _0xca54f3 instanceof _0xaf879e?_0xca54f3:new _0xaf879e(function(_0x3fafe5){_0x3fafe5(_0xca54f3);});}return new(_0xaf879e||(_0xaf879e=Promise))(function(_0x5dd898,_0x2fb32f){function _0x5b0b4f(_0x4432ef){try{_0x4ecc52(_0x529e21['next'](_0x4432ef));}catch(_0x37517e){_0x2fb32f(_0x37517e);}}function _0x218eb3(_0x269bac){try{_0x4ecc52(_0x529e21[a2_0x3338('0xb')](_0x269bac));}catch(_0x3f8801){_0x2fb32f(_0x3f8801);}}function _0x4ecc52(_0x29ff70){_0x29ff70['done']?_0x5dd898(_0x29ff70[a2_0x3338('0xf')]):_0x8e6eba(_0x29ff70[a2_0x3338('0xf')])['then'](_0x5b0b4f,_0x218eb3);}_0x4ecc52((_0x529e21=_0x529e21[a2_0x3338('0x19')](_0x1c8b75,_0x3b34c9||[]))['next']());});};Object['defineProperty'](exports,'__esModule',{'value':!![]});exports[a2_0x3338('0xe')]=void 0x0;const environment_1=require(a2_0x3338('0x3'));const {output}=require(a2_0x3338('0x26'));class CloudRemoteCache{constructor(_0x5dae9b,_0x22dba3,_0x27c5f8,_0x17e4ea){this['messages']=_0x5dae9b;this[a2_0x3338('0x22')]=_0x22dba3;this['runContext']=_0x27c5f8;this[a2_0x3338('0xc')]=_0x17e4ea;this[a2_0x3338('0x1d')]=[];}[a2_0x3338('0x4')](_0x202155,_0x44baee){var _0x2fbc25;return __awaiter(this,void 0x0,void 0x0,function*(){if(this[a2_0x3338('0x6')][a2_0x3338('0x0')])return![];const _0x1dd2cb=yield this[a2_0x3338('0xa')](_0x202155);if(!_0x1dd2cb||!_0x1dd2cb[a2_0x3338('0x16')]){if(environment_1[a2_0x3338('0x20')]){output[a2_0x3338('0x12')]({'title':a2_0x3338('0x14')+_0x202155+'.'});}this[a2_0x3338('0xd')][a2_0x3338('0x24')][_0x202155]=a2_0x3338('0x13');return![];}try{yield this['fileStorage']['retrieve'](_0x202155,_0x1dd2cb[a2_0x3338('0x16')],_0x44baee);this[a2_0x3338('0xd')]['statuses'][_0x202155]='remote-cache-hit';return!![];}catch(_0x37b7f4){const _0x393b03=(_0x2fbc25=_0x37b7f4[a2_0x3338('0x25')])!==null&&_0x2fbc25!==void 0x0?_0x2fbc25:_0x37b7f4;if(_0x393b03[a2_0x3338('0x27')]&&_0x393b03[a2_0x3338('0x27')][a2_0x3338('0x9')]===0x194){if(environment_1[a2_0x3338('0x20')]){output[a2_0x3338('0x12')]({'title':a2_0x3338('0x14')+_0x202155+'.\x20Status\x20404.'});}}else{this[a2_0x3338('0x6')][a2_0x3338('0x0')]=this['messages'][a2_0x3338('0x10')](_0x393b03,a2_0x3338('0x8'));}this[a2_0x3338('0xd')][a2_0x3338('0x24')][_0x202155]=a2_0x3338('0x13');return![];}});}[a2_0x3338('0x15')](_0x570a77,_0x4bc8c6){return __awaiter(this,void 0x0,void 0x0,function*(){if(this[a2_0x3338('0x6')]['cacheError'])return![];const _0x4c8a24=Promise[a2_0x3338('0x5')]()['then'](()=>__awaiter(this,void 0x0,void 0x0,function*(){var _0x134c0f;const _0x362bd9=yield this[a2_0x3338('0xa')](_0x570a77);if(!_0x362bd9)return![];if(!_0x362bd9[a2_0x3338('0x1c')]){if(environment_1['VERBOSE_LOGGING']){output[a2_0x3338('0x12')]({'title':a2_0x3338('0x1b')+_0x570a77+a2_0x3338('0x17')});}return!![];}try{yield this[a2_0x3338('0xc')][a2_0x3338('0x15')](_0x570a77,_0x362bd9['put'],_0x4bc8c6);return!![];}catch(_0x3057e3){const _0x2bcefd=(_0x134c0f=_0x3057e3[a2_0x3338('0x25')])!==null&&_0x134c0f!==void 0x0?_0x134c0f:_0x3057e3;this[a2_0x3338('0x6')]['cacheError']=this[a2_0x3338('0x6')][a2_0x3338('0x10')](_0x2bcefd,'storage');return![];}}));this[a2_0x3338('0x1d')]['push'](_0x4c8a24);return _0x4c8a24;});}[a2_0x3338('0xa')](_0x1f8aa2){return __awaiter(this,void 0x0,void 0x0,function*(){if(_0x1f8aa2 in this[a2_0x3338('0xd')][a2_0x3338('0x1a')]){return(yield this[a2_0x3338('0xd')]['requests'][_0x1f8aa2])[_0x1f8aa2];}else{const _0x4d7a12=this[a2_0x3338('0xd')][a2_0x3338('0x2')]['filter'](_0x7cc481=>!this[a2_0x3338('0xd')][a2_0x3338('0x1a')][_0x7cc481['hash']])['map'](_0x3d64d5=>_0x3d64d5['hash']);if(_0x4d7a12[a2_0x3338('0x1e')](_0x1f8aa2)===-0x1){_0x4d7a12[a2_0x3338('0x11')](_0x1f8aa2);}const _0x42c1dd=this[a2_0x3338('0x22')][a2_0x3338('0x1')](environment_1[a2_0x3338('0x21')],_0x4d7a12);_0x4d7a12[a2_0x3338('0x1f')](_0x27e1c5=>{this[a2_0x3338('0xd')][a2_0x3338('0x1a')][_0x27e1c5]=_0x42c1dd;});return(yield _0x42c1dd)[_0x1f8aa2];}});}['waitForStoreRequestsToComplete'](){return Promise[a2_0x3338('0x7')](this[a2_0x3338('0x1d')])[a2_0x3338('0x23')](_0x44a779=>_0x44a779[a2_0x3338('0x18')]((_0x474214,_0x384822)=>_0x474214&&_0x384822,!![]));}}exports['CloudRemoteCache']=CloudRemoteCache;
|