@nrwl/nx-cloud 14.0.3-beta.1 → 14.0.3-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/bin/nx-cloud.d.ts +2 -0
- package/bin/nx-cloud.js +43 -0
- package/bin/nx-cloud.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.js +5 -0
- package/index.js.map +1 -0
- package/lib/core/api/run-group.api.d.ts +7 -0
- package/lib/core/api/run-group.api.js +65 -0
- package/lib/core/api/run-group.api.js.map +1 -0
- package/lib/core/commands/clean-up-agents.d.ts +1 -0
- package/lib/core/commands/clean-up-agents.js +34 -0
- package/lib/core/commands/clean-up-agents.js.map +1 -0
- package/lib/core/commands/record-output.d.ts +16 -0
- package/lib/core/commands/record-output.js +203 -0
- package/lib/core/commands/record-output.js.map +1 -0
- package/lib/core/commands/start-ci-run.d.ts +1 -0
- package/lib/core/commands/start-ci-run.js +38 -0
- package/lib/core/commands/start-ci-run.js.map +1 -0
- package/lib/core/commands/stop-all-agents.d.ts +1 -0
- package/lib/core/commands/stop-all-agents.js +37 -0
- package/lib/core/commands/stop-all-agents.js.map +1 -0
- package/lib/core/error/print-run-group-error.d.ts +1 -0
- package/lib/core/error/print-run-group-error.js +16 -0
- package/lib/core/error/print-run-group-error.js.map +1 -0
- package/lib/core/file-storage/e2e-encryption.d.ts +9 -0
- package/lib/core/file-storage/e2e-encryption.js +46 -0
- package/lib/core/file-storage/e2e-encryption.js.map +1 -0
- package/lib/core/file-storage/file-storage.d.ts +13 -0
- package/lib/core/file-storage/file-storage.js +174 -0
- package/lib/core/file-storage/file-storage.js.map +1 -0
- package/lib/core/models/cache-urls.model.d.ts +6 -0
- package/lib/core/models/cache-urls.model.js +3 -0
- package/lib/core/models/cache-urls.model.js.map +1 -0
- package/lib/core/models/cloud-task-runner-options.d.ts +20 -0
- package/lib/core/models/cloud-task-runner-options.js +3 -0
- package/lib/core/models/cloud-task-runner-options.js.map +1 -0
- package/lib/core/models/distributed-agent/grouped-tasks.model.d.ts +6 -0
- package/lib/core/models/distributed-agent/grouped-tasks.model.js +3 -0
- package/lib/core/models/distributed-agent/grouped-tasks.model.js.map +1 -0
- package/lib/core/models/distributed-agent/index.d.ts +3 -0
- package/lib/core/models/distributed-agent/index.js +20 -0
- package/lib/core/models/distributed-agent/index.js.map +1 -0
- package/lib/core/models/distributed-agent/task-to-execute.model.d.ts +7 -0
- package/lib/core/models/distributed-agent/task-to-execute.model.js +3 -0
- package/lib/core/models/distributed-agent/task-to-execute.model.js.map +1 -0
- package/lib/core/models/distributed-agent/tasks-api-response.model.d.ts +9 -0
- package/lib/core/models/distributed-agent/tasks-api-response.model.js +3 -0
- package/lib/core/models/distributed-agent/tasks-api-response.model.js.map +1 -0
- package/lib/core/models/machine-info.model.d.ts +6 -0
- package/lib/core/models/machine-info.model.js +3 -0
- package/lib/core/models/machine-info.model.js.map +1 -0
- package/lib/core/models/run-context.model.d.ts +42 -0
- package/lib/core/models/run-context.model.js +3 -0
- package/lib/core/models/run-context.model.js.map +1 -0
- package/lib/core/models/run-data.model.d.ts +11 -0
- package/lib/core/models/run-data.model.js +3 -0
- package/lib/core/models/run-data.model.js.map +1 -0
- package/lib/core/models/task-execution.model.d.ts +13 -0
- package/lib/core/models/task-execution.model.js +3 -0
- package/lib/core/models/task-execution.model.js.map +1 -0
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.d.ts +25 -0
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +138 -0
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js.map +1 -0
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.d.ts +4 -0
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +167 -0
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js.map +1 -0
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.d.ts +16 -0
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +113 -0
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js.map +1 -0
- package/lib/core/runners/cloud-enabled/cloud-run.api.d.ts +17 -0
- package/lib/core/runners/cloud-enabled/cloud-run.api.js +158 -0
- package/lib/core/runners/cloud-enabled/cloud-run.api.js.map +1 -0
- package/lib/core/runners/distributed-agent/distributed-agent.api.d.ts +13 -0
- package/lib/core/runners/distributed-agent/distributed-agent.api.js +79 -0
- package/lib/core/runners/distributed-agent/distributed-agent.api.js.map +1 -0
- package/lib/core/runners/distributed-agent/distributed-agent.impl.d.ts +1 -0
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js +239 -0
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js.map +1 -0
- package/lib/core/runners/distributed-execution/distributed-execution.api.d.ts +10 -0
- package/lib/core/runners/distributed-execution/distributed-execution.api.js +130 -0
- package/lib/core/runners/distributed-execution/distributed-execution.api.js.map +1 -0
- package/lib/core/runners/distributed-execution/distributed-execution.runner.d.ts +12 -0
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js +306 -0
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js.map +1 -0
- package/lib/core/terminal-output/end-of-run-message.d.ts +8 -0
- package/lib/core/terminal-output/end-of-run-message.js +37 -0
- package/lib/core/terminal-output/end-of-run-message.js.map +1 -0
- package/lib/core/terminal-output/message-reporter.d.ts +11 -0
- package/lib/core/terminal-output/message-reporter.js +71 -0
- package/lib/core/terminal-output/message-reporter.js.map +1 -0
- package/lib/core/terminal-output/output-obfuscator.d.ts +6 -0
- package/lib/core/terminal-output/output-obfuscator.js +48 -0
- package/lib/core/terminal-output/output-obfuscator.js.map +1 -0
- package/lib/generators/init/init.d.ts +2 -0
- package/lib/generators/init/init.js +126 -0
- package/lib/generators/init/init.js.map +1 -0
- package/lib/nx-cloud-tasks-runner.d.ts +2 -0
- package/lib/nx-cloud-tasks-runner.js +102 -0
- package/lib/nx-cloud-tasks-runner.js.map +1 -0
- package/lib/utilities/axios.d.ts +9 -0
- package/lib/utilities/axios.js +73 -0
- package/lib/utilities/axios.js.map +1 -0
- package/lib/utilities/create-no-new-messages-timeout.d.ts +1 -0
- package/lib/utilities/create-no-new-messages-timeout.js +25 -0
- package/lib/utilities/create-no-new-messages-timeout.js.map +1 -0
- package/lib/utilities/environment.d.ts +24 -0
- package/lib/utilities/environment.js +156 -0
- package/lib/utilities/environment.js.map +1 -0
- package/lib/utilities/metric-logger.d.ts +22 -0
- package/lib/utilities/metric-logger.js +70 -0
- package/lib/utilities/metric-logger.js.map +1 -0
- package/lib/utilities/nx-imports.d.ts +0 -0
- package/lib/utilities/nx-imports.js +39 -0
- package/lib/utilities/nx-imports.js.map +1 -0
- package/lib/utilities/print-message.d.ts +1 -0
- package/lib/utilities/print-message.js +35 -0
- package/lib/utilities/print-message.js.map +1 -0
- package/lib/utilities/waiter.d.ts +6 -0
- package/lib/utilities/waiter.js +36 -0
- package/lib/utilities/waiter.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,174 @@
|
|
|
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 axios = require('axios');
|
|
20
|
+
const tar = require('tar');
|
|
21
|
+
const { output } = require('../../utilities/nx-imports');
|
|
22
|
+
class FileStorage {
|
|
23
|
+
constructor(encryption) {
|
|
24
|
+
this.encryption = encryption;
|
|
25
|
+
}
|
|
26
|
+
retrieve(hash, url, cacheDirectory) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
29
|
+
output.note({
|
|
30
|
+
title: `Nx Cloud: Downloading ${hash}`,
|
|
31
|
+
bodyLines: [`RETRIEVAL URL: ${url}`],
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const tgz = this.createFileName(hash, cacheDirectory);
|
|
35
|
+
const commitFilePath = this.createCommitFilePath(hash, cacheDirectory);
|
|
36
|
+
yield this.downloadFile(url, tgz, commitFilePath);
|
|
37
|
+
this.createCommitFile(commitFilePath);
|
|
38
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
39
|
+
output.note({ title: `Nx Cloud: Downloaded ${hash}` });
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
store(hash, url, cacheDirectory) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
46
|
+
output.note({
|
|
47
|
+
title: `Nx Cloud: Storing ${hash}`,
|
|
48
|
+
bodyLines: [`STORAGE URL: ${url}`],
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const tgz = yield this.createFile(hash, cacheDirectory);
|
|
52
|
+
yield this.uploadFile(url, tgz);
|
|
53
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
54
|
+
output.note({ title: `Nx Cloud: Stored ${hash}` });
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
createFileName(hash, cacheDirectory) {
|
|
59
|
+
return path.join(cacheDirectory, `${hash}.tar.gz`);
|
|
60
|
+
}
|
|
61
|
+
downloadFile(url, tgz, commitFilePath) {
|
|
62
|
+
var _a;
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const recorder = (0, metric_logger_1.createMetricRecorder)('retrieveFile');
|
|
65
|
+
let resp;
|
|
66
|
+
try {
|
|
67
|
+
resp = yield (0, axios_1.axiosMultipleTries)(() => axios(url, {
|
|
68
|
+
method: 'GET',
|
|
69
|
+
responseType: 'stream',
|
|
70
|
+
maxContentLength: environment_1.NX_CLOUD_NO_TIMEOUTS
|
|
71
|
+
? environment_1.UNLIMITED_FILE_SIZE
|
|
72
|
+
: environment_1.DEFAULT_FILE_SIZE_LIMIT,
|
|
73
|
+
maxBodyLength: environment_1.NX_CLOUD_NO_TIMEOUTS
|
|
74
|
+
? environment_1.UNLIMITED_FILE_SIZE
|
|
75
|
+
: environment_1.DEFAULT_FILE_SIZE_LIMIT,
|
|
76
|
+
timeout: environment_1.NX_CLOUD_NO_TIMEOUTS ? environment_1.UNLIMITED_TIMEOUT : 60000,
|
|
77
|
+
}));
|
|
78
|
+
recorder.recordMetric(Object.assign(Object.assign({}, (0, metric_logger_1.mapRespToPerfEntry)(resp)), { payloadSize: resp.data.headers['content-length'] }));
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
// Log performance metrics before re-throwing
|
|
82
|
+
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
83
|
+
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
84
|
+
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
85
|
+
throw e;
|
|
86
|
+
}
|
|
87
|
+
// if the tar file is here, we wait for the commit file to appear for 25 seconds
|
|
88
|
+
// this is to avoid race conditions, where two processes are downloading the same
|
|
89
|
+
// artifact in parallel
|
|
90
|
+
if ((0, fs_1.existsSync)(tgz)) {
|
|
91
|
+
let i = 0;
|
|
92
|
+
while (i++ < 50) {
|
|
93
|
+
if ((0, fs_1.existsSync)(commitFilePath))
|
|
94
|
+
return;
|
|
95
|
+
yield (0, waiter_1.wait)(500);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// if the tar file is already here, do nothing, wait for the commit file to appear
|
|
99
|
+
if (this.encryption.hasEncryption()) {
|
|
100
|
+
yield new Promise((res) => {
|
|
101
|
+
const f = resp.data.pipe((0, fs_1.createWriteStream)(tgz));
|
|
102
|
+
f.on('close', () => res(null));
|
|
103
|
+
});
|
|
104
|
+
this.encryption.decryptFile(tgz);
|
|
105
|
+
const q = (0, fs_1.createReadStream)(tgz).pipe(tar.x({
|
|
106
|
+
cwd: path.dirname(tgz),
|
|
107
|
+
}));
|
|
108
|
+
return new Promise((res) => {
|
|
109
|
+
q.on('close', () => res(null));
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
const q = resp.data.pipe(tar.x({
|
|
114
|
+
cwd: path.dirname(tgz),
|
|
115
|
+
}));
|
|
116
|
+
return new Promise((res) => {
|
|
117
|
+
q.on('close', () => res(null));
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
createCommitFile(commitFilePath) {
|
|
123
|
+
(0, fs_1.writeFileSync)(commitFilePath, 'true');
|
|
124
|
+
}
|
|
125
|
+
createCommitFilePath(hash, cacheDirectory) {
|
|
126
|
+
return path.join(cacheDirectory, `${hash}.commit`);
|
|
127
|
+
}
|
|
128
|
+
createFile(hash, cacheDirectory) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
const tgz = this.createFileName(hash, cacheDirectory);
|
|
131
|
+
yield tar.c({
|
|
132
|
+
gzip: true,
|
|
133
|
+
file: tgz,
|
|
134
|
+
cwd: cacheDirectory,
|
|
135
|
+
}, [hash]);
|
|
136
|
+
if (this.encryption.hasEncryption()) {
|
|
137
|
+
this.encryption.encryptFile(tgz);
|
|
138
|
+
}
|
|
139
|
+
return tgz;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
uploadFile(url, tgz) {
|
|
143
|
+
var _a;
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
const recorder = (0, metric_logger_1.createMetricRecorder)('storeFile');
|
|
146
|
+
try {
|
|
147
|
+
const resp = yield (0, axios_1.axiosMultipleTries)(() => axios(url, {
|
|
148
|
+
method: 'PUT',
|
|
149
|
+
data: (0, fs_1.readFileSync)(tgz),
|
|
150
|
+
headers: {
|
|
151
|
+
'Content-Type': 'application/octet-stream',
|
|
152
|
+
'x-ms-blob-type': 'BlockBlob',
|
|
153
|
+
},
|
|
154
|
+
maxContentLength: environment_1.NX_CLOUD_NO_TIMEOUTS
|
|
155
|
+
? environment_1.UNLIMITED_FILE_SIZE
|
|
156
|
+
: environment_1.DEFAULT_FILE_SIZE_LIMIT,
|
|
157
|
+
maxBodyLength: environment_1.NX_CLOUD_NO_TIMEOUTS
|
|
158
|
+
? environment_1.UNLIMITED_FILE_SIZE
|
|
159
|
+
: environment_1.DEFAULT_FILE_SIZE_LIMIT,
|
|
160
|
+
timeout: environment_1.NX_CLOUD_NO_TIMEOUTS ? environment_1.UNLIMITED_TIMEOUT : 120000,
|
|
161
|
+
}));
|
|
162
|
+
recorder.recordMetric(Object.assign(Object.assign({}, (0, metric_logger_1.mapRespToPerfEntry)(resp)), { payloadSize: resp.config.headers['Content-Length'] }));
|
|
163
|
+
}
|
|
164
|
+
catch (e) {
|
|
165
|
+
recorder.recordMetric(((_a = e === null || e === void 0 ? void 0 : e.axiosException) === null || _a === void 0 ? void 0 : _a.response)
|
|
166
|
+
? (0, metric_logger_1.mapRespToPerfEntry)(e.axiosException.response)
|
|
167
|
+
: metric_logger_1.RUNNER_FAILURE_PERF_ENTRY);
|
|
168
|
+
throw e;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
exports.FileStorage = FileStorage;
|
|
174
|
+
//# 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,2BAMY;AACZ,mDAA8C;AAC9C,iEAIuC;AAEvC,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;IACtB,YAA6B,UAAyB;QAAzB,eAAU,GAAV,UAAU,CAAe;IAAG,CAAC;IAEpD,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,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;YAClD,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;YACtC,IAAI,6BAAe,EAAE;gBACnB,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,wBAAwB,IAAI,EAAE,EAAE,CAAC,CAAC;aACxD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loud/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 @@
|
|
|
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 @@
|
|
|
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,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 @@
|
|
|
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,9 @@
|
|
|
1
|
+
import { TaskToExecute } from './task-to-execute.model';
|
|
2
|
+
export interface TasksApiResponse {
|
|
3
|
+
completed: boolean;
|
|
4
|
+
retryDuring: number | null;
|
|
5
|
+
executionId: string | null;
|
|
6
|
+
tasks: TaskToExecute[];
|
|
7
|
+
maxParallel: number;
|
|
8
|
+
criticalErrorMessage: string | null;
|
|
9
|
+
}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"machine-info.model.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/models/machine-info.model.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CacheUrls } from './cache-urls.model';
|
|
2
|
+
export declare type TaskStatus = 'success' | 'failure' | 'skipped' | 'local-cache-kept-existing' | 'local-cache' | 'remote-cache';
|
|
3
|
+
export interface TaskResult {
|
|
4
|
+
task: Task;
|
|
5
|
+
status: TaskStatus;
|
|
6
|
+
code: number;
|
|
7
|
+
terminalOutput?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Task {
|
|
10
|
+
id: string;
|
|
11
|
+
target: {
|
|
12
|
+
project: string;
|
|
13
|
+
target: string;
|
|
14
|
+
configuration?: string;
|
|
15
|
+
};
|
|
16
|
+
overrides: any;
|
|
17
|
+
projectRoot?: string;
|
|
18
|
+
hash?: string;
|
|
19
|
+
hashDetails?: {
|
|
20
|
+
command: string;
|
|
21
|
+
nodes: {
|
|
22
|
+
[name: string]: string;
|
|
23
|
+
};
|
|
24
|
+
implicitDeps: {
|
|
25
|
+
[fileName: string]: string;
|
|
26
|
+
};
|
|
27
|
+
runtime: {
|
|
28
|
+
[input: string]: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export declare type RunContext = {
|
|
33
|
+
statuses: {
|
|
34
|
+
[hash: string]: 'remote-cache-hit' | 'cache-miss';
|
|
35
|
+
};
|
|
36
|
+
runUrl?: string;
|
|
37
|
+
allTasks: Task[];
|
|
38
|
+
scheduledTasks: Task[];
|
|
39
|
+
requests: {
|
|
40
|
+
[hash: string]: Promise<CacheUrls>;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-context.model.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/models/run-context.model.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-data.model.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/models/run-data.model.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface TaskExecution {
|
|
2
|
+
taskId: string;
|
|
3
|
+
target: string;
|
|
4
|
+
projectName: string;
|
|
5
|
+
hash: string;
|
|
6
|
+
startTime: string;
|
|
7
|
+
endTime: string;
|
|
8
|
+
hashDetails: any;
|
|
9
|
+
params: string;
|
|
10
|
+
cacheStatus: 'remote-cache-hit' | 'local-cache-hit' | 'cache-miss';
|
|
11
|
+
status: number;
|
|
12
|
+
terminalOutput?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-execution.model.js","sourceRoot":"","sources":["../../../../../../../libs/nx-packages/nx-cloud/lib/core/models/task-execution.model.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RunContext, Task, TaskResult } from '../../models/run-context.model';
|
|
2
|
+
import { TaskExecution } from '../../models/task-execution.model';
|
|
3
|
+
import { OutputObfuscator } from '../../terminal-output/output-obfuscator';
|
|
4
|
+
export declare class CloudEnabledLifeCycle {
|
|
5
|
+
private readonly runContext;
|
|
6
|
+
private readonly cacheDirectory;
|
|
7
|
+
private readonly skipNxCache;
|
|
8
|
+
private readonly collectTerminalOutput;
|
|
9
|
+
private readonly cacheableOperations;
|
|
10
|
+
private readonly outputObfuscator;
|
|
11
|
+
private readonly tasks;
|
|
12
|
+
private static MAX_CHARACTERS_FAILED_TASK;
|
|
13
|
+
private static MAX_CHARACTERS_SUCCESSFUL_TASK;
|
|
14
|
+
private static MAX_CHARACTERS_CACHED_TASK;
|
|
15
|
+
constructor(runContext: RunContext, cacheDirectory: string | undefined, skipNxCache: boolean, collectTerminalOutput: boolean, cacheableOperations: string[], outputObfuscator: OutputObfuscator, tasks: TaskExecution[]);
|
|
16
|
+
scheduleTask(task: Task): void;
|
|
17
|
+
startTask(task: Task): void;
|
|
18
|
+
endTask(task: Task, code: number): void;
|
|
19
|
+
endTasks(tasks: TaskResult[]): void;
|
|
20
|
+
endCommand(): void;
|
|
21
|
+
private updateStartedTask;
|
|
22
|
+
private getTerminalOutput;
|
|
23
|
+
private cleanUpHashDetails;
|
|
24
|
+
private readTerminalOutputFile;
|
|
25
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CloudEnabledLifeCycle = void 0;
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const { appRootPath, unparse } = require('../../../utilities/nx-imports');
|
|
8
|
+
class CloudEnabledLifeCycle {
|
|
9
|
+
constructor(runContext, cacheDirectory, skipNxCache, collectTerminalOutput, cacheableOperations, outputObfuscator, tasks) {
|
|
10
|
+
this.runContext = runContext;
|
|
11
|
+
this.cacheDirectory = cacheDirectory;
|
|
12
|
+
this.skipNxCache = skipNxCache;
|
|
13
|
+
this.collectTerminalOutput = collectTerminalOutput;
|
|
14
|
+
this.cacheableOperations = cacheableOperations;
|
|
15
|
+
this.outputObfuscator = outputObfuscator;
|
|
16
|
+
this.tasks = tasks;
|
|
17
|
+
}
|
|
18
|
+
scheduleTask(task) {
|
|
19
|
+
this.runContext.scheduledTasks.push(task);
|
|
20
|
+
}
|
|
21
|
+
startTask(task) {
|
|
22
|
+
const overrides = Object.assign({}, (task.overrides || {}));
|
|
23
|
+
if (task.target.configuration) {
|
|
24
|
+
overrides['configuration'] = task.target.configuration;
|
|
25
|
+
}
|
|
26
|
+
this.tasks.push({
|
|
27
|
+
taskId: task.id,
|
|
28
|
+
startTime: new Date().toISOString(),
|
|
29
|
+
target: task.target.target,
|
|
30
|
+
projectName: task.target.project,
|
|
31
|
+
hash: task.hash,
|
|
32
|
+
hashDetails: this.cleanUpHashDetails(task.hashDetails),
|
|
33
|
+
params: unparse(overrides).join(' '),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
// Used for older version for Nx. Remove in Dec 2022
|
|
37
|
+
endTask(task, code) {
|
|
38
|
+
let cacheStatus;
|
|
39
|
+
if (this.runContext.statuses[task.hash]) {
|
|
40
|
+
cacheStatus = this.runContext.statuses[task.hash];
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
if (this.cacheableOperations.indexOf(task.target.target) > -1 &&
|
|
44
|
+
!this.skipNxCache) {
|
|
45
|
+
cacheStatus = 'local-cache-hit';
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
cacheStatus = 'cache-miss';
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
this.updateStartedTask(task, code, cacheStatus);
|
|
52
|
+
}
|
|
53
|
+
endTasks(tasks) {
|
|
54
|
+
for (let t of tasks) {
|
|
55
|
+
const status = t.status === 'remote-cache'
|
|
56
|
+
? 'remote-cache-hit'
|
|
57
|
+
: t.status === 'local-cache' ||
|
|
58
|
+
t.status === 'local-cache-kept-existing'
|
|
59
|
+
? 'local-cache-hit'
|
|
60
|
+
: 'cache-miss';
|
|
61
|
+
this.updateStartedTask(t.task, t.code, status);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
endCommand() { }
|
|
65
|
+
updateStartedTask(task, code, cacheStatus) {
|
|
66
|
+
const startedTask = this.tasks.find((t) => t.taskId === task.id);
|
|
67
|
+
if (!startedTask) {
|
|
68
|
+
throw new Error(`Cannot find task ${task.id}`);
|
|
69
|
+
}
|
|
70
|
+
startedTask.endTime = new Date().toISOString();
|
|
71
|
+
startedTask.status = code;
|
|
72
|
+
startedTask.params = this.outputObfuscator.obfuscate(startedTask.params);
|
|
73
|
+
startedTask.cacheStatus = cacheStatus;
|
|
74
|
+
if (this.collectTerminalOutput) {
|
|
75
|
+
startedTask.terminalOutput = this.getTerminalOutput(task.hash, startedTask.cacheStatus, code);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
getTerminalOutput(hash, cacheStatus, code) {
|
|
79
|
+
let dir;
|
|
80
|
+
if (this.cacheDirectory) {
|
|
81
|
+
if (this.cacheDirectory.startsWith('./')) {
|
|
82
|
+
dir = (0, path_1.join)(appRootPath, this.cacheDirectory);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
dir = this.cacheDirectory;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
dir = (0, path_1.join)(appRootPath, 'node_modules', '.cache', 'nx');
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
const taskOutput = this.readTerminalOutputFile(dir, hash);
|
|
93
|
+
const taskOutputSanitized = this.outputObfuscator.obfuscate(taskOutput);
|
|
94
|
+
const maxCharacters = cacheStatus === 'cache-miss'
|
|
95
|
+
? code === 0
|
|
96
|
+
? CloudEnabledLifeCycle.MAX_CHARACTERS_SUCCESSFUL_TASK
|
|
97
|
+
: CloudEnabledLifeCycle.MAX_CHARACTERS_FAILED_TASK
|
|
98
|
+
: CloudEnabledLifeCycle.MAX_CHARACTERS_CACHED_TASK;
|
|
99
|
+
return taskOutputSanitized.length > maxCharacters
|
|
100
|
+
? `TRUNCATED\n\n${taskOutputSanitized.slice(taskOutputSanitized.length - maxCharacters)}`
|
|
101
|
+
: taskOutputSanitized;
|
|
102
|
+
}
|
|
103
|
+
catch (e) {
|
|
104
|
+
return '';
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
cleanUpHashDetails(hashDetails) {
|
|
108
|
+
const nodes = {};
|
|
109
|
+
Object.keys(hashDetails.nodes)
|
|
110
|
+
.filter((k) => !k.startsWith('npm:'))
|
|
111
|
+
.forEach((k) => {
|
|
112
|
+
nodes[k] = hashDetails.nodes[k];
|
|
113
|
+
});
|
|
114
|
+
return {
|
|
115
|
+
nodes,
|
|
116
|
+
runtime: hashDetails.runtime,
|
|
117
|
+
implicitDeps: hashDetails.implicitDeps,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
readTerminalOutputFile(dir, hash) {
|
|
121
|
+
try {
|
|
122
|
+
return (0, fs_1.readFileSync)(path.join(dir, 'terminalOutputs', hash)).toString();
|
|
123
|
+
}
|
|
124
|
+
catch (_a) {
|
|
125
|
+
try {
|
|
126
|
+
return (0, fs_1.readFileSync)(path.join(dir, hash, 'terminalOutput')).toString();
|
|
127
|
+
}
|
|
128
|
+
catch (_b) {
|
|
129
|
+
return '';
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.CloudEnabledLifeCycle = CloudEnabledLifeCycle;
|
|
135
|
+
CloudEnabledLifeCycle.MAX_CHARACTERS_FAILED_TASK = 200000;
|
|
136
|
+
CloudEnabledLifeCycle.MAX_CHARACTERS_SUCCESSFUL_TASK = 20000;
|
|
137
|
+
CloudEnabledLifeCycle.MAX_CHARACTERS_CACHED_TASK = 20000;
|
|
138
|
+
//# sourceMappingURL=cloud-enabled-life-cycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-enabled-life-cycle.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,+BAA4B;AAC5B,2BAAkC;AAKlC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAE1E,MAAa,qBAAqB;IAKhC,YACmB,UAAsB,EACtB,cAAkC,EAClC,WAAoB,EACpB,qBAA8B,EAC9B,mBAA6B,EAC7B,gBAAkC,EAClC,KAAsB;QANtB,eAAU,GAAV,UAAU,CAAY;QACtB,mBAAc,GAAd,cAAc,CAAoB;QAClC,gBAAW,GAAX,WAAW,CAAS;QACpB,0BAAqB,GAArB,qBAAqB,CAAS;Q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AAC;IAEO,kBAAkB,CAAC,WAAgB;QACzC,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;aAC3B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;aACpC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACb,KAAK,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;QACL,OAAO;YACL,KAAK;YACL,OAAO,EAAE,WAAW,CAAC,OAAO;YAC5B,YAAY,EAAE,WAAW,CAAC,YAAY;SACvC,CAAC;IACJ,CAAC;IAEO,sBAAsB,CAAC,GAAW,EAAE,IAAY;QACtD,IAAI;YACF,OAAO,IAAA,iBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;SACzE;QAAC,WAAM;YACN,IAAI;gBACF,OAAO,IAAA,iBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;aACxE;YAAC,WAAM;gBACN,OAAO,EAAE,CAAC;aACX;SACF;IACH,CAAC;;AApJH,sDAqJC;AApJgB,gDAA0B,GAAG,MAAM,CAAC;AACpC,oDAA8B,GAAG,KAAK,CAAC;AACvC,gDAA0B,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CloudTaskRunnerOptions } from '../../models/cloud-task-runner-options';
|
|
2
|
+
import type { Observable } from 'rxjs';
|
|
3
|
+
import { Task } from '../../models/run-context.model';
|
|
4
|
+
export declare function cloudEnabledTasksRunner(tasks: Task[], options: CloudTaskRunnerOptions, context: any, inner?: boolean): Observable<any>;
|