@opengeni/config 0.11.0 → 0.12.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/dist/index.d.ts +1 -0
- package/dist/index.js +21 -22
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +24 -30
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "OpenGeni runtime configuration: settings resolution, deployment knobs, and config validation shared across the server packages.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"prepublishOnly": "bash ../../scripts/prepublish-guard"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@opengeni/codex": "^0.2.
|
|
37
|
-
"@opengeni/contracts": "^0.
|
|
36
|
+
"@opengeni/codex": "^0.2.13",
|
|
37
|
+
"@opengeni/contracts": "^0.40.0",
|
|
38
38
|
"zod": "^4.2.1"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
package/src/index.ts
CHANGED
|
@@ -249,7 +249,13 @@ const SettingsSchema = z.object({
|
|
|
249
249
|
agentStableVersion: z
|
|
250
250
|
.string()
|
|
251
251
|
.regex(/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/u)
|
|
252
|
-
.default("0.1.
|
|
252
|
+
.default("0.1.12"),
|
|
253
|
+
// Optional independent beta-channel pointer. When unset, the beta update
|
|
254
|
+
// manifest route is unavailable rather than silently serving stable.
|
|
255
|
+
agentBetaVersion: z
|
|
256
|
+
.string()
|
|
257
|
+
.regex(/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/u)
|
|
258
|
+
.optional(),
|
|
253
259
|
productAccessMode: ProductAccessMode.default("local"),
|
|
254
260
|
billingMode: BillingMode.default("disabled"),
|
|
255
261
|
entitlementsMode: EntitlementsMode.default("none"),
|
|
@@ -700,10 +706,13 @@ const SettingsSchema = z.object({
|
|
|
700
706
|
// the deploy-staging IaC secret/configmap pattern.
|
|
701
707
|
sandboxSelfhostedEnabled: EnvBoolean.default(false),
|
|
702
708
|
// Gates the op-stream (streaming exec) transport to Connected Machines. The
|
|
703
|
-
// runner must ALSO advertise Capabilities.op_stream
|
|
704
|
-
//
|
|
709
|
+
// runner must ALSO advertise Capabilities.op_stream. Streaming is the default
|
|
710
|
+
// because it is the only transport that can keep a command alive without an
|
|
711
|
+
// arbitrary request/reply wall while still supporting replay and cancellation.
|
|
712
|
+
// Older runners remain usable when an explicit positive exec timeout is set.
|
|
713
|
+
// EnvBoolean (NOT
|
|
705
714
|
// z.coerce.boolean(), which coerces "false" -> true).
|
|
706
|
-
agentOpStreamEnabled: EnvBoolean.default(
|
|
715
|
+
agentOpStreamEnabled: EnvBoolean.default(true),
|
|
707
716
|
// The HMAC secret the control plane signs the enrollment bearer credential with
|
|
708
717
|
// (the `oge_` envelope the agent presents back to the control plane). Optional:
|
|
709
718
|
// when ABSENT and sandboxSelfhostedEnabled is on, the poll route reports the
|
|
@@ -761,23 +770,15 @@ const SettingsSchema = z.object({
|
|
|
761
770
|
selfhostedNatsControlUser: z.string().optional(),
|
|
762
771
|
selfhostedNatsControlPassword: z.string().optional(),
|
|
763
772
|
// --- selfhosted (Connected Machine) control/exec op deadlines ---------------
|
|
764
|
-
//
|
|
765
|
-
//
|
|
766
|
-
//
|
|
767
|
-
//
|
|
768
|
-
//
|
|
769
|
-
//
|
|
770
|
-
//
|
|
771
|
-
//
|
|
772
|
-
// The exec default is a DELIBERATELY MODEST 2min (not 5): the agent-side admission
|
|
773
|
-
// pool is (until a later agent release) a FLAT 8 permits with no per-class split,
|
|
774
|
-
// so 8 slow execs holding a permit for 5 minutes would blanket-DRAIN every fs/git
|
|
775
|
-
// op — shipping the amplifier before the class-aware-admission fix. 2min still
|
|
776
|
-
// clears the large majority of the observed >30s exec tail; genuinely long jobs run
|
|
777
|
-
// in the background (see the exec-deadline hint) or raise the knob per deployment.
|
|
778
|
-
// Knobs: OPENGENI_SANDBOX_SELFHOSTED_EXEC_TIMEOUT_MS (default 2min) and
|
|
773
|
+
// CONTROL ops (ping / fs / git / desktop / pty) keep a short request timeout so
|
|
774
|
+
// liveness failures surface promptly. EXEC duration is a different concern: by
|
|
775
|
+
// default it is unbounded (0), exactly like a command launched by an unrestricted
|
|
776
|
+
// local agent. The op-stream transport keeps control liveness, replay, and explicit
|
|
777
|
+
// cancellation independent of command duration. A deployment may opt into a hard
|
|
778
|
+
// process deadline by setting a positive value; 0 never schedules a process kill.
|
|
779
|
+
// Knobs: OPENGENI_SANDBOX_SELFHOSTED_EXEC_TIMEOUT_MS (default 0 = none) and
|
|
779
780
|
// OPENGENI_SANDBOX_SELFHOSTED_CONTROL_TIMEOUT_MS (default 30s).
|
|
780
|
-
sandboxSelfhostedExecTimeoutMs: z.coerce.number().int().
|
|
781
|
+
sandboxSelfhostedExecTimeoutMs: z.coerce.number().int().nonnegative().default(0),
|
|
781
782
|
sandboxSelfhostedControlTimeoutMs: z.coerce.number().int().positive().default(30_000),
|
|
782
783
|
// --- sandbox lease cadences (cadence invariant validated at boot below) ---
|
|
783
784
|
// reaperPeriod < viewerHolderTTL, and reaperPeriod + idleGrace < the EFFECTIVE
|
|
@@ -1757,6 +1758,7 @@ export function getSettings(): Settings {
|
|
|
1757
1758
|
webBaseUrl: optional("OPENGENI_WEB_BASE_URL"),
|
|
1758
1759
|
agentReleasesBaseUrl: optional("OPENGENI_AGENT_RELEASES_BASE_URL"),
|
|
1759
1760
|
agentStableVersion: optional("OPENGENI_AGENT_STABLE_VERSION"),
|
|
1761
|
+
agentBetaVersion: optional("OPENGENI_AGENT_BETA_VERSION"),
|
|
1760
1762
|
productAccessMode: optional("OPENGENI_PRODUCT_ACCESS_MODE"),
|
|
1761
1763
|
billingMode: optional("OPENGENI_BILLING_MODE"),
|
|
1762
1764
|
entitlementsMode: optional("OPENGENI_ENTITLEMENTS_MODE"),
|
|
@@ -3704,16 +3706,8 @@ export function stableSandboxEnvironmentForRun(
|
|
|
3704
3706
|
environment.OPENGENI_GIT_CLI_WRAPPER_DIR ??= `${home}/.opengeni/bin`;
|
|
3705
3707
|
environment.PATH = prependPathEntry(environment.PATH, environment.OPENGENI_GIT_CLI_WRAPPER_DIR);
|
|
3706
3708
|
}
|
|
3707
|
-
if (settings.toolspaceEnabled) {
|
|
3708
|
-
|
|
3709
|
-
// stable shell-resolved pointer in the manifest; runtime expands this trusted
|
|
3710
|
-
// marker against the machine's own HOME for seed, renewal, and every command.
|
|
3711
|
-
// Never derive it from the selfhosted descriptor root (`/`), which would try
|
|
3712
|
-
// to write `/.opengeni` as an ordinary machine user.
|
|
3713
|
-
environment.OPENGENI_TOOLSPACE_TOKEN_FILE ??=
|
|
3714
|
-
settings.sandboxBackend === "selfhosted"
|
|
3715
|
-
? "$HOME/.opengeni/toolspace-token"
|
|
3716
|
-
: `${environment.HOME ?? descriptor.workspaceRoot}/.opengeni/toolspace-token`;
|
|
3709
|
+
if (settings.toolspaceEnabled && settings.sandboxBackend !== "selfhosted") {
|
|
3710
|
+
environment.OPENGENI_TOOLSPACE_TOKEN_FILE ??= `${environment.HOME ?? descriptor.workspaceRoot}/.opengeni/toolspace-token`;
|
|
3717
3711
|
if (settings.ogtoolPackageSpec) {
|
|
3718
3712
|
environment.OPENGENI_OGTOOL_PACKAGE_SPEC ??= settings.ogtoolPackageSpec;
|
|
3719
3713
|
}
|