@nrwl/nx-cloud 15.1.1 → 15.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/api/error-reporter.api.js +36 -1
- package/lib/core/api/run-group.api.js +68 -1
- package/lib/core/models/distributed-agent/tasks-api-response.model.d.ts +5 -0
- package/lib/core/runners/cloud-enabled/cloud-enabled-life-cycle.js +92 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js +305 -1
- package/lib/core/runners/cloud-enabled/cloud-enabled.runner.js.map +1 -1
- package/lib/core/runners/cloud-enabled/cloud-remote-cache.js +117 -1
- package/lib/core/runners/cloud-enabled/cloud-run.api.js +167 -1
- package/lib/core/runners/cloud-enabled/id-generator.js +16 -1
- package/lib/core/runners/distributed-agent/distributed-agent.api.js +80 -1
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js +169 -1
- package/lib/core/runners/distributed-agent/distributed-agent.impl.js.map +1 -1
- package/lib/core/runners/distributed-agent/execute-tasks.d.ts +3 -0
- package/lib/core/runners/distributed-agent/execute-tasks.js +115 -0
- package/lib/core/runners/distributed-agent/execute-tasks.js.map +1 -0
- package/lib/core/runners/distributed-agent/invoke-tasks.d.ts +8 -0
- package/lib/core/runners/distributed-agent/invoke-tasks.js +58 -0
- package/lib/core/runners/distributed-agent/invoke-tasks.js.map +1 -0
- package/lib/core/runners/distributed-execution/distributed-execution.api.js +143 -1
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js +115 -1
- package/lib/core/runners/distributed-execution/distributed-execution.runner.js.map +1 -1
- package/lib/core/runners/distributed-execution/process-task.d.ts +7 -0
- package/lib/core/runners/distributed-execution/process-task.js +45 -0
- package/lib/core/runners/distributed-execution/process-task.js.map +1 -0
- package/lib/core/runners/distributed-execution/process-tasks.d.ts +7 -0
- package/lib/core/runners/distributed-execution/process-tasks.js +67 -0
- package/lib/core/runners/distributed-execution/process-tasks.js.map +1 -0
- package/lib/core/runners/distributed-execution/split-task-graph-into-stages.js +37 -1
- package/lib/core/runners/distributed-execution/task-graph-creator.d.ts +2 -0
- package/lib/core/runners/distributed-execution/task-graph-creator.js +100 -1
- package/lib/core/runners/distributed-execution/task-graph-creator.js.map +1 -1
- package/lib/daemon/process-run-end.js +2 -3
- package/lib/daemon/process-run-end.js.map +1 -1
- package/lib/nx-cloud-tasks-runner.js +1 -7
- package/lib/nx-cloud-tasks-runner.js.map +1 -1
- package/lib/utilities/dte-artifact-storage.d.ts +7 -0
- package/lib/utilities/dte-artifact-storage.js +42 -0
- package/lib/utilities/dte-artifact-storage.js.map +1 -0
- package/lib/utilities/nx-imports.js +1 -7
- package/lib/utilities/nx-imports.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
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.processTask = void 0;
|
|
13
|
+
const environment_1 = require("../../../utilities/environment");
|
|
14
|
+
const serializer_overrides_1 = require("../../../utilities/serializer-overrides");
|
|
15
|
+
const { output } = require('../../../utilities/nx-imports');
|
|
16
|
+
function processTask(dteArtifactStorage, tasks, completedTask) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
19
|
+
output.note({
|
|
20
|
+
title: `Processing task ${completedTask.taskId}`,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const matchingTask = tasks.find((tt) => completedTask.taskId === tt.id);
|
|
24
|
+
if (!matchingTask) {
|
|
25
|
+
throw new Error(`Found unknown task: ${completedTask.taskId}`);
|
|
26
|
+
}
|
|
27
|
+
const terminalOutput = yield dteArtifactStorage.retrieveAndExtract(completedTask.hash, completedTask.url);
|
|
28
|
+
output.logCommand(getCommand(matchingTask));
|
|
29
|
+
process.stdout.write(terminalOutput);
|
|
30
|
+
output.addVerticalSeparator();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.processTask = processTask;
|
|
34
|
+
function getCommand(task) {
|
|
35
|
+
const config = task.target.configuration
|
|
36
|
+
? `:${task.target.configuration}`
|
|
37
|
+
: '';
|
|
38
|
+
return [
|
|
39
|
+
'nx',
|
|
40
|
+
'run',
|
|
41
|
+
`${task.target.project}:${task.target.target}${config}`,
|
|
42
|
+
(0, serializer_overrides_1.serializeOverrides)(task),
|
|
43
|
+
].join(' ');
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=process-task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-task.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/distributed-execution/process-task.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,gEAAiE;AACjE,kFAA6E;AAG7E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAE5D,SAAsB,WAAW,CAC/B,kBAAsC,EACtC,KAAa,EACb,aAA4D;;QAE5D,IAAI,6BAAe,EAAE;YACnB,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,mBAAmB,aAAa,CAAC,MAAM,EAAE;aACjD,CAAC,CAAC;SACJ;QACD,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QACxE,IAAI,CAAC,YAAY,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,uBAAuB,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC;SAChE;QAED,MAAM,cAAc,GAAG,MAAM,kBAAkB,CAAC,kBAAkB,CAChE,aAAa,CAAC,IAAI,EAClB,aAAa,CAAC,GAAG,CAClB,CAAC;QAEF,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;QAC5C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACrC,MAAM,CAAC,oBAAoB,EAAE,CAAC;IAChC,CAAC;CAAA;AAvBD,kCAuBC;AAED,SAAS,UAAU,CAAC,IAAU;IAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa;QACtC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE;QACjC,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO;QACL,IAAI;QACJ,KAAK;QACL,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE;QACvD,IAAA,yCAAkB,EAAC,IAAI,CAAC;KACzB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DistributedExecutionApi } from './distributed-execution.api';
|
|
2
|
+
import { Task } from '../../models/run-context.model';
|
|
3
|
+
import { DteArtifactStorage } from '../../../utilities/dte-artifact-storage';
|
|
4
|
+
export declare function processTasks(api: DistributedExecutionApi, dteArtifactStorage: DteArtifactStorage, executionId: string, tasks: Task[]): Promise<{
|
|
5
|
+
commandStatus: any;
|
|
6
|
+
runUrl: any;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,67 @@
|
|
|
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.processTasks = void 0;
|
|
13
|
+
const create_unchanged_value_timeout_1 = require("../../../utilities/create-unchanged-value-timeout");
|
|
14
|
+
const environment_1 = require("../../../utilities/environment");
|
|
15
|
+
const waiter_1 = require("../../../utilities/waiter");
|
|
16
|
+
const process_task_1 = require("./process-task");
|
|
17
|
+
const { output } = require('../../../utilities/nx-imports');
|
|
18
|
+
function processTasks(api, dteArtifactStorage, executionId, tasks) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
const processedTasks = {};
|
|
21
|
+
const failIfNumberOfCompletedTasksDoesNotChangeAfterTimeout = (0, create_unchanged_value_timeout_1.createUnchangedValueTimeout)({
|
|
22
|
+
title: `No new completed tasks after ${environment_1.NO_COMPLETED_TASKS_TIMEOUT / 1000} seconds.`,
|
|
23
|
+
timeout: environment_1.NO_COMPLETED_TASKS_TIMEOUT,
|
|
24
|
+
});
|
|
25
|
+
const waiter = new waiter_1.Waiter();
|
|
26
|
+
while (true) {
|
|
27
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
28
|
+
output.note({
|
|
29
|
+
title: 'Waiting...',
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
yield waiter.wait();
|
|
33
|
+
const r = yield api.status(executionId);
|
|
34
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
35
|
+
output.note({
|
|
36
|
+
title: `Status update`,
|
|
37
|
+
bodyLines: [
|
|
38
|
+
`executionId: ${executionId}`,
|
|
39
|
+
`executionStatus: ${r.executionStatus}`,
|
|
40
|
+
`number of completed tasks: ${r.completedTasks.length}`,
|
|
41
|
+
`error: ${r.criticalErrorMessage}`,
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (r.criticalErrorMessage) {
|
|
46
|
+
output.error({
|
|
47
|
+
title: 'Distributed Execution Terminated',
|
|
48
|
+
bodyLines: ['Error:', r.criticalErrorMessage],
|
|
49
|
+
});
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
failIfNumberOfCompletedTasksDoesNotChangeAfterTimeout(r.completedTasks.length);
|
|
53
|
+
for (const t of r.completedTasks) {
|
|
54
|
+
if (processedTasks[t.taskId])
|
|
55
|
+
continue;
|
|
56
|
+
yield (0, process_task_1.processTask)(dteArtifactStorage, tasks, t);
|
|
57
|
+
waiter.reset();
|
|
58
|
+
processedTasks[t.taskId] = true;
|
|
59
|
+
}
|
|
60
|
+
if (r.executionStatus === 'COMPLETED') {
|
|
61
|
+
return { commandStatus: r.commandStatus, runUrl: r.runUrl };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
exports.processTasks = processTasks;
|
|
67
|
+
//# sourceMappingURL=process-tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-tasks.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/distributed-execution/process-tasks.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,sGAAgG;AAChG,gEAGwC;AACxC,sDAAmD;AACnD,iDAA6C;AAG7C,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAE5D,SAAsB,YAAY,CA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C,MAAM,IAAA,0BAAW,EAAC,kBAAkB,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;gBAChD,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;aACjC;YACD,IAAI,CAAC,CAAC,eAAe,KAAK,WAAW,EAAE;gBACrC,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;aAC7D;SACF;IACH,CAAC;CAAA;AA3DD,oCA2DC"}
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.splitTasksIntoStages = void 0;
|
|
4
|
+
function splitTasksIntoStages(taskGraph) {
|
|
5
|
+
const stages = [];
|
|
6
|
+
const notStagedTaskIds = new Set(Object.values(taskGraph.tasks).map((t) => t.id));
|
|
7
|
+
let stageIndex = 0;
|
|
8
|
+
// Loop through tasks and try to stage them. As tasks are staged, they are removed from the loop
|
|
9
|
+
while (notStagedTaskIds.size > 0) {
|
|
10
|
+
const currentStage = (stages[stageIndex] = []);
|
|
11
|
+
for (const taskId of notStagedTaskIds) {
|
|
12
|
+
let ready = true;
|
|
13
|
+
for (const dependency of taskGraph.dependencies[taskId]) {
|
|
14
|
+
if (notStagedTaskIds.has(dependency)) {
|
|
15
|
+
// dependency has not been staged yet, this task is not ready to be staged.
|
|
16
|
+
ready = false;
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
// Some dependency still has not been staged, skip it for now, it will be processed again
|
|
21
|
+
if (!ready) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
// All the dependencies have been staged, let's stage it.
|
|
25
|
+
const task = taskGraph.tasks[taskId];
|
|
26
|
+
currentStage.push(task);
|
|
27
|
+
}
|
|
28
|
+
// Remove the entire new stage of tasks from the list
|
|
29
|
+
for (const task of currentStage) {
|
|
30
|
+
notStagedTaskIds.delete(task.id);
|
|
31
|
+
}
|
|
32
|
+
stageIndex++;
|
|
33
|
+
}
|
|
34
|
+
return stages;
|
|
35
|
+
}
|
|
36
|
+
exports.splitTasksIntoStages = splitTasksIntoStages;
|
|
37
|
+
//# sourceMappingURL=split-task-graph-into-stages.js.map
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ProjectGraph, Task, TaskGraph } from '../../models/run-context.model';
|
|
2
|
+
import { CloudTaskRunnerOptions } from '../../models/cloud-task-runner-options';
|
|
3
|
+
export declare function createTaskGraphCompat(options: CloudTaskRunnerOptions, projectGraph: ProjectGraph, tasks: Task[]): TaskGraph;
|
|
2
4
|
/**
|
|
3
5
|
* This is only used for versions of Nx prior to 14 where the task graph
|
|
4
6
|
* wasn't part of the context so we have to recreate it
|
|
@@ -1 +1,100 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskGraphCreator = exports.createTaskGraphCompat = void 0;
|
|
4
|
+
const stripJsonComments = require("strip-json-comments");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const { getDependencyConfigs, workspaceRoot, } = require('../../../utilities/nx-imports');
|
|
7
|
+
function createTaskGraphCompat(options, projectGraph, tasks) {
|
|
8
|
+
const nxjson = JSON.parse(stripJsonComments((0, fs_1.readFileSync)(`${workspaceRoot}/nx.json`).toString()));
|
|
9
|
+
return new TaskGraphCreator(projectGraph, getDefaultDependencyConfigs(nxjson, options)).createTaskGraph(tasks);
|
|
10
|
+
}
|
|
11
|
+
exports.createTaskGraphCompat = createTaskGraphCompat;
|
|
12
|
+
function getDefaultDependencyConfigs(nxJson, runnerOptions) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const defaults = (_a = nxJson.targetDependencies) !== null && _a !== void 0 ? _a : {};
|
|
15
|
+
const strictlyOrderedTargets = runnerOptions
|
|
16
|
+
? (_b = runnerOptions.strictlyOrderedTargets) !== null && _b !== void 0 ? _b : ['build']
|
|
17
|
+
: [];
|
|
18
|
+
// Strictly Ordered Targets depend on their dependencies
|
|
19
|
+
for (const target of strictlyOrderedTargets) {
|
|
20
|
+
defaults[target] = defaults[target] || [];
|
|
21
|
+
defaults[target].push({
|
|
22
|
+
target,
|
|
23
|
+
projects: 'dependencies',
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return defaults;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* This is only used for versions of Nx prior to 14 where the task graph
|
|
30
|
+
* wasn't part of the context so we have to recreate it
|
|
31
|
+
*/
|
|
32
|
+
class TaskGraphCreator {
|
|
33
|
+
constructor(projectGraph, defaultTargetDependencies) {
|
|
34
|
+
this.projectGraph = projectGraph;
|
|
35
|
+
this.defaultTargetDependencies = defaultTargetDependencies;
|
|
36
|
+
}
|
|
37
|
+
createTaskGraph(tasks) {
|
|
38
|
+
const graph = {
|
|
39
|
+
roots: [],
|
|
40
|
+
tasks: {},
|
|
41
|
+
dependencies: {},
|
|
42
|
+
};
|
|
43
|
+
for (const task of tasks) {
|
|
44
|
+
this.addTaskToGraph(task, graph);
|
|
45
|
+
const dependencyConfigs = getDependencyConfigs(task.target, this.defaultTargetDependencies, this.projectGraph);
|
|
46
|
+
if (!dependencyConfigs) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
this.addTaskDependencies(task, dependencyConfigs, tasks, graph);
|
|
50
|
+
}
|
|
51
|
+
graph.roots = Object.keys(graph.dependencies).filter((k) => graph.dependencies[k].length === 0);
|
|
52
|
+
return graph;
|
|
53
|
+
}
|
|
54
|
+
addTaskDependencies(task, dependencyConfigs, tasks, graph) {
|
|
55
|
+
for (const dependencyConfig of dependencyConfigs) {
|
|
56
|
+
if (dependencyConfig.projects === 'self') {
|
|
57
|
+
for (const t of tasks) {
|
|
58
|
+
if (t.target.project === task.target.project &&
|
|
59
|
+
t.target.target === dependencyConfig.target) {
|
|
60
|
+
graph.dependencies[task.id].push(t.id);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else if (dependencyConfig.projects === 'dependencies') {
|
|
65
|
+
const seen = new Set();
|
|
66
|
+
this.addDependencies(task.target.project, dependencyConfig.target, tasks, graph, task.id, seen);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
addDependencies(project, target, tasks, graph, taskId, seen) {
|
|
71
|
+
seen.add(project);
|
|
72
|
+
const dependencies = this.projectGraph.dependencies[project];
|
|
73
|
+
if (dependencies) {
|
|
74
|
+
const projectDependencies = dependencies.map((dependency) => dependency.target);
|
|
75
|
+
for (const projectDependency of projectDependencies) {
|
|
76
|
+
if (seen.has(projectDependency)) {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const dependency = this.findTask({ project: projectDependency, target }, tasks);
|
|
80
|
+
if (dependency) {
|
|
81
|
+
if (graph.dependencies[taskId].indexOf(dependency.id) === -1) {
|
|
82
|
+
graph.dependencies[taskId].push(dependency.id);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this.addDependencies(projectDependency, target, tasks, graph, taskId, seen);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
findTask({ project, target }, tasks) {
|
|
92
|
+
return tasks.find((t) => t.target.project === project && t.target.target === target);
|
|
93
|
+
}
|
|
94
|
+
addTaskToGraph(task, graph) {
|
|
95
|
+
graph.tasks[task.id] = task;
|
|
96
|
+
graph.dependencies[task.id] = [];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.TaskGraphCreator = TaskGraphCreator;
|
|
100
|
+
//# sourceMappingURL=task-graph-creator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-graph-creator.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/distributed-execution/task-graph-creator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"task-graph-creator.js","sourceRoot":"","sources":["../../../../../../../../libs/nx-packages/nx-cloud/lib/core/runners/distributed-execution/task-graph-creator.ts"],"names":[],"mappings":";;;AACA,yDAAyD;AACzD,2BAAkC;AAGlC,MAAM,EACJ,oBAAoB,EACpB,aAAa,GACd,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AAE7C,SAAgB,qBAAqB,CACnC,OAA+B,EAC/B,YAA0B,EAC1B,KAAa;IAEb,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CACvB,iBAAiB,CAAC,IAAA,iBAAY,EAAC,GAAG,aAAa,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC,CACvE,CAAC;IACF,OAAO,IAAI,gBAAgB,CACzB,YAAY,EACZ,2BAA2B,CAAC,MAAM,EAAE,OAAc,CAAC,CACpD,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAZD,sDAYC;AAED,SAAS,2BAA2B,CAClC,MAAW,EACX,aAEC;;IAED,MAAM,QAAQ,GAA0B,MAAA,MAAM,CAAC,kBAAkB,mCAAI,EAAE,CAAC;IACxE,MAAM,sBAAsB,GAAG,aAAa;QAC1C,CAAC,CAAC,MAAA,aAAa,CAAC,sBAAsB,mCAAI,CAAC,OAAO,CAAC;QACnD,CAAC,CAAC,EAAE,CAAC;IACP,wDAAwD;IACxD,KAAK,MAAM,MAAM,IAAI,sBAAsB,EAAE;QAC3C,QAAQ,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QAC1C,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;YACpB,MAAM;YACN,QAAQ,EAAE,cAAc;SACzB,CAAC,CAAC;KACJ;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;GAGG;AACH,MAAa,gBAAgB;IAC3B,YACmB,YAA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iB,EACjB,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,EACN,IAAI,CACL,CAAC;iBACH;aACF;SACF;IACH,CAAC;IAEO,QAAQ,CACd,EAAE,OAAO,EAAE,MAAM,EAAuC,EACxD,KAAa;QAEb,OAAO,KAAK,CAAC,IAAI,CACf,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,KAAK,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,MAAM,CAC3D,CAAC;IACX,CAAC;IAEO,cAAc,CAAC,IAAU,EAAE,KAAU;QAC3C,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;QAC5B,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;IACnC,CAAC;CACF;AAvHD,4CAuHC"}
|
|
@@ -16,21 +16,20 @@ const e2e_encryption_1 = require("../core/file-storage/e2e-encryption");
|
|
|
16
16
|
const environment_1 = require("../utilities/environment");
|
|
17
17
|
const message_reporter_1 = require("../core/terminal-output/message-reporter");
|
|
18
18
|
const metric_logger_1 = require("../utilities/metric-logger");
|
|
19
|
-
const { Cache } = require('../utilities/nx-imports');
|
|
20
19
|
function processRunEnd(data, logger) {
|
|
21
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
21
|
const encryption = new e2e_encryption_1.E2EEncryption(data.encryptionKey);
|
|
23
22
|
const errorApi = new error_reporter_api_1.ErrorReporterApi(data.runnerOptions);
|
|
24
23
|
const fileStorage = new file_storage_1.FileStorage(encryption, errorApi, false, false);
|
|
24
|
+
const cachePath = (0, environment_1.getNxCacheDirectory)(data.runnerOptions);
|
|
25
25
|
const reporter = new message_reporter_1.MessageReporter(data.runnerOptions);
|
|
26
26
|
const runContext = {};
|
|
27
27
|
const machineInfo = (0, environment_1.getMachineInfo)(data.runnerOptions);
|
|
28
28
|
const api = new cloud_run_api_1.CloudRunApi(reporter, runContext, data.runnerOptions, machineInfo);
|
|
29
|
-
const cache = new Cache(data.runnerOptions);
|
|
30
29
|
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
31
30
|
logger.log('Uploading file artifacts');
|
|
32
31
|
try {
|
|
33
|
-
yield Promise.all(data.uploads.map((t) => fileStorage.store(t.hash, t.url,
|
|
32
|
+
yield Promise.all(data.uploads.map((t) => fileStorage.store(t.hash, t.url, cachePath)));
|
|
34
33
|
logger.log('Done uploading file artifacts');
|
|
35
34
|
}
|
|
36
35
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-run-end.js","sourceRoot":"","sources":["../../../../../../libs/nx-packages/nx-cloud/lib/daemon/process-run-end.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,oEAAgE;AAChE,+EAA0E;AAC1E,uEAAkE;AAClE,wEAAoE;AACpE,
|
|
1
|
+
{"version":3,"file":"process-run-end.js","sourceRoot":"","sources":["../../../../../../libs/nx-packages/nx-cloud/lib/daemon/process-run-end.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,oEAAgE;AAChE,+EAA0E;AAC1E,uEAAkE;AAClE,wEAAoE;AACpE,0DAA+E;AAC/E,+EAA2E;AAC3E,8DAA8D;AAE9D,SAA8B,aAAa,CACzC,IAAS,EACT,MAAsC;;QAEtC,MAAM,UAAU,GAAG,IAAI,8BAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzD,MAAM,QAAQ,GAAG,IAAI,qCAAgB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1D,MAAM,WAAW,GAAG,IAAI,0BAAW,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAExE,MAAM,SAAS,GAAG,IAAA,iCAAmB,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1D,MAAM,QAAQ,GAAG,IAAI,kCAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzD,MAAM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ChB;YACD,MAAM,IAAA,gCAAgB,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,CAAC,CAAA,EAAE,CAAC,CAAC,CAAC;QAEN,OAAO,IAAI,CAAC;IACd,CAAC;CAAA;AApDD,gCAoDC"}
|
|
@@ -17,13 +17,7 @@ const { tasksRunner, output, runnerReturnsPromise, } = require('./utilities/nx-i
|
|
|
17
17
|
const nxCloudTasksRunner = (tasks, options, context) => {
|
|
18
18
|
const nxArgs = context.nxArgs;
|
|
19
19
|
const noAccessTokenDefined = !environment_1.ACCESS_TOKEN && !options.accessToken;
|
|
20
|
-
const noCloud = nxArgs['cloud'] === false
|
|
21
|
-
if (options.skipNxCache) {
|
|
22
|
-
output.warn({
|
|
23
|
-
title: "--skip-nx-cache disables the connection to Nx Cloud for the current run.",
|
|
24
|
-
bodyLines: ['The remote cache will not be read from or written to during this run.']
|
|
25
|
-
});
|
|
26
|
-
}
|
|
20
|
+
const noCloud = nxArgs['cloud'] === false;
|
|
27
21
|
if (noAccessTokenDefined || noCloud) {
|
|
28
22
|
return tasksRunner(tasks, options, context);
|
|
29
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nx-cloud-tasks-runner.js","sourceRoot":"","sources":["../../../../../libs/nx-packages/nx-cloud/lib/nx-cloud-tasks-runner.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,yDAKiC;AACjC,6CAA+E;AAC/E,4FAA4F;AAE5F,2GAAiG;AAEjG,MAAM,EACJ,WAAW,EACX,MAAM,EACN,oBAAoB,GACrB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAEtC,MAAM,kBAAkB,GAAQ,CAC9B,KAAa,EACb,OAA+B,EAC/B,OAAY,EACP,EAAE;IACP,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAE9B,MAAM,oBAAoB,GAAG,CAAC,0BAAY,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;IACnE,MAAM,OAAO,GAAG,M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
|
+
export declare class DteArtifactStorage {
|
|
3
|
+
private readonly fileStorage;
|
|
4
|
+
private readonly cacheDirectory;
|
|
5
|
+
constructor(fileStorage: FileStorage, cacheDirectory: string);
|
|
6
|
+
retrieveAndExtract(hash: string, url: string): Promise<string>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.DteArtifactStorage = void 0;
|
|
13
|
+
const environment_1 = require("./environment");
|
|
14
|
+
const fs_extra_1 = require("fs-extra");
|
|
15
|
+
const path_1 = require("path");
|
|
16
|
+
const { output, workspaceRoot } = require('./nx-imports');
|
|
17
|
+
class DteArtifactStorage {
|
|
18
|
+
constructor(fileStorage, cacheDirectory) {
|
|
19
|
+
this.fileStorage = fileStorage;
|
|
20
|
+
this.cacheDirectory = cacheDirectory;
|
|
21
|
+
}
|
|
22
|
+
retrieveAndExtract(hash, url) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
25
|
+
output.note({
|
|
26
|
+
title: `Retrieving artifacts from ${url}`,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
yield this.fileStorage.retrieve(hash, url, this.cacheDirectory);
|
|
30
|
+
if (environment_1.VERBOSE_LOGGING) {
|
|
31
|
+
output.note({
|
|
32
|
+
title: `Extracting artifacts`,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const outputs = (0, path_1.join)(this.cacheDirectory, hash, 'outputs');
|
|
36
|
+
yield (0, fs_extra_1.copy)(outputs, workspaceRoot);
|
|
37
|
+
return (yield (0, fs_extra_1.readFile)((0, path_1.join)(this.cacheDirectory, hash, 'terminalOutput'))).toString();
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.DteArtifactStorage = DteArtifactStorage;
|
|
42
|
+
//# sourceMappingURL=dte-artifact-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dte-artifact-storage.js","sourceRoot":"","sources":["../../../../../../libs/nx-packages/nx-cloud/lib/utilities/dte-artifact-storage.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CAAgD;AAChD,uCAA0C;AAC1C,+BAA4B;AAE5B,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAE1D,MAAa,kBAAkB;IAC7B,YACmB,WAAwB,EACxB,cAAsB;QADtB,gBAAW,GAAX,WAAW,CAAa;QACxB,mBAAc,GAAd,cAAc,CAAQ;IACtC,CAAC;IAEE,kBAAkB,CAAC,IAAY,EAAE,GAAW;;YAChD,IAAI,6BAAe,EAAE;gBACnB,MAAM,CAAC,IAAI,CAAC;oBACV,KAAK,EAAE,6BAA6B,GAAG,EAAE;iBAC1C,CAAC,CAAC;aACJ;YAED,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;YAEhE,IAAI,6BAAe,EAAE;gBACnB,MAAM,CAAC,IAAI,CAAC;oBACV,KAAK,EAAE,sBAAsB;iBAC9B,CAAC,CAAC;aACJ;YACD,MAAM,OAAO,GAAG,IAAA,WAAI,EAAC,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;YAC3D,MAAM,IAAA,eAAI,EAAC,OAAO,EAAE,aAAa,CAAC,CAAC;YACnC,OAAO,CACL,MAAM,IAAA,mBAAQ,EAAC,IAAA,WAAI,EAAC,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAClE,CAAC,QAAQ,EAAE,CAAC;QACf,CAAC;KAAA;CACF;AA1BD,gDA0BC"}
|
|
@@ -9,8 +9,7 @@ try {
|
|
|
9
9
|
catch (_a) {
|
|
10
10
|
workspaceRoot = require('nx/src/utils/workspace-root').workspaceRoot;
|
|
11
11
|
}
|
|
12
|
-
const { getDependencyConfigs
|
|
13
|
-
const { Cache } = require('nx/src/tasks-runner/cache');
|
|
12
|
+
const { getDependencyConfigs } = require('nx/src/tasks-runner/utils');
|
|
14
13
|
const tasksRunner = require('nx/tasks-runners/default').default;
|
|
15
14
|
const { CompositeLifeCycle } = require('nx/src/tasks-runner/life-cycle');
|
|
16
15
|
exports.runnerReturnsPromise = true;
|
|
@@ -19,8 +18,6 @@ try {
|
|
|
19
18
|
exports.tasksRunner = tasksRunner;
|
|
20
19
|
exports.CompositeLifeCycle = CompositeLifeCycle;
|
|
21
20
|
exports.getDependencyConfigs = getDependencyConfigs;
|
|
22
|
-
exports.getOutputs = getOutputs;
|
|
23
|
-
exports.Cache = Cache;
|
|
24
21
|
}
|
|
25
22
|
catch (_b) {
|
|
26
23
|
const { output } = require('@nrwl/workspace/src/utilities/output');
|
|
@@ -33,15 +30,12 @@ try {
|
|
|
33
30
|
require('@nrwl/workspace/src/tasks-runner/life-cycle').CompositeLifeCycle;
|
|
34
31
|
}
|
|
35
32
|
catch (e) { }
|
|
36
|
-
const { Cache } = require('@nrwl/workspace/src/tasks-runner/cache');
|
|
37
33
|
exports.runnerReturnsPromise = false;
|
|
38
34
|
exports.output = output;
|
|
39
35
|
exports.workspaceRoot = appRootPath;
|
|
40
36
|
exports.tasksRunner = tasksRunnerV2;
|
|
41
37
|
exports.CompositeLifeCycle = CompositeLifeCycle;
|
|
42
38
|
exports.getDependencyConfigs = getDependencyConfigs;
|
|
43
|
-
exports.getOutputs = getOutputs;
|
|
44
|
-
exports.Cache = Cache;
|
|
45
39
|
}
|
|
46
40
|
}
|
|
47
41
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nx-imports.js","sourceRoot":"","sources":["../../../../../../libs/nx-packages/nx-cloud/lib/utilities/nx-imports.ts"],"names":[],"mappings":";AAAA,IAAI;IACF,IAAI;QACF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAClD,IAAI,aAAa,CAAC;QAClB,IAAI;YACF,aAAa,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC,aAAa,CAAC;SAChE;QAAC,OAAO,EAAE,EAAE;YACX,aAAa,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC,aAAa,CAAC;SACtE;QACD,MAAM,
|
|
1
|
+
{"version":3,"file":"nx-imports.js","sourceRoot":"","sources":["../../../../../../libs/nx-packages/nx-cloud/lib/utilities/nx-imports.ts"],"names":[],"mappings":";AAAA,IAAI;IACF,IAAI;QACF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAClD,IAAI,aAAa,CAAC;QAClB,IAAI;YACF,aAAa,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC,aAAa,CAAC;SAChE;QAAC,OAAO,EAAE,EAAE;YACX,aAAa,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC,aAAa,CAAC;SACtE;QACD,MAAM,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;QACtE,MAAM,WAAW,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC,OAAO,CAAC;QAChE,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,g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