@vm0/runner 2.8.0 → 2.8.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 +8 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -866,8 +866,10 @@ var SSHClient = class {
|
|
|
866
866
|
}
|
|
867
867
|
/**
|
|
868
868
|
* Execute a command on the remote VM
|
|
869
|
+
* @param command - The command to execute
|
|
870
|
+
* @param timeoutMs - Optional timeout in milliseconds (default: 300000ms = 5 minutes)
|
|
869
871
|
*/
|
|
870
|
-
async exec(command) {
|
|
872
|
+
async exec(command, timeoutMs) {
|
|
871
873
|
const sshCmd = this.buildSSHCommand();
|
|
872
874
|
const escapedCommand = command.replace(/'/g, "'\\''");
|
|
873
875
|
const fullCmd = [...sshCmd, `'${escapedCommand}'`].join(" ");
|
|
@@ -875,8 +877,8 @@ var SSHClient = class {
|
|
|
875
877
|
const { stdout, stderr } = await execAsync2(fullCmd, {
|
|
876
878
|
maxBuffer: 50 * 1024 * 1024,
|
|
877
879
|
// 50MB buffer
|
|
878
|
-
timeout: 3e5
|
|
879
|
-
// 5
|
|
880
|
+
timeout: timeoutMs ?? 3e5
|
|
881
|
+
// Default 5 minutes, customizable per call
|
|
880
882
|
});
|
|
881
883
|
return {
|
|
882
884
|
exitCode: 0,
|
|
@@ -958,10 +960,11 @@ var SSHClient = class {
|
|
|
958
960
|
}
|
|
959
961
|
/**
|
|
960
962
|
* Check if SSH connection is available
|
|
963
|
+
* Uses a short timeout (15s) to ensure waitUntilReachable() respects its outer timeout
|
|
961
964
|
*/
|
|
962
965
|
async isReachable() {
|
|
963
966
|
try {
|
|
964
|
-
const result = await this.exec("echo ok");
|
|
967
|
+
const result = await this.exec("echo ok", 15e3);
|
|
965
968
|
return result.exitCode === 0 && result.stdout.trim() === "ok";
|
|
966
969
|
} catch {
|
|
967
970
|
return false;
|
|
@@ -11096,7 +11099,7 @@ var benchmarkCommand = new Command3("benchmark").description(
|
|
|
11096
11099
|
});
|
|
11097
11100
|
|
|
11098
11101
|
// src/index.ts
|
|
11099
|
-
var version = true ? "2.8.
|
|
11102
|
+
var version = true ? "2.8.1" : "0.1.0";
|
|
11100
11103
|
program.name("vm0-runner").version(version).description("Self-hosted runner for VM0 agents");
|
|
11101
11104
|
program.addCommand(startCommand);
|
|
11102
11105
|
program.addCommand(statusCommand);
|