@nrwl/nx-cloud 15.0.4-beta.2 → 15.0.4-beta.3

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 (154) hide show
  1. package/bin/nx-cloud.d.ts +2 -0
  2. package/bin/nx-cloud.js +50 -0
  3. package/bin/nx-cloud.js.map +1 -0
  4. package/index.d.ts +2 -0
  5. package/index.js +5 -0
  6. package/index.js.map +1 -0
  7. package/lib/core/api/error-reporter.api.d.ts +6 -0
  8. package/lib/core/api/error-reporter.api.js +36 -0
  9. package/lib/core/api/error-reporter.api.js.map +1 -0
  10. package/lib/core/api/run-group.api.d.ts +7 -0
  11. package/lib/core/api/run-group.api.js +68 -0
  12. package/lib/core/api/run-group.api.js.map +1 -0
  13. package/lib/core/commands/clean-up-agents.d.ts +1 -0
  14. package/lib/core/commands/clean-up-agents.js +34 -0
  15. package/lib/core/commands/clean-up-agents.js.map +1 -0
  16. package/lib/core/commands/record-output.d.ts +1 -0
  17. package/lib/core/commands/record-output.js +177 -0
  18. package/lib/core/commands/record-output.js.map +1 -0
  19. package/lib/core/commands/start-ci-run.d.ts +1 -0
  20. package/lib/core/commands/start-ci-run.js +61 -0
  21. package/lib/core/commands/start-ci-run.js.map +1 -0
  22. package/lib/core/commands/stop-all-agents.d.ts +1 -0
  23. package/lib/core/commands/stop-all-agents.js +37 -0
  24. package/lib/core/commands/stop-all-agents.js.map +1 -0
  25. package/lib/core/commands/upload-and-show-run-details.d.ts +1 -0
  26. package/lib/core/commands/upload-and-show-run-details.js +60 -0
  27. package/lib/core/commands/upload-and-show-run-details.js.map +1 -0
  28. package/lib/core/error/print-invalid-runner-error.d.ts +1 -0
  29. package/lib/core/error/print-invalid-runner-error.js +17 -0
  30. package/lib/core/error/print-invalid-runner-error.js.map +1 -0
  31. package/lib/core/error/print-run-group-error.d.ts +1 -0
  32. package/lib/core/error/print-run-group-error.js +16 -0
  33. package/lib/core/error/print-run-group-error.js.map +1 -0
  34. package/lib/core/file-storage/e2e-encryption.d.ts +9 -0
  35. package/lib/core/file-storage/e2e-encryption.js +46 -0
  36. package/lib/core/file-storage/e2e-encryption.js.map +1 -0
  37. package/lib/core/file-storage/file-storage.d.ts +24 -0
  38. package/lib/core/file-storage/file-storage.js +262 -0
  39. package/lib/core/file-storage/file-storage.js.map +1 -0
  40. package/lib/core/models/cache-urls.model.d.ts +6 -0
  41. package/lib/core/models/cache-urls.model.js +3 -0
  42. package/lib/core/models/cache-urls.model.js.map +1 -0
  43. package/lib/core/models/cloud-task-runner-options.d.ts +20 -0
  44. package/lib/core/models/cloud-task-runner-options.js +3 -0
  45. package/lib/core/models/cloud-task-runner-options.js.map +1 -0
  46. package/lib/core/models/distributed-agent/grouped-tasks.model.d.ts +6 -0
  47. package/lib/core/models/distributed-agent/grouped-tasks.model.js +3 -0
  48. package/lib/core/models/distributed-agent/grouped-tasks.model.js.map +1 -0
  49. package/lib/core/models/distributed-agent/index.d.ts +3 -0
  50. package/lib/core/models/distributed-agent/index.js +20 -0
  51. package/lib/core/models/distributed-agent/index.js.map +1 -0
  52. package/lib/core/models/distributed-agent/task-to-execute.model.d.ts +7 -0
  53. package/lib/core/models/distributed-agent/task-to-execute.model.js +3 -0
  54. package/lib/core/models/distributed-agent/task-to-execute.model.js.map +1 -0
  55. package/lib/core/models/distributed-agent/tasks-api-response.model.d.ts +10 -0
  56. package/lib/core/models/distributed-agent/tasks-api-response.model.js +3 -0
  57. package/lib/core/models/distributed-agent/tasks-api-response.model.js.map +1 -0
  58. package/lib/core/models/machine-info.model.d.ts +6 -0
  59. package/lib/core/models/machine-info.model.js +3 -0
  60. package/lib/core/models/machine-info.model.js.map +1 -0
  61. package/lib/core/models/run-context.model.d.ts +128 -0
  62. package/lib/core/models/run-context.model.js +22 -0
  63. package/lib/core/models/run-context.model.js.map +1 -0
  64. package/lib/core/models/run-data.model.d.ts +11 -0
  65. package/lib/core/models/run-data.model.js +3 -0
  66. package/lib/core/models/run-data.model.js.map +1 -0
  67. package/lib/core/models/task-execution.model.d.ts +13 -0
  68. package/lib/core/models/task-execution.model.js +3 -0
  69. package/lib/core/models/task-execution.model.js.map +1 -0
  70. package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.d.ts +19 -0
  71. package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +84 -0
  72. package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js.map +1 -0
  73. package/lib/core/runners/cloud-enabled/cloud-enabled.runner.d.ts +3 -0
  74. package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +288 -0
  75. package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js.map +1 -0
  76. package/lib/core/runners/cloud-enabled/cloud-remote-cache.d.ts +16 -0
  77. package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +117 -0
  78. package/lib/core/runners/cloud-enabled/cloud-remote-cache.js.map +1 -0
  79. package/lib/core/runners/cloud-enabled/cloud-run.api.d.ts +18 -0
  80. package/lib/core/runners/cloud-enabled/cloud-run.api.js +167 -0
  81. package/lib/core/runners/cloud-enabled/cloud-run.api.js.map +1 -0
  82. package/lib/core/runners/cloud-enabled/id-generator.d.ts +1 -0
  83. package/lib/core/runners/cloud-enabled/id-generator.js +16 -0
  84. package/lib/core/runners/cloud-enabled/id-generator.js.map +1 -0
  85. package/lib/core/runners/distributed-agent/distributed-agent.api.d.ts +13 -0
  86. package/lib/core/runners/distributed-agent/distributed-agent.api.js +79 -0
  87. package/lib/core/runners/distributed-agent/distributed-agent.api.js.map +1 -0
  88. package/lib/core/runners/distributed-agent/distributed-agent.impl.d.ts +1 -0
  89. package/lib/core/runners/distributed-agent/distributed-agent.impl.js +269 -0
  90. package/lib/core/runners/distributed-agent/distributed-agent.impl.js.map +1 -0
  91. package/lib/core/runners/distributed-execution/distributed-execution.api.d.ts +10 -0
  92. package/lib/core/runners/distributed-execution/distributed-execution.api.js +143 -0
  93. package/lib/core/runners/distributed-execution/distributed-execution.api.js.map +1 -0
  94. package/lib/core/runners/distributed-execution/distributed-execution.runner.d.ts +1 -0
  95. package/lib/core/runners/distributed-execution/distributed-execution.runner.js +241 -0
  96. package/lib/core/runners/distributed-execution/distributed-execution.runner.js.map +1 -0
  97. package/lib/core/runners/distributed-execution/split-task-graph-into-stages.d.ts +2 -0
  98. package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js +37 -0
  99. package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js.map +1 -0
  100. package/lib/core/runners/distributed-execution/task-graph-creator.d.ts +15 -0
  101. package/lib/core/runners/distributed-execution/task-graph-creator.js +77 -0
  102. package/lib/core/runners/distributed-execution/task-graph-creator.js.map +1 -0
  103. package/lib/core/terminal-output/end-of-run-message.d.ts +8 -0
  104. package/lib/core/terminal-output/end-of-run-message.js +44 -0
  105. package/lib/core/terminal-output/end-of-run-message.js.map +1 -0
  106. package/lib/core/terminal-output/message-reporter.d.ts +11 -0
  107. package/lib/core/terminal-output/message-reporter.js +71 -0
  108. package/lib/core/terminal-output/message-reporter.js.map +1 -0
  109. package/lib/core/terminal-output/output-obfuscator.d.ts +6 -0
  110. package/lib/core/terminal-output/output-obfuscator.js +48 -0
  111. package/lib/core/terminal-output/output-obfuscator.js.map +1 -0
  112. package/lib/core/terminal-output/read-task-terminal-output.d.ts +2 -0
  113. package/lib/core/terminal-output/read-task-terminal-output.js +60 -0
  114. package/lib/core/terminal-output/read-task-terminal-output.js.map +1 -0
  115. package/lib/daemon/process-run-end.d.ts +3 -0
  116. package/lib/daemon/process-run-end.js +60 -0
  117. package/lib/daemon/process-run-end.js.map +1 -0
  118. package/lib/generators/init/init.d.ts +1 -0
  119. package/lib/generators/init/init.js +96 -0
  120. package/lib/generators/init/init.js.map +1 -0
  121. package/lib/nx-cloud-tasks-runner.d.ts +2 -0
  122. package/lib/nx-cloud-tasks-runner.js +146 -0
  123. package/lib/nx-cloud-tasks-runner.js.map +1 -0
  124. package/lib/utilities/axios.d.ts +10 -0
  125. package/lib/utilities/axios.js +87 -0
  126. package/lib/utilities/axios.js.map +1 -0
  127. package/lib/utilities/create-unchanged-value-timeout.d.ts +4 -0
  128. package/lib/utilities/create-unchanged-value-timeout.js +24 -0
  129. package/lib/utilities/create-unchanged-value-timeout.js.map +1 -0
  130. package/lib/utilities/distributed-task-execution-detection.d.ts +2 -0
  131. package/lib/utilities/distributed-task-execution-detection.js +36 -0
  132. package/lib/utilities/distributed-task-execution-detection.js.map +1 -0
  133. package/lib/utilities/environment.d.ts +27 -0
  134. package/lib/utilities/environment.js +200 -0
  135. package/lib/utilities/environment.js.map +1 -0
  136. package/lib/utilities/is-ci.d.ts +1 -0
  137. package/lib/utilities/is-ci.js +21 -0
  138. package/lib/utilities/is-ci.js.map +1 -0
  139. package/lib/utilities/metric-logger.d.ts +22 -0
  140. package/lib/utilities/metric-logger.js +70 -0
  141. package/lib/utilities/metric-logger.js.map +1 -0
  142. package/lib/utilities/nx-imports.d.ts +0 -0
  143. package/lib/utilities/nx-imports.js +59 -0
  144. package/lib/utilities/nx-imports.js.map +1 -0
  145. package/lib/utilities/print-message.d.ts +1 -0
  146. package/lib/utilities/print-message.js +64 -0
  147. package/lib/utilities/print-message.js.map +1 -0
  148. package/lib/utilities/serializer-overrides.d.ts +2 -0
  149. package/lib/utilities/serializer-overrides.js +40 -0
  150. package/lib/utilities/serializer-overrides.js.map +1 -0
  151. package/lib/utilities/waiter.d.ts +6 -0
  152. package/lib/utilities/waiter.js +36 -0
  153. package/lib/utilities/waiter.js.map +1 -0
  154. package/package.json +1 -1
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.printInvalidRunnerError = void 0;
4
+ const { output } = require('../../utilities/nx-imports');
5
+ function printInvalidRunnerError() {
6
+ output.error({
7
+ title: `Invalid Task Runner Configuration`,
8
+ bodyLines: [
9
+ 'To use Distributed Task Execution, your default task runner configuration must',
10
+ 'use the "@nrwl/nx-cloud" task runner.',
11
+ '',
12
+ 'This can be adjusted in "nx.json".',
13
+ ],
14
+ });
15
+ }
16
+ exports.printInvalidRunnerError = printInvalidRunnerError;
17
+ //# sourceMappingURL=print-invalid-runner-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"print-invalid-runner-error.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/error/print-invalid-runner-error.ts"],"names":[],"mappings":";;;AAAA,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAEzD,SAAgB,uBAAuB;IACrC,MAAM,CAAC,KAAK,CAAC;QACX,KAAK,EAAE,mCAAmC;QAC1C,SAAS,EAAE;YACT,gFAAgF;YAChF,uCAAuC;YACvC,EAAE;YACF,oCAAoC;SACrC;KACF,CAAC,CAAC;AACL,CAAC;AAVD,0DAUC"}
@@ -0,0 +1 @@
1
+ export declare function printRunGroupError(): void;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.printRunGroupError = void 0;
4
+ const { output } = require('../../utilities/nx-imports');
5
+ function printRunGroupError() {
6
+ output.error({
7
+ title: `Unable to determine NX_RUN_GROUP`,
8
+ bodyLines: [
9
+ '- Agents run tasks for a given run group (which often corresponds to a run in CI).',
10
+ "- Nx tried to determine the run group automatically but wasn't able to do it.",
11
+ '- Use the NX_RUN_GROUP env variable to set the run group manually.',
12
+ ],
13
+ });
14
+ }
15
+ exports.printRunGroupError = printRunGroupError;
16
+ //# sourceMappingURL=print-run-group-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"print-run-group-error.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/error/print-run-group-error.ts"],"names":[],"mappings":";;;AAAA,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAEzD,SAAgB,kBAAkB;IAChC,MAAM,CAAC,KAAK,CAAC;QACX,KAAK,EAAE,kCAAkC;QACzC,SAAS,EAAE;YACT,oFAAoF;YACpF,+EAA+E;YAC/E,oEAAoE;SACrE;KACF,CAAC,CAAC;AACL,CAAC;AATD,gDASC"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="node" />
2
+ export declare class E2EEncryption {
3
+ encryptionKey: Buffer | undefined;
4
+ constructor(key: string | undefined);
5
+ private to32bytes;
6
+ hasEncryption(): boolean;
7
+ encryptFile(file: string): void;
8
+ decryptFile(file: string): void;
9
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.E2EEncryption = void 0;
4
+ const fs_1 = require("fs");
5
+ const crypto_1 = require("crypto");
6
+ class E2EEncryption {
7
+ constructor(key) {
8
+ if (key) {
9
+ this.encryptionKey = this.to32bytes(key);
10
+ }
11
+ }
12
+ to32bytes(key) {
13
+ let res = key;
14
+ while (res.length < 32) {
15
+ res += key;
16
+ }
17
+ return Buffer.from(res).slice(0, 32);
18
+ }
19
+ hasEncryption() {
20
+ return !!this.encryptionKey;
21
+ }
22
+ encryptFile(file) {
23
+ const iv = (0, crypto_1.randomBytes)(16);
24
+ const cipher = (0, crypto_1.createCipheriv)('aes-256-cbc', this.encryptionKey, iv);
25
+ const decryptedFileContents = (0, fs_1.readFileSync)(file);
26
+ const e = cipher.update(decryptedFileContents);
27
+ const encryptedFileContents = Buffer.concat([iv, e, cipher.final()]);
28
+ (0, fs_1.writeFileSync)(file, encryptedFileContents);
29
+ }
30
+ decryptFile(file) {
31
+ const encryptedFileContents = (0, fs_1.readFileSync)(file);
32
+ try {
33
+ const decipher = (0, crypto_1.createDecipheriv)('aes-256-cbc', this.encryptionKey, encryptedFileContents.slice(0, 16) // iv
34
+ );
35
+ const encryptedText = encryptedFileContents.slice(16); // remove the iv
36
+ const d = decipher.update(encryptedText);
37
+ const decryptedFileContents = Buffer.concat([d, decipher.final()]);
38
+ (0, fs_1.writeFileSync)(file, decryptedFileContents);
39
+ }
40
+ catch (e) {
41
+ throw new Error(`Could not decrypt the artifact. Please check your encryption key.`);
42
+ }
43
+ }
44
+ }
45
+ exports.E2EEncryption = E2EEncryption;
46
+ //# sourceMappingURL=e2e-encryption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"e2e-encryption.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/file-storage/e2e-encryption.ts"],"names":[],"mappings":";;;AAAA,2BAAiD;AACjD,mCAAuE;AAEvE,MAAa,aAAa;IAGxB,YAAY,GAAuB;QACjC,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;SAC1C;IACH,CAAC;IAEO,SAAS,CAAC,GAAW;QAC3B,IAAI,GAAG,GAAG,GAAG,CAAC;QACd,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,EAAE;YACtB,GAAG,IAAI,GAAG,CAAC;SACZ;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACvC,CAAC;IAED,aAAa;QACX,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,MAAM,EAAE,GAAG,IAAA,oBAAW,EAAC,EAAE,CAAC,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAA,uBAAc,EAAC,aAAa,EAAE,IAAI,CAAC,aAAc,EAAE,EAAE,CAAC,CAAC;QACtE,MAAM,qBAAqB,GAAG,IAAA,iBAAY,EAAC,IAAI,CAAC,CAAC;QACjD,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAC/C,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACrE,IAAA,kBAAa,EAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;IAC7C,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,MAAM,qBAAqB,GAAG,IAAA,iBAAY,EAAC,IAAI,CAAC,CAAC;QAEjD,IAAI;YACF,MAAM,QAAQ,GAAG,IAAA,yBAAgB,EAC/B,aAAa,EACb,IAAI,CAAC,aAAc,EACnB,qBAAqB,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK;aACzC,CAAC;YACF,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB;YACvE,MAAM,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YACzC,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YACnE,IAAA,kBAAa,EAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;SAC5C;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;SACH;IACH,CAAC;CACF;AAjDD,sCAiDC"}
@@ -0,0 +1,24 @@
1
+ import { E2EEncryption } from './e2e-encryption';
2
+ import { ErrorReporterApi } from '../api/error-reporter.api';
3
+ export declare class FileStorage {
4
+ private readonly encryption;
5
+ private readonly errorReporter;
6
+ private readonly failWhenCannotDownloadArtifact;
7
+ private readonly recordUploads;
8
+ uploads: {
9
+ hash: string;
10
+ url: string;
11
+ }[];
12
+ constructor(encryption: E2EEncryption, errorReporter: ErrorReporterApi, failWhenCannotDownloadArtifact: boolean, recordUploads: boolean);
13
+ retrieve(hash: string, url: string, cacheDirectory: string): Promise<void>;
14
+ store(hash: string, url: string, cacheDirectory: string): Promise<any>;
15
+ private createFileName;
16
+ private downloadFile;
17
+ private convertStreamIntoPromise;
18
+ private createCommitFile;
19
+ private createCommitFilePath;
20
+ private createFile;
21
+ private uploadFile;
22
+ private generateMD5;
23
+ private getFileUploadHeaders;
24
+ }
@@ -0,0 +1,262 @@
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.FileStorage = void 0;
13
+ const path = require("path");
14
+ const environment_1 = require("../../utilities/environment");
15
+ const axios_1 = require("../../utilities/axios");
16
+ const fs_1 = require("fs");
17
+ const waiter_1 = require("../../utilities/waiter");
18
+ const metric_logger_1 = require("../../utilities/metric-logger");
19
+ const crypto_1 = require("crypto");
20
+ const axios = require('axios');
21
+ const tar = require('tar');
22
+ const { output } = require('../../utilities/nx-imports');
23
+ class FileStorage {
24
+ constructor(encryption, errorReporter, failWhenCannotDownloadArtifact, recordUploads) {
25
+ this.encryption = encryption;
26
+ this.errorReporter = errorReporter;
27
+ this.failWhenCannotDownloadArtifact = failWhenCannotDownloadArtifact;
28
+ this.recordUploads = recordUploads;
29
+ this.uploads = [];
30
+ }
31
+ retrieve(hash, url, cacheDirectory) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ if (environment_1.VERBOSE_LOGGING) {
34
+ output.note({
35
+ title: `Nx Cloud: Downloading ${hash}`,
36
+ bodyLines: [`RETRIEVAL URL: ${url}`],
37
+ });
38
+ }
39
+ const tgz = this.createFileName(hash, cacheDirectory);
40
+ const commitFilePath = this.createCommitFilePath(hash, cacheDirectory);
41
+ try {
42
+ yield this.downloadFile(url, tgz, commitFilePath);
43
+ this.createCommitFile(commitFilePath);
44
+ if (environment_1.VERBOSE_LOGGING) {
45
+ output.note({ title: `Nx Cloud: Downloaded ${hash}` });
46
+ }
47
+ }
48
+ catch (e) {
49
+ const error = e.message || e.toString();
50
+ const errorMessage = `Failed to download or untar the cached artifacts for ${hash}. Error: ${error}`;
51
+ yield this.errorReporter.reportError(errorMessage);
52
+ if (this.failWhenCannotDownloadArtifact) {
53
+ throw e;
54
+ }
55
+ else {
56
+ output.warn({
57
+ title: errorMessage,
58
+ bodyLines: [`RETRIEVAL URL: ${url}`],
59
+ });
60
+ }
61
+ }
62
+ });
63
+ }
64
+ store(hash, url, cacheDirectory) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ if (this.recordUploads) {
67
+ this.uploads.push({ hash, url });
68
+ }
69
+ if (environment_1.VERBOSE_LOGGING) {
70
+ output.note({
71
+ title: `Nx Cloud: Storing ${hash}`,
72
+ bodyLines: [`STORAGE URL: ${url}`],
73
+ });
74
+ }
75
+ let tgz;
76
+ if (process.env.NRWL_INTERNAL_TAR_DEBUG) {
77
+ const maxAttempts = 3;
78
+ let currAttempt = 1;
79
+ let tarSuccess = false;
80
+ let tarResults = [];
81
+ while (currAttempt <= maxAttempts && !tarSuccess) {
82
+ tgz = yield this.createFile(hash, cacheDirectory);
83
+ // extract to /tmp/ unique per attempt
84
+ let tmpPath = `/tmp/${hash}/attempt${currAttempt}`;
85
+ (0, fs_1.mkdirSync)(tmpPath, { recursive: true });
86
+ try {
87
+ const q = (0, fs_1.createReadStream)(tgz).pipe(tar.x({
88
+ cwd: tmpPath,
89
+ }));
90
+ yield this.convertStreamIntoPromise(q);
91
+ tarSuccess = true;
92
+ }
93
+ catch (e) {
94
+ console.error(e);
95
+ yield (0, waiter_1.wait)(5000);
96
+ }
97
+ tarResults.push({ attempt: currAttempt, success: tarSuccess });
98
+ currAttempt++;
99
+ }
100
+ if (tarResults.some((r) => !r.success)) {
101
+ console.error(JSON.stringify(tarResults, null, 2));
102
+ const failedAttemptsString = tarResults
103
+ .filter((r) => !r.success)
104
+ .map((r) => r.attempt)
105
+ .join(', ');
106
+ throw new Error(`Untar failed for hash ${hash} in attempts ${failedAttemptsString} out of ${tarResults.length}`);
107
+ }
108
+ }
109
+ else {
110
+ // Create tar normally
111
+ tgz = yield this.createFile(hash, cacheDirectory);
112
+ }
113
+ yield this.uploadFile(url, tgz);
114
+ if (environment_1.VERBOSE_LOGGING) {
115
+ output.note({ title: `Nx Cloud: Stored ${hash}` });
116
+ }
117
+ });
118
+ }
119
+ createFileName(hash, cacheDirectory) {
120
+ return path.join(cacheDirectory, `${hash}.tar.gz`);
121
+ }
122
+ downloadFile(url, tgz, commitFilePath) {
123
+ var _a;
124
+ return __awaiter(this, void 0, void 0, function* () {
125
+ const recorder = (0, metric_logger_1.createMetricRecorder)('retrieveFile');
126
+ let resp;
127
+ try {
128
+ resp = yield (0, axios_1.axiosMultipleTries)(() => axios(url, {
129
+ method: 'GET',
130
+ responseType: 'stream',
131
+ maxContentLength: environment_1.NX_CLOUD_NO_TIMEOUTS
132
+ ? environment_1.UNLIMITED_FILE_SIZE
133
+ : environment_1.DEFAULT_FILE_SIZE_LIMIT,
134
+ maxBodyLength: environment_1.NX_CLOUD_NO_TIMEOUTS
135
+ ? environment_1.UNLIMITED_FILE_SIZE
136
+ : environment_1.DEFAULT_FILE_SIZE_LIMIT,
137
+ timeout: environment_1.NX_CLOUD_NO_TIMEOUTS ? environment_1.UNLIMITED_TIMEOUT : 60000,
138
+ }));
139
+ recorder.recordMetric(Object.assign(Object.assign({}, (0, metric_logger_1.mapRespToPerfEntry)(resp)), { payloadSize: resp.data.headers['content-length'] }));
140
+ }
141
+ catch (e) {
142
+ // Log performance metrics before re-throwing
143
+ recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
144
+ ? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
145
+ : metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
146
+ throw e;
147
+ }
148
+ // if the tar file is here, we wait for the commit file to appear for 25 seconds
149
+ // this is to avoid race conditions, where two processes are downloading the same
150
+ // artifact in parallel
151
+ if ((0, fs_1.existsSync)(tgz)) {
152
+ let i = 0;
153
+ while (i++ < 50) {
154
+ if ((0, fs_1.existsSync)(commitFilePath))
155
+ return;
156
+ yield (0, waiter_1.wait)(500);
157
+ }
158
+ }
159
+ // if the tar file is already here, do nothing, wait for the commit file to appear
160
+ if (this.encryption.hasEncryption()) {
161
+ yield new Promise((res) => {
162
+ const f = resp.data.pipe((0, fs_1.createWriteStream)(tgz));
163
+ f.on('close', () => res(null));
164
+ });
165
+ this.encryption.decryptFile(tgz);
166
+ const q = (0, fs_1.createReadStream)(tgz).pipe(tar.x({
167
+ cwd: path.dirname(tgz),
168
+ }));
169
+ return this.convertStreamIntoPromise(q);
170
+ }
171
+ else {
172
+ const q = resp.data.pipe(tar.x({
173
+ cwd: path.dirname(tgz),
174
+ }));
175
+ return this.convertStreamIntoPromise(q);
176
+ }
177
+ });
178
+ }
179
+ convertStreamIntoPromise(q) {
180
+ return new Promise((res, rej) => {
181
+ q.on('error', (e) => {
182
+ if (e.tarCode === 'TAR_ABORT' &&
183
+ e.message.indexOf('incorrect header check') > -1) {
184
+ console.warn('FileStorage: Decompression OK, Trailing garbage ignored.');
185
+ res(null);
186
+ }
187
+ else {
188
+ rej(e);
189
+ }
190
+ });
191
+ q.on('close', () => res(null));
192
+ });
193
+ }
194
+ createCommitFile(commitFilePath) {
195
+ (0, fs_1.writeFileSync)(commitFilePath, 'true');
196
+ }
197
+ createCommitFilePath(hash, cacheDirectory) {
198
+ return path.join(cacheDirectory, `${hash}.commit`);
199
+ }
200
+ createFile(hash, cacheDirectory) {
201
+ return __awaiter(this, void 0, void 0, function* () {
202
+ const tgz = this.createFileName(hash, cacheDirectory);
203
+ yield tar.c({
204
+ gzip: true,
205
+ file: tgz,
206
+ cwd: cacheDirectory,
207
+ }, [hash]);
208
+ if (this.encryption.hasEncryption()) {
209
+ this.encryption.encryptFile(tgz);
210
+ }
211
+ return tgz;
212
+ });
213
+ }
214
+ uploadFile(url, tgz) {
215
+ var _a;
216
+ return __awaiter(this, void 0, void 0, function* () {
217
+ const recorder = (0, metric_logger_1.createMetricRecorder)('storeFile');
218
+ const tarData = (0, fs_1.readFileSync)(tgz);
219
+ const tarHash = this.generateMD5(tarData);
220
+ const headers = this.getFileUploadHeaders(url, tarHash);
221
+ try {
222
+ const resp = yield (0, axios_1.axiosMultipleTries)(() => axios(url, {
223
+ method: 'PUT',
224
+ data: tarData,
225
+ headers: headers,
226
+ maxContentLength: environment_1.NX_CLOUD_NO_TIMEOUTS
227
+ ? environment_1.UNLIMITED_FILE_SIZE
228
+ : environment_1.DEFAULT_FILE_SIZE_LIMIT,
229
+ maxBodyLength: environment_1.NX_CLOUD_NO_TIMEOUTS
230
+ ? environment_1.UNLIMITED_FILE_SIZE
231
+ : environment_1.DEFAULT_FILE_SIZE_LIMIT,
232
+ timeout: environment_1.NX_CLOUD_NO_TIMEOUTS ? environment_1.UNLIMITED_TIMEOUT : 120000,
233
+ }));
234
+ recorder.recordMetric(Object.assign(Object.assign({}, (0, metric_logger_1.mapRespToPerfEntry)(resp)), { payloadSize: resp.config.headers['Content-Length'] }));
235
+ }
236
+ catch (e) {
237
+ recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
238
+ ? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
239
+ : metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
240
+ throw e;
241
+ }
242
+ });
243
+ }
244
+ generateMD5(data) {
245
+ const hasher = (0, crypto_1.createHash)('md5');
246
+ hasher.update(data);
247
+ return hasher.digest('base64');
248
+ }
249
+ getFileUploadHeaders(url, tarHash) {
250
+ const privateCloudFileServer = url.includes('/file/');
251
+ const headers = {
252
+ 'Content-Type': 'application/octet-stream',
253
+ 'x-ms-blob-type': 'BlockBlob',
254
+ };
255
+ if (privateCloudFileServer) {
256
+ headers['Content-MD5'] = tarHash;
257
+ }
258
+ return headers;
259
+ }
260
+ }
261
+ exports.FileStorage = FileStorage;
262
+ //# sourceMappingURL=file-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-storage.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/file-storage/file-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6BAA6B;AAC7B,6DAMqC;AACrC,iDAA2D;AAE3D,2BAOY;AACZ,mDAA8C;AAC9C,iEAIuC;AAEvC,mCAAoC;AAEpC,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAC3B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAEzD,MAAa,WAAW;IAGtB,YACmB,UAAyB,EACzB,aAA+B,EAC/B,8BAAuC,EACvC,aAAsB;QAHtB,eAAU,GAAV,UAAU,CAAe;QACzB,kBAAa,GAAb,aAAa,CAAkB;QAC/B,mCAA8B,GAA9B,8BAA8B,CAAS;QACvC,kBAAa,GAAb,aAAa,CAAS;QANzC,YAAO,GAAoC,EAAE,CAAC;IAO3C,CAAC;IAEE,QAAQ,CACZ,IAAY,EACZ,GAAW,EACX,cAAsB;;YAEtB,IAAI,6BAAe,EAAE;gBACnB,MAAM,CAAC,IAAI,CAAC;oBACV,KAAK,EAAE,yBAAyB,IAAI,EAAE;oBACtC,SAAS,EAAE,CAAC,kBAAkB,GAAG,EAAE,CAAC;iBACrC,CAAC,CAAC;aACJ;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;YACtD,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;YACvE,IAAI;gBACF,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,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gBACf,QAAQ,CAAC,YAAY,CACnB,CAAA,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,cAAc,0CAAE,QAAQ;oBACzB,CAAC,CAAC,IAAA,kCAAkB,EAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC;oBAC/C,CAAC,CAAC,yCAAyB,CAC9B,CAAC;gBACF,MAAM,CAAC,CAAC;aACT;;KACF;IAEO,WAAW,CAAC,IAAY;QAC9B,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,KAAK,CAAC,CAAC;QACjC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpB,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;IAEO,oBAAoB,CAAC,GAAW,EAAE,OAAe;QACvD,MAAM,sBAAsB,GAAG,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG;YACd,cAAc,EAAE,0BAA0B;YAC1C,gBAAgB,EAAE,WAAW;SAC9B,CAAC;QAEF,IAAI,sBAAsB,EAAE;YAC1B,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC;SAClC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAvRD,kCAuRC"}
@@ -0,0 +1,6 @@
1
+ export interface CacheUrls {
2
+ [hash: string]: {
3
+ get: string;
4
+ put: string;
5
+ };
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=cache-urls.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-urls.model.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/models/cache-urls.model.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ export interface DefaultTasksRunnerOptions {
2
+ parallel?: number;
3
+ cacheableOperations?: string[];
4
+ cacheableTargets?: string[];
5
+ runtimeCacheInputs?: string[];
6
+ cacheDirectory?: string;
7
+ remoteCache?: any;
8
+ lifeCycle: any;
9
+ captureStderr?: boolean;
10
+ skipNxCache?: boolean;
11
+ }
12
+ export interface CloudTaskRunnerOptions extends DefaultTasksRunnerOptions {
13
+ accessToken?: string;
14
+ canTrackAnalytics?: boolean;
15
+ encryptionKey?: string;
16
+ maskedProperties?: string[];
17
+ scan?: boolean;
18
+ showUsageWarnings?: boolean;
19
+ url?: string;
20
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=cloud-task-runner-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-task-runner-options.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/models/cloud-task-runner-options.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export interface GroupedTasks {
2
+ target: string;
3
+ projects: string[];
4
+ configuration: string | null;
5
+ params: string;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=grouped-tasks.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grouped-tasks.model.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/models/distributed-agent/grouped-tasks.model.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export * from './grouped-tasks.model';
2
+ export * from './task-to-execute.model';
3
+ export * from './tasks-api-response.model';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./grouped-tasks.model"), exports);
18
+ __exportStar(require("./task-to-execute.model"), exports);
19
+ __exportStar(require("./tasks-api-response.model"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/models/distributed-agent/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,0DAAwC;AACxC,6DAA2C"}
@@ -0,0 +1,7 @@
1
+ export interface TaskToExecute {
2
+ taskId: string;
3
+ projectName: string;
4
+ target: string;
5
+ configuration: string | null;
6
+ params: string;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=task-to-execute.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-to-execute.model.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/models/distributed-agent/task-to-execute.model.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { TaskToExecute } from './task-to-execute.model';
2
+ export interface TasksApiResponse {
3
+ completed: boolean;
4
+ status?: 'RUN_GROUP_COMPLETED' | 'NO_FURTHER_TASKS_TO_RUN' | 'IN_PROGRESS';
5
+ retryDuring: number | null;
6
+ executionId: string | null;
7
+ tasks: TaskToExecute[];
8
+ maxParallel: number;
9
+ criticalErrorMessage: string | null;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=tasks-api-response.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks-api-response.model.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/models/distributed-agent/tasks-api-response.model.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export interface MachineInfo {
2
+ machineId: string | undefined;
3
+ platform: string;
4
+ version: string;
5
+ cpuCores: number;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=machine-info.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"machine-info.model.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/models/machine-info.model.ts"],"names":[],"mappings":""}