@vm0/runner 3.17.2 → 3.18.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/index.js +21 -15
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2473,9 +2473,10 @@ var GUEST_BINARY_PATHS = {
|
|
|
2473
2473
|
/** PID 1 init process - sets up overlayfs and spawns vsock-guest */
|
|
2474
2474
|
guestInit: "/sbin/guest-init",
|
|
2475
2475
|
/** Storage download - parallel downloads with streaming extraction */
|
|
2476
|
-
guestDownload: "/usr/local/bin/guest-download"
|
|
2476
|
+
guestDownload: "/usr/local/bin/guest-download",
|
|
2477
|
+
/** Agent orchestrator - handles CLI execution, events, checkpoints */
|
|
2478
|
+
guestAgent: "/usr/local/bin/guest-agent"
|
|
2477
2479
|
};
|
|
2478
|
-
var RUN_AGENT_PATH = "/usr/local/bin/vm0-agent/run-agent.mjs";
|
|
2479
2480
|
|
|
2480
2481
|
// src/lib/proxy/vm-registry.ts
|
|
2481
2482
|
import fs6 from "fs";
|
|
@@ -3149,7 +3150,7 @@ async function executeJob(context, config, options = {}) {
|
|
|
3149
3150
|
logger9.log(
|
|
3150
3151
|
`Running agent via vsock with ${Object.keys(envVars).length} env vars...`
|
|
3151
3152
|
);
|
|
3152
|
-
command =
|
|
3153
|
+
command = `${GUEST_BINARY_PATHS.guestAgent} > ${systemLogFile} 2>&1`;
|
|
3153
3154
|
}
|
|
3154
3155
|
const { pid } = await guest.spawnAndWatch(command, maxWaitMs, envVars);
|
|
3155
3156
|
logger9.log(`Process started with pid=${pid}`);
|
|
@@ -3655,25 +3656,30 @@ var Runner = class _Runner {
|
|
|
3655
3656
|
logger14.log(` Executing job ${context.runId}...`);
|
|
3656
3657
|
logger14.log(` Prompt: ${context.prompt.substring(0, 100)}...`);
|
|
3657
3658
|
logger14.log(` Compose version: ${context.agentComposeVersionId}`);
|
|
3659
|
+
let exitCode = 1;
|
|
3660
|
+
let error;
|
|
3658
3661
|
try {
|
|
3659
3662
|
const result = await executeJob(context, this.config);
|
|
3663
|
+
exitCode = result.exitCode;
|
|
3664
|
+
error = result.error;
|
|
3660
3665
|
logger14.log(
|
|
3661
|
-
` Job ${context.runId} execution completed with exit code ${
|
|
3666
|
+
` Job ${context.runId} execution completed with exit code ${exitCode}`
|
|
3662
3667
|
);
|
|
3663
|
-
if (
|
|
3664
|
-
logger14.error(` Job ${context.runId} failed: ${
|
|
3668
|
+
if (exitCode !== 0 && error) {
|
|
3669
|
+
logger14.error(` Job ${context.runId} failed: ${error}`);
|
|
3665
3670
|
}
|
|
3666
3671
|
} catch (err) {
|
|
3667
|
-
|
|
3672
|
+
error = err instanceof Error ? err.message : "Unknown execution error";
|
|
3668
3673
|
logger14.error(` Job ${context.runId} execution failed: ${error}`);
|
|
3669
|
-
const result = await completeJob(
|
|
3670
|
-
this.config.server.url,
|
|
3671
|
-
context,
|
|
3672
|
-
1,
|
|
3673
|
-
error
|
|
3674
|
-
);
|
|
3675
|
-
logger14.log(` Job ${context.runId} reported as ${result.status}`);
|
|
3676
3674
|
}
|
|
3675
|
+
logger14.log(
|
|
3676
|
+
` Calling complete API for job ${context.runId} with exitCode=${exitCode}`
|
|
3677
|
+
);
|
|
3678
|
+
const completeResult = await withRunnerTiming(
|
|
3679
|
+
"complete",
|
|
3680
|
+
() => completeJob(this.config.server.url, context, exitCode, error)
|
|
3681
|
+
);
|
|
3682
|
+
logger14.log(` Job ${context.runId} reported as ${completeResult.status}`);
|
|
3677
3683
|
}
|
|
3678
3684
|
};
|
|
3679
3685
|
|
|
@@ -4668,7 +4674,7 @@ var snapshotCommand = new Command5("snapshot").description("Generate a Firecrack
|
|
|
4668
4674
|
);
|
|
4669
4675
|
|
|
4670
4676
|
// src/index.ts
|
|
4671
|
-
var version = true ? "3.
|
|
4677
|
+
var version = true ? "3.18.1" : "0.1.0";
|
|
4672
4678
|
program.name("vm0-runner").version(version).description("Self-hosted runner for VM0 agents");
|
|
4673
4679
|
program.addCommand(startCommand);
|
|
4674
4680
|
program.addCommand(doctorCommand);
|