@lage-run/cli 0.4.16 → 0.4.17
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/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Fri, 21 Oct 2022
|
|
5
|
+
"date": "Fri, 21 Oct 2022 23:04:28 GMT",
|
|
6
|
+
"tag": "@lage-run/cli_v0.4.17",
|
|
7
|
+
"version": "0.4.17",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "ken@gizzar.com",
|
|
12
|
+
"package": "@lage-run/cli",
|
|
13
|
+
"commit": "d93d94b25f3b157dedc555f836b66ee547500cd5",
|
|
14
|
+
"comment": "fixing the max worker again - this time we need to account for general pool availability"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Fri, 21 Oct 2022 21:36:38 GMT",
|
|
6
21
|
"tag": "@lage-run/cli_v0.4.16",
|
|
7
22
|
"version": "0.4.16",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# Change Log - @lage-run/cli
|
|
2
2
|
|
|
3
|
-
This log was last generated on Fri, 21 Oct 2022
|
|
3
|
+
This log was last generated on Fri, 21 Oct 2022 23:04:28 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.4.17
|
|
8
|
+
|
|
9
|
+
Fri, 21 Oct 2022 23:04:28 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- fixing the max worker again - this time we need to account for general pool availability (ken@gizzar.com)
|
|
14
|
+
|
|
7
15
|
## 0.4.16
|
|
8
16
|
|
|
9
|
-
Fri, 21 Oct 2022 21:36:
|
|
17
|
+
Fri, 21 Oct 2022 21:36:38 GMT
|
|
10
18
|
|
|
11
19
|
### Patches
|
|
12
20
|
|
|
@@ -4,11 +4,15 @@ exports.getMaxWorkersPerTask = void 0;
|
|
|
4
4
|
function getMaxWorkersPerTask(pipelineConfig, concurrency) {
|
|
5
5
|
var _a, _b;
|
|
6
6
|
const maxWorkersPerTask = new Map();
|
|
7
|
-
let
|
|
7
|
+
let generalPoolCount = 0;
|
|
8
|
+
let generatelPoolMaxWorkers = 0;
|
|
9
|
+
let dedicatedPoolCount = 0;
|
|
10
|
+
let dedicatedPoolMaxWorkers = 0;
|
|
8
11
|
for (const [task, taskConfig] of Object.entries(pipelineConfig)) {
|
|
9
12
|
if (!Array.isArray(taskConfig) && !task.includes("#")) {
|
|
10
13
|
const maxWorkerOption = (_a = taskConfig.maxWorkers) !== null && _a !== void 0 ? _a : (_b = taskConfig.options) === null || _b === void 0 ? void 0 : _b.maxWorkers;
|
|
11
14
|
if (typeof maxWorkerOption === "undefined") {
|
|
15
|
+
generalPoolCount++;
|
|
12
16
|
continue;
|
|
13
17
|
}
|
|
14
18
|
let maxWorkers = 0;
|
|
@@ -19,14 +23,20 @@ function getMaxWorkersPerTask(pipelineConfig, concurrency) {
|
|
|
19
23
|
maxWorkers = maxWorkerOption;
|
|
20
24
|
}
|
|
21
25
|
maxWorkersPerTask.set(task, maxWorkers);
|
|
22
|
-
|
|
26
|
+
dedicatedPoolCount++;
|
|
27
|
+
dedicatedPoolMaxWorkers += maxWorkers;
|
|
23
28
|
}
|
|
24
29
|
}
|
|
30
|
+
if (dedicatedPoolCount > 0 && generalPoolCount > 0) {
|
|
31
|
+
const avgMaxWorkers = dedicatedPoolMaxWorkers / dedicatedPoolCount;
|
|
32
|
+
generatelPoolMaxWorkers = Math.max(1, Math.floor(avgMaxWorkers * generalPoolCount));
|
|
33
|
+
}
|
|
34
|
+
const grandTotal = dedicatedPoolMaxWorkers + generatelPoolMaxWorkers;
|
|
25
35
|
// try to adjust the maxWorkersPerTask to fit the concurrency
|
|
26
|
-
if (
|
|
36
|
+
if (grandTotal > concurrency) {
|
|
27
37
|
let newTotal = 0;
|
|
28
38
|
for (const [task, maxWorkers] of maxWorkersPerTask.entries()) {
|
|
29
|
-
const newMaxWorkers = Math.max(1, Math.floor((maxWorkers /
|
|
39
|
+
const newMaxWorkers = Math.max(1, Math.floor((maxWorkers / grandTotal) * concurrency));
|
|
30
40
|
newTotal += newMaxWorkers;
|
|
31
41
|
maxWorkersPerTask.set(task, newMaxWorkers);
|
|
32
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMaxWorkersPerTask.js","sourceRoot":"","sources":["../../src/config/getMaxWorkersPerTask.ts"],"names":[],"mappings":";;;AAEA,SAAgB,oBAAoB,CAAC,cAAyC,EAAE,WAAmB;;IACjG,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEpD,IAAI,
|
|
1
|
+
{"version":3,"file":"getMaxWorkersPerTask.js","sourceRoot":"","sources":["../../src/config/getMaxWorkersPerTask.ts"],"names":[],"mappings":";;;AAEA,SAAgB,oBAAoB,CAAC,cAAyC,EAAE,WAAmB;;IACjG,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEpD,IAAI,gBAAgB,GAAG,CAAC,CAAC;IACzB,IAAI,uBAAuB,GAAG,CAAC,CAAC;IAEhC,IAAI,kBAAkB,GAAG,CAAC,CAAC;IAC3B,IAAI,uBAAuB,GAAG,CAAC,CAAC;IAEhC,KAAK,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;QAC/D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACrD,MAAM,eAAe,GAAuB,MAAA,UAAU,CAAC,UAAU,mCAAI,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