@vm0/runner 3.9.0 → 3.9.2

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.
Files changed (2) hide show
  1. package/index.js +25 -18
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1612,34 +1612,39 @@ var TapPool = class {
1612
1612
  /**
1613
1613
  * Clean up the TAP pool
1614
1614
  *
1615
- * Note: This is a sync function for compatibility with process cleanup.
1616
- * Resources are cleaned up asynchronously (fire-and-forget).
1617
- * Any remaining resources will be cleaned up by init() on next startup.
1615
+ * Releases all IPs and deletes all TAPs. Waits for all operations to complete
1616
+ * to ensure registry is properly updated before process exits.
1618
1617
  */
1619
- cleanup() {
1618
+ async cleanup() {
1620
1619
  if (!this.initialized) {
1621
1620
  return;
1622
1621
  }
1623
1622
  logger4.log(`Cleaning up TAP pool (${this.queue.length} pairs)...`);
1623
+ const cleanupPromises = [];
1624
1624
  for (const { tapDevice, guestIp } of this.queue) {
1625
- releaseIP(guestIp).catch(() => {
1626
- });
1627
- this.config.deleteTap(tapDevice).catch((err) => {
1628
- logger4.log(
1629
- `Failed to delete ${tapDevice}: ${err instanceof Error ? err.message : "Unknown"}`
1630
- );
1631
- });
1625
+ cleanupPromises.push(
1626
+ releaseIP(guestIp).catch(() => {
1627
+ })
1628
+ );
1629
+ cleanupPromises.push(
1630
+ this.config.deleteTap(tapDevice).catch((err) => {
1631
+ logger4.log(
1632
+ `Failed to delete ${tapDevice}: ${err instanceof Error ? err.message : "Unknown"}`
1633
+ );
1634
+ })
1635
+ );
1632
1636
  }
1637
+ await Promise.all(cleanupPromises);
1633
1638
  this.queue = [];
1634
1639
  this.initialized = false;
1635
1640
  this.replenishing = false;
1636
- logger4.log("TAP pool cleanup initiated");
1641
+ logger4.log("TAP pool cleanup complete");
1637
1642
  }
1638
1643
  };
1639
1644
  var tapPool = null;
1640
1645
  async function initTapPool(config) {
1641
1646
  if (tapPool) {
1642
- tapPool.cleanup();
1647
+ await tapPool.cleanup();
1643
1648
  }
1644
1649
  tapPool = new TapPool(config);
1645
1650
  await tapPool.init();
@@ -1657,9 +1662,9 @@ async function releaseTap(tapDevice, guestIp, vmId) {
1657
1662
  }
1658
1663
  return tapPool.release(tapDevice, guestIp, vmId);
1659
1664
  }
1660
- function cleanupTapPool() {
1665
+ async function cleanupTapPool() {
1661
1666
  if (tapPool) {
1662
- tapPool.cleanup();
1667
+ await tapPool.cleanup();
1663
1668
  tapPool = null;
1664
1669
  }
1665
1670
  }
@@ -8170,6 +8175,8 @@ var scheduleResponseSchema = z19.object({
8170
8175
  volumeVersions: z19.record(z19.string(), z19.string()).nullable(),
8171
8176
  enabled: z19.boolean(),
8172
8177
  nextRunAt: z19.string().nullable(),
8178
+ lastRunAt: z19.string().nullable(),
8179
+ retryStartedAt: z19.string().nullable(),
8173
8180
  createdAt: z19.string(),
8174
8181
  updatedAt: z19.string()
8175
8182
  });
@@ -10533,7 +10540,7 @@ async function cleanupEnvironment(resources) {
10533
10540
  logger13.error(`Failed to cleanup overlay pool: ${error.message}`);
10534
10541
  }
10535
10542
  try {
10536
- cleanupTapPool();
10543
+ await cleanupTapPool();
10537
10544
  } catch (err) {
10538
10545
  const error = err instanceof Error ? err : new Error(String(err));
10539
10546
  errors.push(error);
@@ -11381,7 +11388,7 @@ var benchmarkCommand = new Command4("benchmark").description(
11381
11388
  );
11382
11389
  } finally {
11383
11390
  if (poolsInitialized) {
11384
- cleanupTapPool();
11391
+ await cleanupTapPool();
11385
11392
  cleanupOverlayPool();
11386
11393
  }
11387
11394
  }
@@ -11389,7 +11396,7 @@ var benchmarkCommand = new Command4("benchmark").description(
11389
11396
  });
11390
11397
 
11391
11398
  // src/index.ts
11392
- var version = true ? "3.9.0" : "0.1.0";
11399
+ var version = true ? "3.9.2" : "0.1.0";
11393
11400
  program.name("vm0-runner").version(version).description("Self-hosted runner for VM0 agents");
11394
11401
  program.addCommand(startCommand);
11395
11402
  program.addCommand(doctorCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/runner",
3
- "version": "3.9.0",
3
+ "version": "3.9.2",
4
4
  "description": "Self-hosted runner for VM0 agents",
5
5
  "repository": {
6
6
  "type": "git",