@nrwl/nx-cloud 12.5.2 → 13.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/bin/nx-cloud.js +5 -5
  2. package/bin/nx-cloud.js.map +1 -1
  3. package/lib/core/api/run-group.api.js +59 -1
  4. package/lib/core/api/run-group.api.js.map +1 -1
  5. package/lib/core/commands/clean-up-agents.js +2 -2
  6. package/lib/core/commands/clean-up-agents.js.map +1 -1
  7. package/lib/core/commands/start-ci-run.js +4 -4
  8. package/lib/core/commands/start-ci-run.js.map +1 -1
  9. package/lib/core/commands/stop-all-agents.js +3 -3
  10. package/lib/core/commands/stop-all-agents.js.map +1 -1
  11. package/lib/core/file-storage/e2e-encryption.js +7 -7
  12. package/lib/core/file-storage/e2e-encryption.js.map +1 -1
  13. package/lib/core/file-storage/file-storage.js +43 -24
  14. package/lib/core/file-storage/file-storage.js.map +1 -1
  15. package/lib/core/runners/cloud-enabled/{task-runner-life-cycle.d.ts → cloud-enabled-life-cycle.d.ts} +5 -2
  16. package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +123 -0
  17. package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js.map +1 -0
  18. package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +162 -1
  19. package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js.map +1 -1
  20. package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +113 -1
  21. package/lib/core/runners/cloud-enabled/cloud-remote-cache.js.map +1 -1
  22. package/lib/core/runners/cloud-enabled/cloud-run.api.js +135 -1
  23. package/lib/core/runners/cloud-enabled/cloud-run.api.js.map +1 -1
  24. package/lib/core/runners/distributed-agent/distributed-agent.api.js +73 -1
  25. package/lib/core/runners/distributed-agent/distributed-agent.api.js.map +1 -1
  26. package/lib/core/runners/distributed-agent/{distributed-agent.runner.d.ts → distributed-agent.impl.d.ts} +0 -0
  27. package/lib/core/runners/distributed-agent/distributed-agent.impl.js +233 -0
  28. package/lib/core/runners/distributed-agent/distributed-agent.impl.js.map +1 -0
  29. package/lib/core/runners/distributed-execution/distributed-execution.api.d.ts +1 -1
  30. package/lib/core/runners/distributed-execution/distributed-execution.api.js +117 -1
  31. package/lib/core/runners/distributed-execution/distributed-execution.api.js.map +1 -1
  32. package/lib/core/runners/distributed-execution/distributed-execution.runner.js +270 -1
  33. package/lib/core/runners/distributed-execution/distributed-execution.runner.js.map +1 -1
  34. package/lib/core/terminal-output/end-of-run-message.d.ts +1 -1
  35. package/lib/core/terminal-output/end-of-run-message.js +1 -2
  36. package/lib/core/terminal-output/end-of-run-message.js.map +1 -1
  37. package/lib/core/terminal-output/message-reporter.js +1 -1
  38. package/lib/core/terminal-output/message-reporter.js.map +1 -1
  39. package/lib/core/terminal-output/output-obfuscator.js +1 -1
  40. package/lib/core/terminal-output/output-obfuscator.js.map +1 -1
  41. package/lib/generators/init/init.js +1 -1
  42. package/lib/generators/init/init.js.map +1 -1
  43. package/lib/nx-cloud-tasks-runner.js +7 -7
  44. package/lib/nx-cloud-tasks-runner.js.map +1 -1
  45. package/lib/utilities/axios.js +1 -1
  46. package/lib/utilities/axios.js.map +1 -1
  47. package/lib/utilities/environment.d.ts +1 -0
  48. package/lib/utilities/environment.js +5 -4
  49. package/lib/utilities/environment.js.map +1 -1
  50. package/lib/utilities/metric-logger.d.ts +34 -0
  51. package/lib/utilities/metric-logger.js +72 -0
  52. package/lib/utilities/metric-logger.js.map +1 -0
  53. package/package.json +1 -1
  54. package/lib/core/runners/cloud-enabled/task-runner-life-cycle.js +0 -1
  55. package/lib/core/runners/cloud-enabled/task-runner-life-cycle.js.map +0 -1
  56. package/lib/core/runners/distributed-agent/distributed-agent.runner.js +0 -1
  57. package/lib/core/runners/distributed-agent/distributed-agent.runner.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"distributed-agent.api.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/src/l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mC;qBAC3C,CAAC,CAAC;iBACJ;aACF;YAAC,OAAO,CAAM,EAAE;gBACf,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aAClB;QACH,CAAC;KAAA;CACF;AA3DD,kDA2DC"}
1
+ {"version":3,"file":"distributed-agent.api.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/src/lib/core/runners/distributed-agent/distributed-agent.api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA8D;AAE9D,oDAGkC;AAElC,gEAAiE;AACjE,oEAI0C;AAE1C,MAAa,mBAAmB;IAG9B,YACE,OAA+B,EACd,QAAgB,EAChB,SAAiB;QADjB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,cAAS,GAAT,SAAS,CAAQ;QAElC,IAAI,CAAC,gBAAgB,GAAG,IAAA,8BAAsB,EAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IAEK,KAAK,CACT,WAA0B,EAC1B,UAAyB,EACzB,cAAkD;;YAElD,MAAM,QAAQ,GAAG,IAAA,oCAAoB,EAAC,cAAc,CAAC,CAAC;YAEtD,IAAI;gBACF,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAkB,EAClC,GAAG,EAAE,CACH,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,EAAE;oBACvD,QAAQ,EAAE,IAAI,CAAC,QAAQ;oBACvB,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,WAAW;oBACX,UAAU;oBACV,cAAc;iBACf,CAAC,EACJ,EAAE,CACH,CAAC;gBACF,QAAQ,CAAC,YAAY,CAAC,IAAA,kCAAkB,EAAC,GAAG,CAAC,CAAC,CAAC;gBAC/C,OAAO,GAAG,CAAC,IAAI,CAAC;aACjB;YAAC,OAAO,CAAC,EAAE;gBACV,QAAQ,CAAC,YAAY,CAAC,yCAAyB,CAAC,CAAC;gBACjD,MAAM,CAAC,CAAC;aACT;QACH,CAAC;KAAA;IAEK,yBAAyB,CAAC,KAAa;;YAC3C,IAAI,6BAAe,EAAE;gBACnB,eAAM,CAAC,IAAI,CAAC;oBACV,KAAK,EAAE,oCAAoC;oBAC3C,SAAS,EAAE,CAAC,aAAa,IAAI,CAAC,QAAQ,EAAE,EAAE,UAAU,KAAK,EAAE,CAAC;iBAC7D,CAAC,CAAC;aACJ;YAED,MAAM,QAAQ,GAAG,IAAA,oCAAoB,EAAC,kBAAkB,CAAC,CAAC;YAE1D,IAAI;gBACF,MAAM,IAAI,GAAG,MAAM,IAAA,0BAAkB,EACnC,GAAG,EAAE,CACH,IAAI,CAAC,gBAAgB,CAAC,IAAI,CACxB,yCAAyC,EACzC;oBACE,QAAQ,EAAE,IAAI,CAAC,QAAQ;oBACvB,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,oBAAoB,EAAE,KAAK;iBAC5B,CACF,EACH,CAAC,CACF,CAAC;gBACF,IAAI,6BAAe,EAAE;oBACnB,eAAM,CAAC,IAAI,CAAC;wBACV,KAAK,EAAE,mCAAmC;qBAC3C,CAAC,CAAC;iBACJ;gBACD,QAAQ,CAAC,YAAY,CAAC,IAAA,kCAAkB,EAAC,IAAI,CAAC,CAAC,CAAC;aACjD;YAAC,OAAO,CAAM,EAAE;gBACf,QAAQ,CAAC,YAAY,CAAC,yCAAyB,CAAC,CAAC;gBACjD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aAClB;QACH,CAAC;KAAA;CACF;AAxED,kDAwEC"}
@@ -0,0 +1,233 @@
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.startAgent = void 0;
13
+ const output_1 = require("@nrwl/workspace/src/utilities/output");
14
+ const child_process_1 = require("child_process");
15
+ const stripJsonComments = require("strip-json-comments");
16
+ const distributed_agent_api_1 = require("./distributed-agent.api");
17
+ const waiter_1 = require("../../../utilities/waiter");
18
+ const environment_1 = require("../../../utilities/environment");
19
+ const print_run_group_error_1 = require("../../error/print-run-group-error");
20
+ const create_no_new_messages_timeout_1 = require("../../../utilities/create-no-new-messages-timeout");
21
+ const fs_1 = require("fs");
22
+ const metric_logger_1 = require("../../../utilities/metric-logger");
23
+ function executeTasks(options, api) {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ let completedStatusCode = 0;
26
+ let apiResponse = null;
27
+ const failIfSameTasksIn30Mins = (0, create_no_new_messages_timeout_1.createNoNewMessagesTimeout)();
28
+ const waiter = new waiter_1.Waiter();
29
+ let completedTasks = [];
30
+ const startTime = new Date();
31
+ let executedAnyTasks = false;
32
+ while (true) {
33
+ if (environment_1.VERBOSE_LOGGING) {
34
+ output_1.output.note({
35
+ title: 'Fetching tasks...',
36
+ });
37
+ }
38
+ apiResponse = yield api.tasks(apiResponse ? apiResponse.executionId : null, completedStatusCode, completedTasks);
39
+ if (environment_1.VERBOSE_LOGGING) {
40
+ output_1.output.note({
41
+ title: 'API Response',
42
+ bodyLines: [
43
+ `completed: ${apiResponse.completed}`,
44
+ `retryDuring: ${apiResponse.retryDuring}`,
45
+ `executionId: ${apiResponse.executionId}`,
46
+ `number of tasks: ${apiResponse.tasks.length}`,
47
+ `error: ${apiResponse.criticalErrorMessage}`,
48
+ `maxParallel: ${apiResponse.maxParallel}`,
49
+ ],
50
+ });
51
+ }
52
+ if (apiResponse.criticalErrorMessage) {
53
+ output_1.output.error({
54
+ title: 'Distributed Execution Terminated',
55
+ bodyLines: ['Error:', apiResponse.criticalErrorMessage],
56
+ });
57
+ process.exit(0);
58
+ }
59
+ // run group is completed but it might be a rerun
60
+ // we will try several times before going further and
61
+ // completed the response
62
+ // we only do it if we haven't executed any tasks
63
+ if ((apiResponse === null || apiResponse === void 0 ? void 0 : apiResponse.retryDuring) &&
64
+ (apiResponse === null || apiResponse === void 0 ? void 0 : apiResponse.retryDuring) !== 0 &&
65
+ !executedAnyTasks &&
66
+ new Date().getTime() - startTime.getTime() > apiResponse.retryDuring) {
67
+ yield waiter.wait();
68
+ continue;
69
+ }
70
+ if (apiResponse.completed)
71
+ return;
72
+ failIfSameTasksIn30Mins(apiResponse.tasks.map((t) => t.taskId).join(''));
73
+ if (!apiResponse.executionId) {
74
+ if (environment_1.VERBOSE_LOGGING) {
75
+ output_1.output.note({
76
+ title: 'Waiting...',
77
+ });
78
+ }
79
+ yield waiter.wait();
80
+ completedStatusCode = 0;
81
+ completedTasks = [];
82
+ continue;
83
+ }
84
+ waiter.reset();
85
+ executedAnyTasks = true;
86
+ const r = invokeTasksUsingRunMany(options, apiResponse.executionId, apiResponse.tasks, apiResponse.maxParallel);
87
+ completedStatusCode = r.completedStatusCode;
88
+ completedTasks = r.completedTasks;
89
+ }
90
+ });
91
+ }
92
+ function readCompletedTasks(options) {
93
+ try {
94
+ const cacheDirectory = options.cacheDirectory || './node_modules/.cache/nx';
95
+ return JSON.parse((0, fs_1.readFileSync)(`${cacheDirectory}/tasks-hashes`).toString());
96
+ }
97
+ catch (e) {
98
+ output_1.output.error({
99
+ title: "Command execution failed. Tasks hashes haven't been recorded.",
100
+ });
101
+ return [];
102
+ }
103
+ }
104
+ function invokeTasksUsingRunMany(options, executionId, tasks, maxParallel) {
105
+ let completedStatusCode = 0;
106
+ const completedTasks = [];
107
+ for (const g of groupByTarget(tasks)) {
108
+ const config = g.configuration ? `--configuration=${g.configuration}` : ``;
109
+ const parallel = maxParallel > 1 ? ` --parallel --max-parallel=${maxParallel}` : ``;
110
+ // TODO use pnpx or yarn when needed
111
+ const command = `npx nx run-many --target=${g.target} ${config} --projects=${g.projects.join(',')} ${g.params}${parallel}`;
112
+ if (environment_1.VERBOSE_LOGGING) {
113
+ output_1.output.note({
114
+ title: `Executing: '${command}'`,
115
+ });
116
+ }
117
+ try {
118
+ (0, child_process_1.execSync)(command, {
119
+ stdio: ['inherit', 'inherit', 'inherit'],
120
+ env: Object.assign(Object.assign({}, process.env), { NX_CACHE_FAILURES: 'true', NX_CLOUD_DISTRIBUTED_EXECUTION_ID: executionId }),
121
+ });
122
+ }
123
+ catch (e) {
124
+ if (e.status === environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE) {
125
+ throw e;
126
+ }
127
+ else {
128
+ completedStatusCode = 1;
129
+ }
130
+ }
131
+ finally {
132
+ completedTasks.push(...readCompletedTasks(options));
133
+ }
134
+ }
135
+ return { completedStatusCode, completedTasks };
136
+ }
137
+ function groupByTarget(tasks) {
138
+ const res = [];
139
+ tasks.forEach((t) => {
140
+ const r = res.find((rr) => rr.target === t.target && rr.configuration === t.configuration);
141
+ if (r) {
142
+ r.projects.push(t.projectName);
143
+ }
144
+ else {
145
+ res.push({
146
+ target: t.target,
147
+ projects: [t.projectName],
148
+ params: t.params,
149
+ configuration: t.configuration,
150
+ });
151
+ }
152
+ });
153
+ return res;
154
+ }
155
+ function getAgentName() {
156
+ if (process.env.NX_AGENT_NAME !== undefined) {
157
+ return process.env.NX_AGENT_NAME;
158
+ }
159
+ else if (process.env.CIRCLECI !== undefined) {
160
+ return process.env.CIRCLE_STAGE;
161
+ }
162
+ else {
163
+ return `Agent ${Math.floor(Math.random() * 100000)}`;
164
+ }
165
+ }
166
+ function createAgentLockfile(options, agentName) {
167
+ const cacheDirectory = options.cacheDirectory || './node_modules/.cache/nx';
168
+ const lockFileDirectory = `${cacheDirectory}/lockfiles`;
169
+ const lockFilePath = `${lockFileDirectory}/${agentName}.lock`;
170
+ if (!(0, fs_1.existsSync)(lockFileDirectory)) {
171
+ (0, fs_1.mkdirSync)(lockFileDirectory, { recursive: true });
172
+ }
173
+ // Check for other agents' lockfiles and warn if exist
174
+ const lockFiles = (0, fs_1.readdirSync)(lockFileDirectory);
175
+ if (lockFiles.length) {
176
+ // Check to make sure the current agent name is not in use (only 1/100000 ^ 2 chance of this)
177
+ if (lockFiles.includes(`${agentName}.lock`)) {
178
+ output_1.output.error({
179
+ title: 'Duplicate Agent ID Detected',
180
+ bodyLines: [
181
+ 'We have detected another agent with this ID running in this workspace. This should not happen.',
182
+ '',
183
+ 'End all currently running agents, run "npx nx-cloud clean-up-agents", and try again.',
184
+ ],
185
+ });
186
+ process.exit(1);
187
+ }
188
+ output_1.output.warn({
189
+ title: 'Other Nx Cloud Agents Detected',
190
+ bodyLines: [
191
+ 'We have detected other agents running in this workspace. This can cause unexpected behavior.',
192
+ '',
193
+ 'This can also be a false positive caused by agents that did not shut down correctly.',
194
+ 'If you believe this is the case, run "npx nx-cloud clean-up-agents".',
195
+ ],
196
+ });
197
+ }
198
+ (0, fs_1.writeFileSync)(lockFilePath, '');
199
+ process.on('exit', () => cleanupAgentLockfile(lockFilePath));
200
+ process.on('SIGINT', () => cleanupAgentLockfile(lockFilePath));
201
+ }
202
+ function cleanupAgentLockfile(lockFilePath) {
203
+ if ((0, fs_1.existsSync)(lockFilePath)) {
204
+ (0, fs_1.unlinkSync)(lockFilePath);
205
+ }
206
+ }
207
+ function startAgent() {
208
+ return __awaiter(this, void 0, void 0, function* () {
209
+ const runGroup = (0, environment_1.getRunGroup)();
210
+ if (!runGroup) {
211
+ (0, print_run_group_error_1.printRunGroupError)();
212
+ return process.exit(1);
213
+ }
214
+ output_1.output.note({
215
+ title: 'Starting an agent for running Nx tasks',
216
+ });
217
+ const options = JSON.parse(stripJsonComments((0, fs_1.readFileSync)('nx.json').toString())).tasksRunnerOptions.default.options;
218
+ const agentName = getAgentName();
219
+ createAgentLockfile(options, agentName);
220
+ const api = new distributed_agent_api_1.DistributedAgentApi(options, runGroup, agentName);
221
+ return executeTasks(options, api)
222
+ .then((res) => __awaiter(this, void 0, void 0, function* () {
223
+ yield (0, metric_logger_1.submitRunMetrics)(options);
224
+ return res;
225
+ }))
226
+ .catch((e) => __awaiter(this, void 0, void 0, function* () {
227
+ yield api.completeRunGroupWithError(`Critical Error in Agent: "${e.message}"`);
228
+ throw e;
229
+ }));
230
+ });
231
+ }
232
+ exports.startAgent = startAgent;
233
+ //# sourceMappingURL=distributed-agent.impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distributed-agent.impl.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/src/lib/core/runners/distributed-agent/distributed-agent.impl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA8D;AAC9D,iDAAyC;AACzC,yDAAyD;AAEzD,mEAA8D;AAM9D,sDAAmD;AACnD,gEAIwC;AACxC,6EAAuE;AACvE,sGAA+F;AAC/F,2BAOY;AACZ,oEAAoE;AAEpE,SAAe,YAAY,CACzB,OAA+B,EAC/B,GAAwB;;QAExB,IAAI,mBAAmB,GAAG,CAAC,CAAC;QAC5B,IAAI,WAAW,GAA4B,IAAI,CAAC;QAChD,MAAM,uBAAuB,GAAG,IAAA,2DAA0B,GAAE,CAAC;QAC7D,MAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;QAE5B,IAAI,cAAc,GAAG,EAAwC,CAAC;QAE9D,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAC7B,IAAI,gBAAgB,GAAG,KAAK,CAAC;QAE7B,OAAO,IAAI,EAAE;YACX,IAAI,6BAAe,EAAE;gBACnB,eAAM,CAAC,IAAI,CAAC;oBACV,KAAK,EAAE,mBAAmB;iBAC3B,CAAC,CAAC;aACJ;YAED,WAAY,GAAG,MAAM,GAAG,CAAC,KAAK,CAC5B,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAC5C,mBAAmB,EACnB,cAAc,CACf,CAAC;YAEF,IAAI,6BAAe,EAAE;gBACnB,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kB,CAAC,OAAO,CAAC,OAAO,CAAC;QAErC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;QACjC,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAExC,MAAM,GAAG,GAAG,IAAI,2CAAmB,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;QAElE,OAAO,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC;aAC9B,IAAI,CAAC,CAAO,GAAG,EAAE,EAAE;YAClB,MAAM,IAAA,gCAAgB,EAAC,OAAO,CAAC,CAAC;YAChC,OAAO,GAAG,CAAC;QACb,CAAC,CAAA,CAAC;aACD,KAAK,CAAC,CAAO,CAAC,EAAE,EAAE;YACjB,MAAM,GAAG,CAAC,yBAAyB,CACjC,6BAA6B,CAAC,CAAC,OAAO,GAAG,CAC1C,CAAC;YACF,MAAM,CAAC,CAAC;QACV,CAAC,CAAA,CAAC,CAAC;IACP,CAAC;CAAA;AA/BD,gCA+BC"}
@@ -19,5 +19,5 @@ export declare function createStartRequest(runGroup: string, task: Task[][], opt
19
19
  configuration: string | null;
20
20
  params: string;
21
21
  }[][];
22
- maxParallel: number;
22
+ maxParallel: number | "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
23
23
  };
@@ -1 +1,117 @@
1
- const a6_0x3179=['status','@nrwl/workspace/src/tasks-runner/utils','hash','value','../../../utilities/axios','defineProperty','/nx-cloud/executions/start','/nx-cloud/executions/complete-run-group','overrides','error','output','Workspace\x20is\x20disabled.\x20Cannot\x20perform\x20distributed\x20task\x20executions.','unparse','parallel','parseCommand','../../../utilities/environment','createStartRequest','apiAxiosInstance','map','createApiAxiosInstance','message','data','start','completeRunGroupWithError','axiosMultipleTries','exit','__esModule','configuration','post','@nrwl/workspace/src/utilities/output','next','target','getBranch','throw','/nx-cloud/executions/status','DistributedExecutionApi'];(function(_0x2cbedb,_0x31794b){const _0x2f216d=function(_0x4ddf8d){while(--_0x4ddf8d){_0x2cbedb['push'](_0x2cbedb['shift']());}};_0x2f216d(++_0x31794b);}(a6_0x3179,0x120));const a6_0x2f21=function(_0x2cbedb,_0x31794b){_0x2cbedb=_0x2cbedb-0x0;let _0x2f216d=a6_0x3179[_0x2cbedb];return _0x2f216d;};'use strict';var __awaiter=this&&this['__awaiter']||function(_0x30aab4,_0x3035c1,_0xbba955,_0x16acff){function _0x1503a7(_0x4f482d){return _0x4f482d instanceof _0xbba955?_0x4f482d:new _0xbba955(function(_0x230b42){_0x230b42(_0x4f482d);});}return new(_0xbba955||(_0xbba955=Promise))(function(_0x1c403f,_0x154e22){function _0x5ac7d9(_0x5b7bfd){try{_0x3b339f(_0x16acff[a6_0x2f21('0x1e')](_0x5b7bfd));}catch(_0x3afd78){_0x154e22(_0x3afd78);}}function _0x355d53(_0x14d3c5){try{_0x3b339f(_0x16acff[a6_0x2f21('0x21')](_0x14d3c5));}catch(_0x2b12ed){_0x154e22(_0x2b12ed);}}function _0x3b339f(_0x4db500){_0x4db500['done']?_0x1c403f(_0x4db500[a6_0x2f21('0x3')]):_0x1503a7(_0x4db500[a6_0x2f21('0x3')])['then'](_0x5ac7d9,_0x355d53);}_0x3b339f((_0x16acff=_0x16acff['apply'](_0x30aab4,_0x3035c1||[]))[a6_0x2f21('0x1e')]());});};Object[a6_0x2f21('0x5')](exports,a6_0x2f21('0x1a'),{'value':!![]});exports['createStartRequest']=exports[a6_0x2f21('0x23')]=void 0x0;const output_1=require(a6_0x2f21('0x1d'));const axios_1=require(a6_0x2f21('0x4'));const utils_1=require(a6_0x2f21('0x1'));const environment_1=require(a6_0x2f21('0xf'));class DistributedExecutionApi{constructor(_0x297a02){this[a6_0x2f21('0x11')]=axios_1[a6_0x2f21('0x13')](_0x297a02);}[a6_0x2f21('0x16')](_0x112efa){return __awaiter(this,void 0x0,void 0x0,function*(){const _0x44c4bf=yield axios_1['axiosMultipleTries'](()=>this[a6_0x2f21('0x11')][a6_0x2f21('0x1c')](a6_0x2f21('0x6'),_0x112efa));if(!_0x44c4bf['data']['enabled']){throw new Error(a6_0x2f21('0xb'));}if(_0x44c4bf[a6_0x2f21('0x15')]['error']){throw new Error(_0x44c4bf['data'][a6_0x2f21('0x9')]);}return _0x44c4bf[a6_0x2f21('0x15')]['id'];});}[a6_0x2f21('0x0')](_0x321fc0){return __awaiter(this,void 0x0,void 0x0,function*(){try{const _0x3b4d47=yield axios_1[a6_0x2f21('0x18')](()=>this[a6_0x2f21('0x11')][a6_0x2f21('0x1c')](a6_0x2f21('0x22'),{'id':_0x321fc0}));return _0x3b4d47[a6_0x2f21('0x15')];}catch(_0x3caf8d){output_1[a6_0x2f21('0xa')][a6_0x2f21('0x9')]({'title':_0x3caf8d[a6_0x2f21('0x14')]});process[a6_0x2f21('0x19')](0x1);}});}[a6_0x2f21('0x17')](_0xf44649,_0x5185f1){return __awaiter(this,void 0x0,void 0x0,function*(){try{yield axios_1['axiosMultipleTries'](()=>this[a6_0x2f21('0x11')][a6_0x2f21('0x1c')](a6_0x2f21('0x7'),{'runGroup':_0xf44649,'criticalErrorMessage':_0x5185f1}),0x3);}catch(_0x1df725){}});}}exports[a6_0x2f21('0x23')]=DistributedExecutionApi;function createStartRequest(_0x49c48b,_0x4920ce,_0x5550a4){var _0x1fd359;const _0x40c7f6=_0x4920ce['map'](_0x3ff7b3=>{return _0x3ff7b3[a6_0x2f21('0x12')](_0x5119b1=>{return{'taskId':_0x5119b1['id'],'hash':_0x5119b1[a6_0x2f21('0x2')],'projectName':_0x5119b1[a6_0x2f21('0x1f')]['project'],'target':_0x5119b1[a6_0x2f21('0x1f')][a6_0x2f21('0x1f')],'configuration':_0x5119b1[a6_0x2f21('0x1f')][a6_0x2f21('0x1b')]||null,'params':utils_1[a6_0x2f21('0xc')](_0x5119b1[a6_0x2f21('0x8')])['join']('\x20')};});});return{'command':environment_1[a6_0x2f21('0xe')](),'branch':environment_1[a6_0x2f21('0x20')](),'runGroup':_0x49c48b,'tasks':_0x40c7f6,'maxParallel':_0x5550a4[a6_0x2f21('0xd')]?(_0x1fd359=_0x5550a4['maxParallel'])!==null&&_0x1fd359!==void 0x0?_0x1fd359:0x3:0x1};}exports[a6_0x2f21('0x10')]=createStartRequest;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.createStartRequest = exports.DistributedExecutionApi = void 0;
13
+ const output_1 = require("@nrwl/workspace/src/utilities/output");
14
+ const axios_1 = require("../../../utilities/axios");
15
+ const utils_1 = require("@nrwl/workspace/src/tasks-runner/utils");
16
+ const environment_1 = require("../../../utilities/environment");
17
+ const metric_logger_1 = require("../../../utilities/metric-logger");
18
+ class DistributedExecutionApi {
19
+ constructor(options) {
20
+ this.apiAxiosInstance = (0, axios_1.createApiAxiosInstance)(options);
21
+ }
22
+ start(params) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const recorder = (0, metric_logger_1.createMetricRecorder)('dteStart');
25
+ let resp;
26
+ try {
27
+ resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/start', params));
28
+ recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
29
+ }
30
+ catch (e) {
31
+ recorder.recordMetric(metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
32
+ throw e;
33
+ }
34
+ if (!resp.data.enabled) {
35
+ throw new Error(`Workspace is disabled. Cannot perform distributed task executions.`);
36
+ }
37
+ if (resp.data.error) {
38
+ throw new Error(resp.data.error);
39
+ }
40
+ return resp.data.id;
41
+ });
42
+ }
43
+ status(id) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ const recorder = (0, metric_logger_1.createMetricRecorder)('dteStatus');
46
+ try {
47
+ const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/status', {
48
+ id,
49
+ }));
50
+ recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
51
+ return resp.data;
52
+ }
53
+ catch (e) {
54
+ recorder.recordMetric(metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
55
+ output_1.output.error({
56
+ title: e.message,
57
+ });
58
+ process.exit(1);
59
+ }
60
+ });
61
+ }
62
+ completeRunGroupWithError(runGroup, error) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ const recorder = (0, metric_logger_1.createMetricRecorder)('completeRunGroup');
65
+ try {
66
+ const resp = yield (0, axios_1.axiosMultipleTries)(() => this.apiAxiosInstance.post('/nx-cloud/executions/complete-run-group', {
67
+ runGroup: runGroup,
68
+ criticalErrorMessage: error,
69
+ }), 3);
70
+ recorder.recordMetric((0, metric_logger_1.mapRespToPerfEntry)(resp));
71
+ }
72
+ catch (e) {
73
+ recorder.recordMetric(metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
74
+ }
75
+ });
76
+ }
77
+ }
78
+ exports.DistributedExecutionApi = DistributedExecutionApi;
79
+ function createStartRequest(runGroup, task, options) {
80
+ const tasksToExecute = task.map((arr) => {
81
+ return arr.map((t) => {
82
+ return {
83
+ taskId: t.id,
84
+ hash: t.hash,
85
+ projectName: t.target.project,
86
+ target: t.target.target,
87
+ configuration: t.target.configuration || null,
88
+ params: (0, utils_1.unparse)(t.overrides).join(' '),
89
+ };
90
+ });
91
+ });
92
+ return {
93
+ command: (0, environment_1.parseCommand)(),
94
+ branch: (0, environment_1.getBranch)(),
95
+ runGroup,
96
+ tasks: tasksToExecute,
97
+ maxParallel: calculateMaxParallel(options),
98
+ };
99
+ }
100
+ exports.createStartRequest = createStartRequest;
101
+ function calculateMaxParallel(options) {
102
+ if (options['maxParallel']) {
103
+ return Number(options['maxParallel']);
104
+ }
105
+ else if (options['parallel'] === 'true' ||
106
+ options['parallel'] === true ||
107
+ options['parallel'] === '') {
108
+ return 3;
109
+ }
110
+ else if (typeof Number(options['parallel']) === 'number') {
111
+ return typeof Number(options['parallel']);
112
+ }
113
+ else {
114
+ return 1;
115
+ }
116
+ }
117
+ //# sourceMappingURL=distributed-execution.api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"distributed-execution.api.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/src/lib/core/runners/distributed-execution/distributed-execution.api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA8D;AAE9D,oDAGkC;AAElC,kEAAiE;AACjE,gEAAyE;AAEzE,MAAa,uBAAuB;IAGlC,YAAY,OAA+B;QACzC,IAAI,CAAC,gBAAgB,GAAG,8BAAsB,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IAEK,KAAK,CAAC,MAAW;;YACrB,MAAM,IAAI,GAAG,MAAM,0BAAkB,CAAC,GAAG,EAAE,CACzC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,EAAE,MAAM,CAAC,CACjE,CAAC;YACF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;gBACtB,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE,CAAC;aACH;YACD,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;gBACnB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aAClC;YACD,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,CAAC;KAAA;IAEK,MAAM,CAAC,EAAU;;YACrB,IAAI;gBACF,MAAM,IAAI,GAAG,MAAM,0BAAkB,CAAC,GAAG,EAAE,CACzC,IAAI,CAAC,gBAA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E;QACvB,MAAM,EAAE,uBAAS,EAAE;QACnB,QAAQ;QACR,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAA,OAAO,CAAC,WAAW,mCAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7D,CAAC;AACJ,CAAC;AAzBD,gDAyBC"}
1
+ {"version":3,"file":"distributed-execution.api.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/src/lib/core/runners/distributed-execution/distributed-execution.api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA8D;AAE9D,oDAGkC;AAElC,kEAAiE;AACjE,gEAAyE;AACzE,oEAI0C;AAE1C,MAAa,uBAAuB;IAGlC,YAAY,OAA+B;QACzC,IAAI,CAAC,gBAAgB,GAAG,IAAA,8BAAsB,EAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IAEK,KAAK,CAAC,MAAW;;YACrB,MAAM,QAAQ,GAAG,IAAA,oCAAoB,EAAC,UAAU,CAAC,CAAC;YAClD,IAAI,IAAI,CAAC;YAET,IAAI;gBACF,IAAI,GAAG,MAAM,IAAA,0BAAkB,EAAC,GAAG,EAAE,CACnC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,EAAE,MAAM,CAAC,CACjE,CAAC;gBACF,QAAQ,CAAC,YAAY,CAAC,IAAA,kCAAkB,EAAC,IAAI,CAAC,CAAC,CAAC;aACjD;YAAC,OAAO,CAAC,EAAE;gBACV,QAAQ,CAAC,YAAY,CAAC,yCAAyB,CAAC,CAAC;gBACjD,MAAM,CAAC,CAAC;aACT;YAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;gBACtB,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE,CAAC;aACH;YACD,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;gBACnB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAA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