@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.
- package/bin/nx-cloud.d.ts +2 -0
- package/bin/nx-cloud.js +50 -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/error-reporter.api.d.ts +6 -0
- package/lib/core/api/error-reporter.api.js +36 -0
- package/lib/core/api/error-reporter.api.js.map +1 -0
- package/lib/core/api/run-group.api.d.ts +7 -0
- package/lib/core/api/run-group.api.js +68 -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 +1 -0
- package/lib/core/commands/record-output.js +177 -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 +61 -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/commands/upload-and-show-run-details.d.ts +1 -0
- package/lib/core/commands/upload-and-show-run-details.js +60 -0
- package/lib/core/commands/upload-and-show-run-details.js.map +1 -0
- package/lib/core/error/print-invalid-runner-error.d.ts +1 -0
- package/lib/core/error/print-invalid-runner-error.js +17 -0
- package/lib/core/error/print-invalid-runner-error.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 +24 -0
- package/lib/core/file-storage/file-storage.js +262 -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 +10 -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 +128 -0
- package/lib/core/models/run-context.model.js +22 -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 +19 -0
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +84 -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 +3 -0
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +288 -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 +117 -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 +18 -0
- package/lib/core/runners/cloud-enabled/cloud-run.api.js +167 -0
- package/lib/core/runners/cloud-enabled/cloud-run.api.js.map +1 -0
- package/lib/core/runners/cloud-enabled/id-generator.d.ts +1 -0
- package/lib/core/runners/cloud-enabled/id-generator.js +16 -0
- package/lib/core/runners/cloud-enabled/id-generator.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 +269 -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 +143 -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 +1 -0
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js +241 -0
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js.map +1 -0
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.d.ts +2 -0
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js +37 -0
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js.map +1 -0
- package/lib/core/runners/distributed-execution/task-graph-creator.d.ts +15 -0
- package/lib/core/runners/distributed-execution/task-graph-creator.js +77 -0
- package/lib/core/runners/distributed-execution/task-graph-creator.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 +44 -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/core/terminal-output/read-task-terminal-output.d.ts +2 -0
- package/lib/core/terminal-output/read-task-terminal-output.js +60 -0
- package/lib/core/terminal-output/read-task-terminal-output.js.map +1 -0
- package/lib/daemon/process-run-end.d.ts +3 -0
- package/lib/daemon/process-run-end.js +60 -0
- package/lib/daemon/process-run-end.js.map +1 -0
- package/lib/generators/init/init.d.ts +1 -0
- package/lib/generators/init/init.js +96 -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 +146 -0
- package/lib/nx-cloud-tasks-runner.js.map +1 -0
- package/lib/utilities/axios.d.ts +10 -0
- package/lib/utilities/axios.js +87 -0
- package/lib/utilities/axios.js.map +1 -0
- package/lib/utilities/create-unchanged-value-timeout.d.ts +4 -0
- package/lib/utilities/create-unchanged-value-timeout.js +24 -0
- package/lib/utilities/create-unchanged-value-timeout.js.map +1 -0
- package/lib/utilities/distributed-task-execution-detection.d.ts +2 -0
- package/lib/utilities/distributed-task-execution-detection.js +36 -0
- package/lib/utilities/distributed-task-execution-detection.js.map +1 -0
- package/lib/utilities/environment.d.ts +27 -0
- package/lib/utilities/environment.js +200 -0
- package/lib/utilities/environment.js.map +1 -0
- package/lib/utilities/is-ci.d.ts +1 -0
- package/lib/utilities/is-ci.js +21 -0
- package/lib/utilities/is-ci.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 +59 -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 +64 -0
- package/lib/utilities/print-message.js.map +1 -0
- package/lib/utilities/serializer-overrides.d.ts +2 -0
- package/lib/utilities/serializer-overrides.js +40 -0
- package/lib/utilities/serializer-overrides.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,128 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
|
@@ -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":";;;AA6BA;;GAEG;AACH,IAAY,cAaX;AAbD,WAAY,cAAc;IACxB;;OAEG;IACH,mCAAiB,CAAA;IACjB;;OAEG;IACH,qCAAmB,CAAA;IACnB;;OAEG;IACH,uCAAqB,CAAA;AACvB,CAAC,EAbW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAazB"}
|
|
@@ -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,19 @@
|
|
|
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 collectTerminalOutput;
|
|
8
|
+
private readonly cacheableOperations;
|
|
9
|
+
private readonly outputObfuscator;
|
|
10
|
+
private readonly tasks;
|
|
11
|
+
constructor(runContext: RunContext, cacheDirectory: string | undefined, collectTerminalOutput: boolean, cacheableOperations: string[], outputObfuscator: OutputObfuscator, tasks: TaskExecution[]);
|
|
12
|
+
scheduleTask(task: Task): void;
|
|
13
|
+
startTask(task: Task): void;
|
|
14
|
+
endTasks(tasks: TaskResult[]): void;
|
|
15
|
+
endCommand(): void;
|
|
16
|
+
private updateStartedTask;
|
|
17
|
+
private getTerminalOutput;
|
|
18
|
+
private cleanUpHashDetails;
|
|
19
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CloudEnabledLifeCycle = void 0;
|
|
4
|
+
const serializer_overrides_1 = require("../../../utilities/serializer-overrides");
|
|
5
|
+
const read_task_terminal_output_1 = require("../../terminal-output/read-task-terminal-output");
|
|
6
|
+
class CloudEnabledLifeCycle {
|
|
7
|
+
constructor(runContext, cacheDirectory, collectTerminalOutput, cacheableOperations, outputObfuscator, tasks) {
|
|
8
|
+
this.runContext = runContext;
|
|
9
|
+
this.cacheDirectory = cacheDirectory;
|
|
10
|
+
this.collectTerminalOutput = collectTerminalOutput;
|
|
11
|
+
this.cacheableOperations = cacheableOperations;
|
|
12
|
+
this.outputObfuscator = outputObfuscator;
|
|
13
|
+
this.tasks = tasks;
|
|
14
|
+
}
|
|
15
|
+
scheduleTask(task) {
|
|
16
|
+
this.runContext.scheduledTasks.push(task);
|
|
17
|
+
}
|
|
18
|
+
startTask(task) {
|
|
19
|
+
this.tasks.push({
|
|
20
|
+
taskId: task.id,
|
|
21
|
+
startTime: new Date().toISOString(),
|
|
22
|
+
target: task.target.target,
|
|
23
|
+
projectName: task.target.project,
|
|
24
|
+
hash: task.hash,
|
|
25
|
+
hashDetails: this.cleanUpHashDetails(task.hashDetails),
|
|
26
|
+
params: (0, serializer_overrides_1.serializeOverrides)(task),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
endTasks(tasks) {
|
|
30
|
+
for (let t of tasks) {
|
|
31
|
+
let cacheStatus;
|
|
32
|
+
const taskIsRemoteCacheHit = t.status === 'remote-cache';
|
|
33
|
+
const taskIsLocalCacheHitPreNx135 = t.status === 'cache';
|
|
34
|
+
const taskIsLocalCacheHit = t.status === 'local-cache' ||
|
|
35
|
+
t.status === 'local-cache-kept-existing' ||
|
|
36
|
+
taskIsLocalCacheHitPreNx135;
|
|
37
|
+
if (this.runContext.statuses[t.task.hash]) {
|
|
38
|
+
cacheStatus = this.runContext.statuses[t.task.hash];
|
|
39
|
+
}
|
|
40
|
+
else if (taskIsRemoteCacheHit) {
|
|
41
|
+
cacheStatus = 'remote-cache-hit';
|
|
42
|
+
}
|
|
43
|
+
else if (taskIsLocalCacheHit) {
|
|
44
|
+
cacheStatus = 'local-cache-hit';
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
cacheStatus = 'cache-miss';
|
|
48
|
+
}
|
|
49
|
+
this.updateStartedTask(t.task, t.code, cacheStatus);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
endCommand() { }
|
|
53
|
+
updateStartedTask(task, code, cacheStatus) {
|
|
54
|
+
const startedTask = this.tasks.find((t) => t.taskId === task.id);
|
|
55
|
+
if (!startedTask) {
|
|
56
|
+
throw new Error(`Cannot find task ${task.id}`);
|
|
57
|
+
}
|
|
58
|
+
startedTask.endTime = new Date().toISOString();
|
|
59
|
+
startedTask.status = code;
|
|
60
|
+
startedTask.params = this.outputObfuscator.obfuscate(startedTask.params);
|
|
61
|
+
startedTask.cacheStatus = cacheStatus;
|
|
62
|
+
if (this.collectTerminalOutput) {
|
|
63
|
+
startedTask.terminalOutput = this.getTerminalOutput(task.hash, startedTask.cacheStatus, code);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
getTerminalOutput(hash, cacheStatus, code) {
|
|
67
|
+
return (0, read_task_terminal_output_1.readTaskTerminalOutput)(this.cacheDirectory, this.outputObfuscator, hash, cacheStatus, code);
|
|
68
|
+
}
|
|
69
|
+
cleanUpHashDetails(hashDetails) {
|
|
70
|
+
const nodes = {};
|
|
71
|
+
Object.keys(hashDetails.nodes)
|
|
72
|
+
.filter((k) => !k.startsWith('npm:'))
|
|
73
|
+
.forEach((k) => {
|
|
74
|
+
nodes[k] = hashDetails.nodes[k];
|
|
75
|
+
});
|
|
76
|
+
return {
|
|
77
|
+
nodes,
|
|
78
|
+
runtime: hashDetails.runtime,
|
|
79
|
+
implicitDeps: hashDetails.implicitDeps,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.CloudEnabledLifeCycle = CloudEnabledLifeCycle;
|
|
84
|
+
//# 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":";;;AAGA,kFAA6E;AAC7E,+FAAyF;AAEzF,MAAa,qBAAqB;IAChC,YACmB,UAAsB,EACtB,cAAkC,EAClC,qBAA8B,EAC9B,mBAA6B,EAC7B,gBAAkC,EAClC,KAAsB;QALtB,eAAU,GAAV,UAAU,CAAY;QACtB,mBAAc,GAAd,cAAc,CAAoB;QAClC,0BAAqB,GAArB,qBAAqB,CAAS;QAC9B,wBAAmB,GAAnB,mBAAmB,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,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;CACF;AAvGD,sDAuGC"}
|
|
@@ -0,0 +1,288 @@
|
|
|
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.cloudEnabledTasksRunner = void 0;
|
|
13
|
+
const message_reporter_1 = require("../../terminal-output/message-reporter");
|
|
14
|
+
const end_of_run_message_1 = require("../../terminal-output/end-of-run-message");
|
|
15
|
+
const output_obfuscator_1 = require("../../terminal-output/output-obfuscator");
|
|
16
|
+
const cloud_enabled_life_cycle_1 = require("./cloud-enabled-life-cycle");
|
|
17
|
+
const file_storage_1 = require("../../file-storage/file-storage");
|
|
18
|
+
const e2e_encryption_1 = require("../../file-storage/e2e-encryption");
|
|
19
|
+
const environment_1 = require("../../../utilities/environment");
|
|
20
|
+
const cloud_remote_cache_1 = require("./cloud-remote-cache");
|
|
21
|
+
const cloud_run_api_1 = require("./cloud-run.api");
|
|
22
|
+
const fs_1 = require("fs");
|
|
23
|
+
const path = require("path");
|
|
24
|
+
const metric_logger_1 = require("../../../utilities/metric-logger");
|
|
25
|
+
const error_reporter_api_1 = require("../../api/error-reporter.api");
|
|
26
|
+
const path_1 = require("path");
|
|
27
|
+
const fs_extra_1 = require("fs-extra");
|
|
28
|
+
const id_generator_1 = require("./id-generator");
|
|
29
|
+
const { tasksRunner, output, Cache } = require('../../../utilities/nx-imports');
|
|
30
|
+
function createApi(errors, options, runContext) {
|
|
31
|
+
const machineInfo = (0, environment_1.getMachineInfo)(options);
|
|
32
|
+
return new cloud_run_api_1.CloudRunApi(errors, runContext, options, machineInfo);
|
|
33
|
+
}
|
|
34
|
+
function storeTaskHashes(taskExecutions, directory, distributedExecutionId) {
|
|
35
|
+
const hashes = JSON.stringify(taskExecutions.map((t) => ({
|
|
36
|
+
taskId: t.taskId,
|
|
37
|
+
hash: t.hash,
|
|
38
|
+
})));
|
|
39
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
40
|
+
output.note({
|
|
41
|
+
title: `Executed tasks with hashes: ${hashes}`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
(0, fs_1.writeFileSync)(path.join(directory, `tasks-hashes-${distributedExecutionId}`), hashes);
|
|
45
|
+
}
|
|
46
|
+
function onComplete({ daemon, lifeCycle, options, remoteCache, api, outputObfuscator, runStartTime, messages, endOfRunMessage, taskExecutions, versionOfNxBefore133, inner, encryptionKey, fileStorage, uploadInCurrentProcess, runContext, }) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
const runEndTime = new Date().toISOString();
|
|
49
|
+
const branch = (0, environment_1.getBranch)();
|
|
50
|
+
const runData = {
|
|
51
|
+
command: outputObfuscator.obfuscate((0, environment_1.parseCommand)()),
|
|
52
|
+
startTime: runStartTime,
|
|
53
|
+
endTime: runEndTime,
|
|
54
|
+
distributedExecutionId: environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID,
|
|
55
|
+
branch: branch,
|
|
56
|
+
scan: true,
|
|
57
|
+
runGroup: (0, environment_1.getRunGroup)(),
|
|
58
|
+
// only set sha if branch is set because we invoke a separate process,
|
|
59
|
+
// which adds a few millis
|
|
60
|
+
sha: branch ? (0, environment_1.extractGitSha)() : undefined,
|
|
61
|
+
inner: inner,
|
|
62
|
+
};
|
|
63
|
+
if (uploadInCurrentProcess) {
|
|
64
|
+
if (environment_1.AGENT_RUNNING_IN_DISTRIBUTED_EXECUTION) {
|
|
65
|
+
storeTaskHashes(taskExecutions, (0, environment_1.getNxCacheDirectory)(options), environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID);
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
yield remoteCache.waitForStoreRequestsToComplete();
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
output.error({
|
|
72
|
+
title: `Nx Cloud wasn't able to store artifacts.`,
|
|
73
|
+
});
|
|
74
|
+
messages.printMessages();
|
|
75
|
+
process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
yield api.endRun(runData, taskExecutions);
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
output.error({
|
|
82
|
+
title: `Nx Cloud wasn't able to record its run.`,
|
|
83
|
+
});
|
|
84
|
+
messages.printMessages();
|
|
85
|
+
process.exit(environment_1.DISTRIBUTED_TASK_EXECUTION_INTERNAL_ERROR_STATUS_CODE);
|
|
86
|
+
}
|
|
87
|
+
yield (0, metric_logger_1.submitRunMetrics)(options);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
try {
|
|
91
|
+
const accessToken = environment_1.ACCESS_TOKEN ? environment_1.ACCESS_TOKEN : options.accessToken;
|
|
92
|
+
const linkId = (0, id_generator_1.generateUniqueLinkId)();
|
|
93
|
+
yield daemon.processInBackground('@nrwl/nx-cloud/lib/daemon/process-run-end', {
|
|
94
|
+
encryptionKey,
|
|
95
|
+
runnerOptions: Object.assign(Object.assign({}, options), { accessToken }),
|
|
96
|
+
uploads: fileStorage.uploads,
|
|
97
|
+
runEnd: {
|
|
98
|
+
runData,
|
|
99
|
+
taskExecutions,
|
|
100
|
+
linkId,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
runContext.runUrl = `${options.url || 'https://nx.app'}/runs/${linkId}`;
|
|
104
|
+
}
|
|
105
|
+
catch (e) {
|
|
106
|
+
output.warn({
|
|
107
|
+
title: `Nx Cloud Problems`,
|
|
108
|
+
bodyLines: [e.message || e.toString()],
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// this workaround is required because prior to Nx 13.3 we printed
|
|
113
|
+
// the end message after the runner completes, so we need to wait for the
|
|
114
|
+
// message to appear in the right place
|
|
115
|
+
if (versionOfNxBefore133) {
|
|
116
|
+
setTimeout(() => {
|
|
117
|
+
messages.printMessages();
|
|
118
|
+
if (!messages.anyErrors && !inner) {
|
|
119
|
+
endOfRunMessage.printCacheHitsMessage();
|
|
120
|
+
}
|
|
121
|
+
}, 0);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
messages.printMessages();
|
|
125
|
+
if (!messages.anyErrors && !inner) {
|
|
126
|
+
endOfRunMessage.printCacheHitsMessage();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function createLifeCycle(runContext, options, outputObfuscator, tasks) {
|
|
132
|
+
const cloudEnabledLifeCycle = new cloud_enabled_life_cycle_1.CloudEnabledLifeCycle(runContext, (0, environment_1.getNxCacheDirectory)(options), options.scan === undefined ? true : options.scan, options.cacheableOperations || [], outputObfuscator, tasks);
|
|
133
|
+
try {
|
|
134
|
+
const { CompositeLifeCycle } = require('../../../utilities/nx-imports');
|
|
135
|
+
if (!CompositeLifeCycle)
|
|
136
|
+
return cloudEnabledLifeCycle;
|
|
137
|
+
return new CompositeLifeCycle([options.lifeCycle, cloudEnabledLifeCycle]);
|
|
138
|
+
}
|
|
139
|
+
catch (e) {
|
|
140
|
+
return cloudEnabledLifeCycle;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function fetchUrlsForKnownHashesUpfront(api, runContext, tasks, options) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
let hashes = tasks.map((t) => t.hash).filter((h) => !!h);
|
|
146
|
+
const c = new Cache(options);
|
|
147
|
+
if (!options.skipNxCache) {
|
|
148
|
+
// filter out the urls that don't have artifact stored locally
|
|
149
|
+
const promises = yield Promise.all(hashes.map((hash) => {
|
|
150
|
+
const tdCommit = (0, path_1.join)(c.cachePath, `${hash}.commit`);
|
|
151
|
+
return (0, fs_extra_1.pathExists)(tdCommit);
|
|
152
|
+
}));
|
|
153
|
+
const missingHashes = [];
|
|
154
|
+
for (let i = 0; i < promises.length; ++i) {
|
|
155
|
+
if (promises[i]) {
|
|
156
|
+
missingHashes.push(hashes[i]);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
hashes = missingHashes;
|
|
160
|
+
}
|
|
161
|
+
if (hashes.length > 0) {
|
|
162
|
+
const startRunRequest = api.startRun(environment_1.NX_CLOUD_DISTRIBUTED_EXECUTION_ID, hashes);
|
|
163
|
+
for (const hash of hashes) {
|
|
164
|
+
runContext.requests[hash] = startRunRequest;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
function isConnectedToPrivateCloud(options) {
|
|
170
|
+
if (!options.url)
|
|
171
|
+
return false;
|
|
172
|
+
if (options.url.endsWith('api.nrwl.io'))
|
|
173
|
+
return false;
|
|
174
|
+
if (options.url.endsWith('.nx.app'))
|
|
175
|
+
return false;
|
|
176
|
+
if (options.url.indexOf('localhost') > -1)
|
|
177
|
+
return false;
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
function cloudEnabledTasksRunner(tasks, options, context, inner = false) {
|
|
181
|
+
var _a;
|
|
182
|
+
const runContext = {
|
|
183
|
+
statuses: {},
|
|
184
|
+
scheduledTasks: [],
|
|
185
|
+
requests: {},
|
|
186
|
+
allTasks: tasks,
|
|
187
|
+
};
|
|
188
|
+
const versionOfNxBefore133 = options.lifeCycle === undefined;
|
|
189
|
+
const taskExecutions = [];
|
|
190
|
+
const messages = new message_reporter_1.MessageReporter(options);
|
|
191
|
+
const api = createApi(messages, options, runContext);
|
|
192
|
+
const endOfRunMessage = new end_of_run_message_1.EndOfRunMessage(runContext, taskExecutions);
|
|
193
|
+
const outputObfuscator = new output_obfuscator_1.OutputObfuscator(options.maskedProperties);
|
|
194
|
+
const runStartTime = new Date().toISOString();
|
|
195
|
+
const lifeCycle = createLifeCycle(runContext, options, outputObfuscator, taskExecutions);
|
|
196
|
+
const encryptionKey = environment_1.ENCRYPTION_KEY || options.encryptionKey;
|
|
197
|
+
const encryption = new e2e_encryption_1.E2EEncryption(encryptionKey);
|
|
198
|
+
const errorApi = new error_reporter_api_1.ErrorReporterApi(options);
|
|
199
|
+
const uploadInCurrentProcess = !!environment_1.AGENT_RUNNING_IN_DISTRIBUTED_EXECUTION ||
|
|
200
|
+
!((_a = context.daemon) === null || _a === void 0 ? void 0 : _a.enabled()) ||
|
|
201
|
+
isConnectedToPrivateCloud(options);
|
|
202
|
+
const fileStorage = new file_storage_1.FileStorage(encryption, errorApi, false, uploadInCurrentProcess);
|
|
203
|
+
const remoteCache = new cloud_remote_cache_1.CloudRemoteCache(messages, api, runContext, fileStorage);
|
|
204
|
+
// we don't await for it cause this step is optional
|
|
205
|
+
fetchUrlsForKnownHashesUpfront(api, runContext, tasks, options);
|
|
206
|
+
// have to reset it so we don't capture inner tasks
|
|
207
|
+
delete process.env.NX_CLOUD_DISTRIBUTED_EXECUTION_ID;
|
|
208
|
+
const res = tasksRunner(tasks, Object.assign(Object.assign({}, options), { remoteCache, lifeCycle }), context);
|
|
209
|
+
// observable -> legacy
|
|
210
|
+
if (res.subscribe) {
|
|
211
|
+
const { Subject } = require('rxjs/internal/Subject');
|
|
212
|
+
const wrappedRes = new Subject();
|
|
213
|
+
res.subscribe({
|
|
214
|
+
next: (value) => wrappedRes.next(value),
|
|
215
|
+
error: (err) => wrappedRes.error(err),
|
|
216
|
+
complete: () => __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
yield onComplete({
|
|
218
|
+
daemon: context.daemon,
|
|
219
|
+
lifeCycle,
|
|
220
|
+
options,
|
|
221
|
+
remoteCache,
|
|
222
|
+
api,
|
|
223
|
+
outputObfuscator,
|
|
224
|
+
runStartTime,
|
|
225
|
+
messages,
|
|
226
|
+
endOfRunMessage,
|
|
227
|
+
taskExecutions,
|
|
228
|
+
versionOfNxBefore133,
|
|
229
|
+
inner,
|
|
230
|
+
encryptionKey,
|
|
231
|
+
fileStorage,
|
|
232
|
+
uploadInCurrentProcess,
|
|
233
|
+
runContext,
|
|
234
|
+
});
|
|
235
|
+
wrappedRes.complete();
|
|
236
|
+
}),
|
|
237
|
+
});
|
|
238
|
+
return wrappedRes;
|
|
239
|
+
// promise
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
return res
|
|
243
|
+
.then((r) => __awaiter(this, void 0, void 0, function* () {
|
|
244
|
+
yield onComplete({
|
|
245
|
+
daemon: context.daemon,
|
|
246
|
+
lifeCycle,
|
|
247
|
+
options,
|
|
248
|
+
remoteCache,
|
|
249
|
+
api,
|
|
250
|
+
outputObfuscator,
|
|
251
|
+
runStartTime,
|
|
252
|
+
messages,
|
|
253
|
+
endOfRunMessage,
|
|
254
|
+
taskExecutions,
|
|
255
|
+
versionOfNxBefore133,
|
|
256
|
+
inner,
|
|
257
|
+
encryptionKey,
|
|
258
|
+
fileStorage,
|
|
259
|
+
uploadInCurrentProcess,
|
|
260
|
+
runContext,
|
|
261
|
+
});
|
|
262
|
+
return r;
|
|
263
|
+
}))
|
|
264
|
+
.catch((e) => __awaiter(this, void 0, void 0, function* () {
|
|
265
|
+
yield onComplete({
|
|
266
|
+
daemon: context.daemon,
|
|
267
|
+
lifeCycle,
|
|
268
|
+
options,
|
|
269
|
+
remoteCache,
|
|
270
|
+
api,
|
|
271
|
+
outputObfuscator,
|
|
272
|
+
runStartTime,
|
|
273
|
+
messages,
|
|
274
|
+
endOfRunMessage,
|
|
275
|
+
taskExecutions,
|
|
276
|
+
versionOfNxBefore133,
|
|
277
|
+
inner,
|
|
278
|
+
encryptionKey,
|
|
279
|
+
fileStorage,
|
|
280
|
+
uploadInCurrentProcess,
|
|
281
|
+
runContext,
|
|
282
|
+
});
|
|
283
|
+
throw e;
|
|
284
|
+
}));
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
exports.cloudEnabledTasksRunner = cloudEnabledTasksRunner;
|
|
288
|
+
//# sourceMappingURL=cloud-enabled.runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-enabled.runner.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/cloud-enabled/cloud-enabled.runner.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,6EAAyE;AACzE,iFAA2E;AAC3E,+EAA2E;AAC3E,yEAAmE;AACnE,kEAA8D;AAC9D,sEAAkE;AAClE,gEAawC;AACxC,6DAAwD;AACxD,mDAA8C;AAE9C,2BAAmC;AACnC,6BAA6B;AAC7B,oEAAoE;AACpE,qEAAgE;AAChE,+BAA4B;AAC5B,uCAAsC;AACtC,iDAAsD;AAEtD,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAEhF,SAAS,SAAS,CAChB,MAAuB,EACvB,OAA+B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;QACV,CAAC,CAAA,CAAC,CAAC;KACN;AACH,CAAC;AAvID,0DAuIC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CloudRunApi } from './cloud-run.api';
|
|
2
|
+
import { RunContext } from '../../models/run-context.model';
|
|
3
|
+
import { FileStorage } from '../../file-storage/file-storage';
|
|
4
|
+
import { MessageReporter } from '../../terminal-output/message-reporter';
|
|
5
|
+
export declare class CloudRemoteCache {
|
|
6
|
+
private readonly messages;
|
|
7
|
+
private readonly api;
|
|
8
|
+
private readonly runContext;
|
|
9
|
+
private readonly fileStorage;
|
|
10
|
+
private readonly storeRequests;
|
|
11
|
+
constructor(messages: MessageReporter, api: CloudRunApi, runContext: RunContext, fileStorage: FileStorage);
|
|
12
|
+
retrieve(hash: string, cacheDirectory: string): Promise<boolean>;
|
|
13
|
+
store(hash: string, cacheDirectory: string): Promise<boolean>;
|
|
14
|
+
private hashUrls;
|
|
15
|
+
waitForStoreRequestsToComplete(): Promise<boolean>;
|
|
16
|
+
}
|