@forgezero/agent 0.1.33 → 0.1.34
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/agent-heartbeat.js +1 -1
- package/dist/capacity-calibration.d.ts +51 -0
- package/dist/capacity-calibration.js +119 -0
- package/dist/definition.d.ts +3 -0
- package/dist/definition.js +174 -2
- package/dist/deploy-file.js +174 -2
- package/dist/deployment.d.ts +11 -0
- package/dist/fz-agent.js +1855 -3370
- package/dist/fz.js +1643 -3498
- package/dist/index.d.ts +2 -0
- package/dist/provision.js +4 -3
- package/dist/version.d.ts +1 -1
- package/package.json +6 -2
- package/schema/deploy-v2.json +14 -0
package/dist/index.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ export { attestNodeOnce, startNodeAttestation } from './attestation-client';
|
|
|
48
48
|
export type { NodeAttestationOptions } from './attestation-client';
|
|
49
49
|
export { applyMetalIsolation, metalGuestSliceUnit, metalHousekeepingDropIn } from './metal-isolation';
|
|
50
50
|
export { assertSupportedGuestImage, SUPPORTED_GUEST_IMAGE } from './ubuntu';
|
|
51
|
+
export { calibrateHttpConcurrency, localCalibrationEndpoint } from './capacity-calibration';
|
|
52
|
+
export type { CapacityCalibration, CapacityCalibrationOptions, CapacityStage } from './capacity-calibration';
|
|
51
53
|
/**
|
|
52
54
|
* The node seed, on disk, owner-only.
|
|
53
55
|
*
|
package/dist/provision.js
CHANGED
|
@@ -884,7 +884,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
|
|
|
884
884
|
}
|
|
885
885
|
|
|
886
886
|
// src/version.ts
|
|
887
|
-
var VERSION3 = "0.1.
|
|
887
|
+
var VERSION3 = "0.1.34";
|
|
888
888
|
|
|
889
889
|
// src/egress-policy.ts
|
|
890
890
|
import { realpathSync } from "node:fs";
|
|
@@ -1476,6 +1476,7 @@ function agentUnit(options) {
|
|
|
1476
1476
|
options.profile ? `FZ_DEPLOY_PROFILE=${options.profile}` : null,
|
|
1477
1477
|
options.repository && options.branch ? `FZ_DEPLOY_KEY=${options.project ?? "platform"}:${options.environment ?? "production"}` : null,
|
|
1478
1478
|
deploymentEnabled ? `FZ_DEPLOY_ROOT=${deployRoot}` : null,
|
|
1479
|
+
deploymentEnabled ? `FZ_CAPACITY_EVIDENCE_DIR=${deployRoot}/capacity` : null,
|
|
1479
1480
|
deploymentEnabled ? `FZ_DEPLOY_RUNNER_SOCKET=${DEPLOYMENT_RUNNER_SOCKET}` : null,
|
|
1480
1481
|
deploymentEnabled ? `FZ_SOFTWARE_HELPER_SOCKET=${DEFAULT_SOFTWARE_HELPER_SOCKET}` : null,
|
|
1481
1482
|
Object.keys(deploymentCredentials).length > 0 ? `FZ_DEPLOY_SYSTEMD_SECRETS=${Object.keys(deploymentCredentials).join(",")}` : null,
|
|
@@ -1494,7 +1495,7 @@ function agentUnit(options) {
|
|
|
1494
1495
|
` : "";
|
|
1495
1496
|
const projectCredentials = Object.entries(deploymentCredentials).map(([name, path]) => `LoadCredentialEncrypted=${name}:${path}`).join(`
|
|
1496
1497
|
`);
|
|
1497
|
-
const deploymentWrites = deploymentEnabled ? `ReadWritePaths=${deployRoot}/releases ${deployRoot}/agent-home ${deployRoot}/cache` : "";
|
|
1498
|
+
const deploymentWrites = deploymentEnabled ? `ReadWritePaths=${deployRoot}/releases ${deployRoot}/agent-home ${deployRoot}/cache ${deployRoot}/capacity` : "";
|
|
1498
1499
|
const supplementaryGroups = [
|
|
1499
1500
|
AGENT_UPDATE_GROUP,
|
|
1500
1501
|
deploymentEnabled ? DEPLOYMENT_GROUP : null,
|
|
@@ -1747,7 +1748,7 @@ function planProvision(options) {
|
|
|
1747
1748
|
] : [],
|
|
1748
1749
|
...deploymentEnabled ? [{
|
|
1749
1750
|
label: "deployment directories",
|
|
1750
|
-
command: `install -d -o root -g root -m 0755 ${deployRoot} && ` + `install -d -o root -g ${DEPLOYMENT_GROUP} -m 3770 ${deployRoot}/releases && ` + `install -d -o ${user} -g ${user} -m 0750 ${deployRoot}/cache && ` + `install -d -o ${user} -g ${user} -m 0700 ${deployRoot}/agent-home && ` + `install -d -o ${DEPLOYMENT_RUNNER_USER} -g ${DEPLOYMENT_GROUP} -m 0700 ${deployRoot}/runner-home ${deployRoot}/runner-home/cache`
|
|
1751
|
+
command: `install -d -o root -g root -m 0755 ${deployRoot} && ` + `install -d -o root -g ${DEPLOYMENT_GROUP} -m 3770 ${deployRoot}/releases && ` + `install -d -o ${user} -g ${user} -m 0750 ${deployRoot}/cache && ` + `install -d -o ${user} -g ${user} -m 0700 ${deployRoot}/capacity && ` + `install -d -o ${user} -g ${user} -m 0700 ${deployRoot}/agent-home && ` + `install -d -o ${DEPLOYMENT_RUNNER_USER} -g ${DEPLOYMENT_GROUP} -m 0700 ${deployRoot}/runner-home ${deployRoot}/runner-home/cache`
|
|
1751
1752
|
}] : [],
|
|
1752
1753
|
{ label: "reload units", command: "systemctl daemon-reload" },
|
|
1753
1754
|
...deploymentEnabled ? [{
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** One package version shared by both public binaries. Pinned to package.json by tests. */
|
|
2
|
-
export declare const VERSION = "0.1.
|
|
2
|
+
export declare const VERSION = "0.1.34";
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgezero/agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.34",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"check": "tsc --noEmit",
|
|
7
7
|
"prebuild": "rm -rf dist",
|
|
8
|
-
"build": "bun build src/index.ts --outfile dist/fz-agent.js --target bun --format esm && bun build src/cli/index.ts --outfile dist/fz.js --target bun --format esm && bun build src/compute.ts src/provision.ts src/subscribe.ts src/pipeline.ts src/definition.ts src/deploy-file.ts src/ssh-server.ts src/ssh-listen.ts src/provisioning-pull.ts src/migration-pull.ts src/guest-enrolment.ts src/node-vault.ts src/metal-provision.ts src/metal-helper-socket.ts src/lifecycle-helper.ts src/deployment-runner.ts src/agent-update.ts src/agent-update-helper.ts src/agent-heartbeat.ts src/software.ts src/software-helper.ts src/ubuntu.ts --root src --outdir dist --target browser --format esm --packages external && bun build src/project-context.ts --root src --outdir dist --target bun --format esm --packages external && tsc --emitDeclarationOnly --declaration --noEmit false --outDir dist",
|
|
8
|
+
"build": "bun build src/index.ts --outfile dist/fz-agent.js --target bun --format esm && bun build src/cli/index.ts --outfile dist/fz.js --target bun --format esm && bun build src/compute.ts src/provision.ts src/subscribe.ts src/pipeline.ts src/definition.ts src/deploy-file.ts src/ssh-server.ts src/ssh-listen.ts src/provisioning-pull.ts src/migration-pull.ts src/guest-enrolment.ts src/node-vault.ts src/metal-provision.ts src/metal-helper-socket.ts src/lifecycle-helper.ts src/deployment-runner.ts src/agent-update.ts src/agent-update-helper.ts src/agent-heartbeat.ts src/software.ts src/software-helper.ts src/ubuntu.ts src/capacity-calibration.ts --root src --outdir dist --target browser --format esm --packages external && bun build src/project-context.ts --root src --outdir dist --target bun --format esm --packages external && tsc --emitDeclarationOnly --declaration --noEmit false --outDir dist",
|
|
9
9
|
"prepublishOnly": "bun run check && bun run build"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
@@ -133,6 +133,10 @@
|
|
|
133
133
|
"./project-context": {
|
|
134
134
|
"types": "./dist/project-context.d.ts",
|
|
135
135
|
"default": "./dist/project-context.js"
|
|
136
|
+
},
|
|
137
|
+
"./capacity-calibration": {
|
|
138
|
+
"types": "./dist/capacity-calibration.d.ts",
|
|
139
|
+
"default": "./dist/capacity-calibration.js"
|
|
136
140
|
}
|
|
137
141
|
}
|
|
138
142
|
}
|
package/schema/deploy-v2.json
CHANGED
|
@@ -32,6 +32,20 @@
|
|
|
32
32
|
"version": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9.-]{0,31}$" }
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
},
|
|
36
|
+
"capacityCalibration": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"required": ["endpoint"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"endpoint": { "type": "string", "pattern": "^http://(?:localhost|127\\.0\\.0\\.1|\\[::1\\]):[1-9][0-9]{0,4}/" },
|
|
42
|
+
"maxConcurrency": { "type": "integer", "minimum": 1, "maximum": 4096 },
|
|
43
|
+
"requestsPerWorker": { "type": "integer", "minimum": 2, "maximum": 100 },
|
|
44
|
+
"maxP95Ms": { "type": "number", "exclusiveMinimum": 0 },
|
|
45
|
+
"maxErrorRate": { "type": "number", "minimum": 0, "maximum": 0.2 },
|
|
46
|
+
"headroomRatio": { "type": "number", "minimum": 0.25, "maximum": 0.95 },
|
|
47
|
+
"requestTimeoutMs": { "type": "integer", "minimum": 100, "maximum": 30000 }
|
|
48
|
+
}
|
|
35
49
|
}
|
|
36
50
|
}
|
|
37
51
|
}
|