@gapi/gcli 1.8.264 → 1.8.265
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/README.md
CHANGED
|
@@ -409,6 +409,8 @@ function:
|
|
|
409
409
|
concurrency: 1
|
|
410
410
|
functionTimeout: 60
|
|
411
411
|
specializationTimeout: 120
|
|
412
|
+
spread: machines # replicas on different machines ('none' = the scheduler decides)
|
|
413
|
+
spreadStrict: false # true = a replica waits rather than share a machine
|
|
412
414
|
|
|
413
415
|
environment:
|
|
414
416
|
name: nodejs
|
|
@@ -432,6 +434,14 @@ options:
|
|
|
432
434
|
external: []
|
|
433
435
|
```
|
|
434
436
|
|
|
437
|
+
**Spread across machines** (newdeploy, plan 33): `spread: machines` puts the
|
|
438
|
+
replicas on different machines of the cluster, as evenly as possible, so a
|
|
439
|
+
machine going down takes one replica, not several (use it with
|
|
440
|
+
`minScale >= 2`). Soft by default: it never blocks a scale-up.
|
|
441
|
+
`spreadStrict: true` keeps a replica waiting rather than sharing a machine.
|
|
442
|
+
Flags: `--spread machines|none`, `--spreadStrict true|false`. Left out = the
|
|
443
|
+
lambda keeps what it has. Changing it restarts the replicas once.
|
|
444
|
+
|
|
435
445
|
The same file can also carry `cluster:`, `rabbitmq:`, `plugin:` and `triggers:` sections, read by `cluster:apply` / `cluster:create`, `rabbitmq:create`, `plugin:install` and `cron:create` respectively (each also accepts its own dedicated `--spec` file, e.g. `cluster.yaml`, if you'd rather keep them separate):
|
|
436
446
|
|
|
437
447
|
```yaml
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
## 2026-11-17 - lambda-spread: lambda:create/update --spread and --spreadStrict, lambforge.yaml spread keys
|
|
2
|
+
|
|
3
|
+
**Feature:** lambda-spread · **Type:** feat
|
|
4
|
+
|
|
5
|
+
- `lambda:create` / `lambda:update` take `--spread machines|none` and
|
|
6
|
+
`--spreadStrict true|false`; `lambforge.yaml` takes
|
|
7
|
+
`function.scaleOptions.spread` / `spreadStrict`. Flags win over the yaml.
|
|
8
|
+
Sent only when set (`helpers/spread.ts` `spreadScaleOptions`), so gcli
|
|
9
|
+
works against an API without the fields and an update without them keeps
|
|
10
|
+
the lambda's current choice. Canonical doc: graphql-server-lambdas
|
|
11
|
+
`docs/features/lambda-spread.md`.
|
|
12
|
+
- **Test:** `npx jest --coverage=false test/lambda-spread.spec.ts`.
|
|
13
|
+
- **Debug:** "--spread must be 'machines' or 'none'" = a typo in the flag or
|
|
14
|
+
yaml. An API older than the feature answers `Field "spread" is not defined
|
|
15
|
+
by type "LambdaScaleInputOptions"`.
|
|
16
|
+
- **Verification:** jest 174/174, tsc clean.
|
package/docs/features/README.md
CHANGED
|
@@ -42,3 +42,4 @@ Outline (drop sections that don't apply):
|
|
|
42
42
|
| `mcp-proxy` | [mcp-proxy.md](mcp-proxy.md) | `gcli mcp:start` - local stdio MCP server forwarding to the platform MCP endpoint; token refreshed per request |
|
|
43
43
|
| `cli-browser-login` | [cli-browser-login.md](cli-browser-login.md) | Slice (canonical: graphql-server): `gcli login` with no token through the browser; `mcp:start` LambforgeLogin |
|
|
44
44
|
| `lambda-site-url` | [lambda-site-url.md](lambda-site-url.md) | Slice (canonical: graphql-server-lambdas): `Site:` line after create/update |
|
|
45
|
+
| `lambda-spread` | [lambda-spread.md](lambda-spread.md) | Slice (canonical: graphql-server-lambdas): replicas across machines (plan 33): `--spread` / `--spreadStrict`, yaml keys |
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# lambda-spread (gcli slice)
|
|
2
|
+
|
|
3
|
+
Canonical: graphql-server-lambdas `docs/features/lambda-spread.md` (plan 33).
|
|
4
|
+
|
|
5
|
+
- Flags: `--spread machines|none`, `--spreadStrict true|false` on
|
|
6
|
+
`lambda:create` / `lambda:update`.
|
|
7
|
+
- yaml: `function.scaleOptions.spread`, `function.scaleOptions.spreadStrict`.
|
|
8
|
+
- `src/commands/lambda/helpers/spread.ts` - only set values are sent; flags
|
|
9
|
+
win over the yaml; unknown values refused before the call.
|
package/package.json
CHANGED
package/release/index.js
CHANGED
|
@@ -288702,6 +288702,23 @@ var init_package = __esm({
|
|
|
288702
288702
|
}
|
|
288703
288703
|
});
|
|
288704
288704
|
|
|
288705
|
+
// src/commands/lambda/helpers/spread.ts
|
|
288706
|
+
function spreadScaleOptions(cmd, spec) {
|
|
288707
|
+
const spread = cmd.spread ?? spec?.spread;
|
|
288708
|
+
const strict = cmd.spreadStrict ?? spec?.spreadStrict;
|
|
288709
|
+
if (spread != null && !["none", "machines"].includes(String(spread))) {
|
|
288710
|
+
throw new Error(`--spread must be 'machines' or 'none' (got '${spread}')`);
|
|
288711
|
+
}
|
|
288712
|
+
return {
|
|
288713
|
+
...spread != null ? { spread: String(spread) } : {},
|
|
288714
|
+
...strict != null ? { spreadStrict: String(strict) === "true" } : {}
|
|
288715
|
+
};
|
|
288716
|
+
}
|
|
288717
|
+
var init_spread = __esm({
|
|
288718
|
+
"src/commands/lambda/helpers/spread.ts"() {
|
|
288719
|
+
}
|
|
288720
|
+
});
|
|
288721
|
+
|
|
288705
288722
|
// src/commands/lambda/helpers/index.ts
|
|
288706
288723
|
function streamToBufferPromise(file2) {
|
|
288707
288724
|
return new Promise((resolve2, reject) => {
|
|
@@ -288728,6 +288745,7 @@ var init_helpers2 = __esm({
|
|
|
288728
288745
|
init_package();
|
|
288729
288746
|
init_load_spec();
|
|
288730
288747
|
init_read_file();
|
|
288748
|
+
init_spread();
|
|
288731
288749
|
ReadFile2 = (file2) => readFileAsObservable(file2).pipe((0, import_operators18.catchError)(() => (0, import_rxjs35.of)("")));
|
|
288732
288750
|
createOrUpdateLambda = (cmd, type) => (0, import_rxjs35.lastValueFrom)(
|
|
288733
288751
|
parseProjectId(cmd.project).pipe(
|
|
@@ -288823,7 +288841,8 @@ var init_helpers2 = __esm({
|
|
|
288823
288841
|
// 500 / 60 / 120 here was refused on plans with lower maxima.
|
|
288824
288842
|
concurrency: cmd.concurrency || payload.scaleOptions?.concurrency || 0,
|
|
288825
288843
|
functionTimeout: cmd.functionTimeout || payload.scaleOptions?.functionTimeout || 0,
|
|
288826
|
-
specializationTimeout: cmd.specializationTimeout || payload.scaleOptions?.specializationTimeout || 0
|
|
288844
|
+
specializationTimeout: cmd.specializationTimeout || payload.scaleOptions?.specializationTimeout || 0,
|
|
288845
|
+
...spreadScaleOptions(cmd, payload.scaleOptions)
|
|
288827
288846
|
}
|
|
288828
288847
|
})
|
|
288829
288848
|
);
|
|
@@ -325164,6 +325183,14 @@ function registerLambdaCommands(program2) {
|
|
|
325164
325183
|
[
|
|
325165
325184
|
"--specializationTimeout <specializationTimeout>",
|
|
325166
325185
|
"Timeout for executor to wait for function pod creation"
|
|
325186
|
+
],
|
|
325187
|
+
[
|
|
325188
|
+
"--spread <spread>",
|
|
325189
|
+
"Where the replicas run (newdeploy): 'machines' = on different machines of the cluster, as evenly as possible; 'none' = the scheduler decides"
|
|
325190
|
+
],
|
|
325191
|
+
[
|
|
325192
|
+
"--spreadStrict <spreadStrict>",
|
|
325193
|
+
"With --spread machines: 'true' = a replica waits rather than share a machine; 'false' (default) = prefer different machines, never block a scale-up"
|
|
325167
325194
|
]
|
|
325168
325195
|
];
|
|
325169
325196
|
createCommand("lambda:create")(createOrUpdateOptions)(program2).action(
|