@nrwl/nx-cloud 15.0.3 → 15.0.4-beta.2
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/package.json +1 -1
- package/bin/nx-cloud.d.ts +0 -2
- package/bin/nx-cloud.js +0 -50
- package/bin/nx-cloud.js.map +0 -1
- package/index.d.ts +0 -2
- package/index.js +0 -5
- package/index.js.map +0 -1
- package/lib/core/api/error-reporter.api.d.ts +0 -6
- package/lib/core/api/error-reporter.api.js +0 -1
- package/lib/core/api/error-reporter.api.js.map +0 -1
- package/lib/core/api/run-group.api.d.ts +0 -7
- package/lib/core/api/run-group.api.js +0 -1
- package/lib/core/api/run-group.api.js.map +0 -1
- package/lib/core/commands/clean-up-agents.d.ts +0 -1
- package/lib/core/commands/clean-up-agents.js +0 -34
- package/lib/core/commands/clean-up-agents.js.map +0 -1
- package/lib/core/commands/record-output.d.ts +0 -1
- package/lib/core/commands/record-output.js +0 -177
- package/lib/core/commands/record-output.js.map +0 -1
- package/lib/core/commands/start-ci-run.d.ts +0 -1
- package/lib/core/commands/start-ci-run.js +0 -61
- package/lib/core/commands/start-ci-run.js.map +0 -1
- package/lib/core/commands/stop-all-agents.d.ts +0 -1
- package/lib/core/commands/stop-all-agents.js +0 -37
- package/lib/core/commands/stop-all-agents.js.map +0 -1
- package/lib/core/commands/upload-and-show-run-details.d.ts +0 -1
- package/lib/core/commands/upload-and-show-run-details.js +0 -60
- package/lib/core/commands/upload-and-show-run-details.js.map +0 -1
- package/lib/core/error/print-invalid-runner-error.d.ts +0 -1
- package/lib/core/error/print-invalid-runner-error.js +0 -17
- package/lib/core/error/print-invalid-runner-error.js.map +0 -1
- package/lib/core/error/print-run-group-error.d.ts +0 -1
- package/lib/core/error/print-run-group-error.js +0 -16
- package/lib/core/error/print-run-group-error.js.map +0 -1
- package/lib/core/file-storage/e2e-encryption.d.ts +0 -9
- package/lib/core/file-storage/e2e-encryption.js +0 -46
- package/lib/core/file-storage/e2e-encryption.js.map +0 -1
- package/lib/core/file-storage/file-storage.d.ts +0 -24
- package/lib/core/file-storage/file-storage.js +0 -262
- package/lib/core/file-storage/file-storage.js.map +0 -1
- package/lib/core/models/cache-urls.model.d.ts +0 -6
- package/lib/core/models/cache-urls.model.js +0 -3
- package/lib/core/models/cache-urls.model.js.map +0 -1
- package/lib/core/models/cloud-task-runner-options.d.ts +0 -20
- package/lib/core/models/cloud-task-runner-options.js +0 -3
- package/lib/core/models/cloud-task-runner-options.js.map +0 -1
- package/lib/core/models/distributed-agent/grouped-tasks.model.d.ts +0 -6
- package/lib/core/models/distributed-agent/grouped-tasks.model.js +0 -3
- package/lib/core/models/distributed-agent/grouped-tasks.model.js.map +0 -1
- package/lib/core/models/distributed-agent/index.d.ts +0 -3
- package/lib/core/models/distributed-agent/index.js +0 -20
- package/lib/core/models/distributed-agent/index.js.map +0 -1
- package/lib/core/models/distributed-agent/task-to-execute.model.d.ts +0 -7
- package/lib/core/models/distributed-agent/task-to-execute.model.js +0 -3
- package/lib/core/models/distributed-agent/task-to-execute.model.js.map +0 -1
- package/lib/core/models/distributed-agent/tasks-api-response.model.d.ts +0 -10
- package/lib/core/models/distributed-agent/tasks-api-response.model.js +0 -3
- package/lib/core/models/distributed-agent/tasks-api-response.model.js.map +0 -1
- package/lib/core/models/machine-info.model.d.ts +0 -6
- package/lib/core/models/machine-info.model.js +0 -3
- package/lib/core/models/machine-info.model.js.map +0 -1
- package/lib/core/models/run-context.model.d.ts +0 -128
- package/lib/core/models/run-context.model.js +0 -22
- package/lib/core/models/run-context.model.js.map +0 -1
- package/lib/core/models/run-data.model.d.ts +0 -11
- package/lib/core/models/run-data.model.js +0 -3
- package/lib/core/models/run-data.model.js.map +0 -1
- package/lib/core/models/task-execution.model.d.ts +0 -13
- package/lib/core/models/task-execution.model.js +0 -3
- package/lib/core/models/task-execution.model.js.map +0 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.d.ts +0 -21
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +0 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js.map +0 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.d.ts +0 -3
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +0 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js.map +0 -1
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.d.ts +0 -16
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +0 -1
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js.map +0 -1
- package/lib/core/runners/cloud-enabled/cloud-run.api.d.ts +0 -18
- package/lib/core/runners/cloud-enabled/cloud-run.api.js +0 -1
- package/lib/core/runners/cloud-enabled/cloud-run.api.js.map +0 -1
- package/lib/core/runners/cloud-enabled/id-generator.d.ts +0 -1
- package/lib/core/runners/cloud-enabled/id-generator.js +0 -1
- package/lib/core/runners/cloud-enabled/id-generator.js.map +0 -1
- package/lib/core/runners/distributed-agent/distributed-agent.api.d.ts +0 -13
- package/lib/core/runners/distributed-agent/distributed-agent.api.js +0 -1
- package/lib/core/runners/distributed-agent/distributed-agent.api.js.map +0 -1
- package/lib/core/runners/distributed-agent/distributed-agent.impl.d.ts +0 -1
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js +0 -1
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js.map +0 -1
- package/lib/core/runners/distributed-execution/distributed-execution.api.d.ts +0 -10
- package/lib/core/runners/distributed-execution/distributed-execution.api.js +0 -1
- package/lib/core/runners/distributed-execution/distributed-execution.api.js.map +0 -1
- package/lib/core/runners/distributed-execution/distributed-execution.runner.d.ts +0 -1
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js +0 -1
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js.map +0 -1
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.d.ts +0 -2
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js +0 -1
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js.map +0 -1
- package/lib/core/runners/distributed-execution/task-graph-creator.d.ts +0 -15
- package/lib/core/runners/distributed-execution/task-graph-creator.js +0 -1
- package/lib/core/runners/distributed-execution/task-graph-creator.js.map +0 -1
- package/lib/core/terminal-output/end-of-run-message.d.ts +0 -8
- package/lib/core/terminal-output/end-of-run-message.js +0 -44
- package/lib/core/terminal-output/end-of-run-message.js.map +0 -1
- package/lib/core/terminal-output/message-reporter.d.ts +0 -11
- package/lib/core/terminal-output/message-reporter.js +0 -71
- package/lib/core/terminal-output/message-reporter.js.map +0 -1
- package/lib/core/terminal-output/output-obfuscator.d.ts +0 -6
- package/lib/core/terminal-output/output-obfuscator.js +0 -48
- package/lib/core/terminal-output/output-obfuscator.js.map +0 -1
- package/lib/core/terminal-output/read-task-terminal-output.d.ts +0 -2
- package/lib/core/terminal-output/read-task-terminal-output.js +0 -60
- package/lib/core/terminal-output/read-task-terminal-output.js.map +0 -1
- package/lib/daemon/process-run-end.d.ts +0 -3
- package/lib/daemon/process-run-end.js +0 -60
- package/lib/daemon/process-run-end.js.map +0 -1
- package/lib/generators/init/init.d.ts +0 -1
- package/lib/generators/init/init.js +0 -96
- package/lib/generators/init/init.js.map +0 -1
- package/lib/nx-cloud-tasks-runner.d.ts +0 -2
- package/lib/nx-cloud-tasks-runner.js +0 -146
- package/lib/nx-cloud-tasks-runner.js.map +0 -1
- package/lib/utilities/axios.d.ts +0 -10
- package/lib/utilities/axios.js +0 -87
- package/lib/utilities/axios.js.map +0 -1
- package/lib/utilities/create-unchanged-value-timeout.d.ts +0 -4
- package/lib/utilities/create-unchanged-value-timeout.js +0 -24
- package/lib/utilities/create-unchanged-value-timeout.js.map +0 -1
- package/lib/utilities/distributed-task-execution-detection.d.ts +0 -2
- package/lib/utilities/distributed-task-execution-detection.js +0 -36
- package/lib/utilities/distributed-task-execution-detection.js.map +0 -1
- package/lib/utilities/environment.d.ts +0 -27
- package/lib/utilities/environment.js +0 -198
- package/lib/utilities/environment.js.map +0 -1
- package/lib/utilities/is-ci.d.ts +0 -1
- package/lib/utilities/is-ci.js +0 -21
- package/lib/utilities/is-ci.js.map +0 -1
- package/lib/utilities/metric-logger.d.ts +0 -22
- package/lib/utilities/metric-logger.js +0 -70
- package/lib/utilities/metric-logger.js.map +0 -1
- package/lib/utilities/nx-imports.d.ts +0 -0
- package/lib/utilities/nx-imports.js +0 -59
- package/lib/utilities/nx-imports.js.map +0 -1
- package/lib/utilities/print-message.d.ts +0 -1
- package/lib/utilities/print-message.js +0 -64
- package/lib/utilities/print-message.js.map +0 -1
- package/lib/utilities/serializer-overrides.d.ts +0 -2
- package/lib/utilities/serializer-overrides.js +0 -40
- package/lib/utilities/serializer-overrides.js.map +0 -1
- package/lib/utilities/waiter.d.ts +0 -6
- package/lib/utilities/waiter.js +0 -36
- package/lib/utilities/waiter.js.map +0 -1
|
@@ -1,46 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,C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,CAAC,EAAE;YACV,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;SACH;IACH,CAAC;CACF;AAjDD,sCAiDC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,262 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;iB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CAAC,+BAAiB,CAAC,CAAC,CAAC,MAAM;iBAC3D,CAAC,CACH,CAAC;gBACF,QAAQ,CAAC,YAAY,iCAChB,IAAA,kCAAkB,EAAC,IAAI,CAAC,KAC3B,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAClD,CAAC;aACJ;YAAC,OAAO,CAAM,EAAE;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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache-urls.model.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/models/cache-urls.model.ts"],"names":[],"mappings":""}
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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":""}
|
|
@@ -1 +0,0 @@
|
|
|
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":""}
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
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":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
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":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"machine-info.model.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/models/machine-info.model.ts"],"names":[],"mappings":""}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { CacheUrls } from './cache-urls.model';
|
|
2
|
-
export declare type TaskStatus = 'success' | 'failure' | 'skipped' | 'local-cache-kept-existing' | 'local-cache' | 'cache' | 'remote-cache';
|
|
3
|
-
export interface TaskResult {
|
|
4
|
-
task: Task;
|
|
5
|
-
status: TaskStatus;
|
|
6
|
-
code: number;
|
|
7
|
-
terminalOutput?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface TaskGraph {
|
|
10
|
-
roots: string[];
|
|
11
|
-
tasks: Record<string, Task>;
|
|
12
|
-
dependencies: Record<string, string[]>;
|
|
13
|
-
}
|
|
14
|
-
export interface ProjectGraph<T = any> {
|
|
15
|
-
nodes: Record<string, ProjectGraphProjectNode<T>>;
|
|
16
|
-
dependencies: Record<string, ProjectGraphDependency[]>;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Type of dependency between projects
|
|
20
|
-
*/
|
|
21
|
-
export declare enum DependencyType {
|
|
22
|
-
/**
|
|
23
|
-
* Static dependencies are tied to the loading of the module
|
|
24
|
-
*/
|
|
25
|
-
static = "static",
|
|
26
|
-
/**
|
|
27
|
-
* Dynamic dependencies are brought in by the module at run time
|
|
28
|
-
*/
|
|
29
|
-
dynamic = "dynamic",
|
|
30
|
-
/**
|
|
31
|
-
* Implicit dependencies are inferred
|
|
32
|
-
*/
|
|
33
|
-
implicit = "implicit"
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* A node describing a project in a workspace
|
|
37
|
-
*/
|
|
38
|
-
export interface ProjectGraphProjectNode<T = any> {
|
|
39
|
-
type: 'app' | 'e2e' | 'lib';
|
|
40
|
-
name: string;
|
|
41
|
-
/**
|
|
42
|
-
* Additional metadata about a project
|
|
43
|
-
*/
|
|
44
|
-
data: T & {
|
|
45
|
-
/**
|
|
46
|
-
* The project's root directory
|
|
47
|
-
*/
|
|
48
|
-
root: string;
|
|
49
|
-
sourceRoot?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Targets associated to the project
|
|
52
|
-
*/
|
|
53
|
-
targets?: {
|
|
54
|
-
[targetName: string]: any;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* Project's tags used for enforcing module boundaries
|
|
58
|
-
*/
|
|
59
|
-
tags?: string[];
|
|
60
|
-
/**
|
|
61
|
-
* Projects on which this node implicitly depends on
|
|
62
|
-
*/
|
|
63
|
-
implicitDependencies?: string[];
|
|
64
|
-
/**
|
|
65
|
-
* Files associated to the project
|
|
66
|
-
*/
|
|
67
|
-
files: any[];
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* A node describing an external dependency
|
|
72
|
-
*/
|
|
73
|
-
export interface ProjectGraphExternalNode {
|
|
74
|
-
type: 'npm';
|
|
75
|
-
name: `npm:${string}`;
|
|
76
|
-
data: {
|
|
77
|
-
version: string;
|
|
78
|
-
packageName: string;
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* A dependency between two projects
|
|
83
|
-
*/
|
|
84
|
-
export interface ProjectGraphDependency {
|
|
85
|
-
type: DependencyType | string;
|
|
86
|
-
/**
|
|
87
|
-
* The project being imported by the other
|
|
88
|
-
*/
|
|
89
|
-
target: string;
|
|
90
|
-
/**
|
|
91
|
-
* The project importing the other
|
|
92
|
-
*/
|
|
93
|
-
source: string;
|
|
94
|
-
}
|
|
95
|
-
export interface Task {
|
|
96
|
-
id: string;
|
|
97
|
-
target: {
|
|
98
|
-
project: string;
|
|
99
|
-
target: string;
|
|
100
|
-
configuration?: string;
|
|
101
|
-
};
|
|
102
|
-
overrides: any;
|
|
103
|
-
projectRoot?: string;
|
|
104
|
-
hash?: string;
|
|
105
|
-
hashDetails?: {
|
|
106
|
-
command: string;
|
|
107
|
-
nodes: {
|
|
108
|
-
[name: string]: string;
|
|
109
|
-
};
|
|
110
|
-
implicitDeps: {
|
|
111
|
-
[fileName: string]: string;
|
|
112
|
-
};
|
|
113
|
-
runtime: {
|
|
114
|
-
[input: string]: string;
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
export declare type RunContext = {
|
|
119
|
-
statuses: {
|
|
120
|
-
[hash: string]: 'remote-cache-hit' | 'cache-miss';
|
|
121
|
-
};
|
|
122
|
-
runUrl?: string;
|
|
123
|
-
allTasks: Task[];
|
|
124
|
-
scheduledTasks: Task[];
|
|
125
|
-
requests: {
|
|
126
|
-
[hash: string]: Promise<CacheUrls>;
|
|
127
|
-
};
|
|
128
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DependencyType = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Type of dependency between projects
|
|
6
|
-
*/
|
|
7
|
-
var DependencyType;
|
|
8
|
-
(function (DependencyType) {
|
|
9
|
-
/**
|
|
10
|
-
* Static dependencies are tied to the loading of the module
|
|
11
|
-
*/
|
|
12
|
-
DependencyType["static"] = "static";
|
|
13
|
-
/**
|
|
14
|
-
* Dynamic dependencies are brought in by the module at run time
|
|
15
|
-
*/
|
|
16
|
-
DependencyType["dynamic"] = "dynamic";
|
|
17
|
-
/**
|
|
18
|
-
* Implicit dependencies are inferred
|
|
19
|
-
*/
|
|
20
|
-
DependencyType["implicit"] = "implicit";
|
|
21
|
-
})(DependencyType = exports.DependencyType || (exports.DependencyType = {}));
|
|
22
|
-
//# sourceMappingURL=run-context.model.js.map
|