Public: anyone can read this; the crew can change it.

OVHcloud US holds a pinned forge: volume, instance and both US regions as places #16636

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

OVHcloud US can now hold a pinned forge through a new ovh driver and two US regions as places. None of it has run against the real OVHcloud API. The new tests use recorded fetches, and the real deploy still waits for the owner to attach an OVHcloud US account.

Notes

shipped production is serving it deploy 1919ee3

opened this

OVHcloud US can now hold a pinned forge through a new ovh driver and two US regions as places. None of it has run against the real OVHcloud API. The new tests use recorded fetches, and the real deploy still waits for the owner to attach an OVHcloud US account. tsc is clean and the cloud, places, pinned and mcp-size tests I ran pass. I did not run the full suite.

What changed

  • Driver: src/cloud/ovh.ts is registered in drivers.ts. It signs every call against /cloud/project/{id} using the stored AK:AS:CK:PROJECT credential.
    • Create: a classic 10 GiB volume, then an instance whose flavor and Ubuntu 24.04 image are looked up by name in the row's region. The instance's userData is the shared boot config.
    • Attach: the volume is attached once the instance is active. If the attach fails, the instance is deleted so none is left unrecorded.
    • Address: read back from ipAddresses (public, version 4).
    • Replace and retire: replace keeps the volume and waits for it to detach. Retire deletes the instance, and the volume only when told.
  • Shared sequence: I added an optional signed hook on Driver, because the shared caller only does bearer tokens. I also widened the remote id check to letters, digits and dashes, because OVHcloud ids are UUIDs.
  • Boot config: I prepend one runcmd step to the shared bootConfig output. It waits for the volume's block device, formats it only if blank, and mounts it at /mnt/forge_data.
  • Places: ovhPlaces covers US-EAST-VA-1 and US-WEST-OR-1 with d2-2, d2-4 and d2-8. ovh is in LISTED. Availability comes from signed GET flavor?region=, and prices from the unsigned public catalog. The 2026-11-23 prices are the dated fallback, and a place says when it is using them. The volume's $0.048 per GiB-month is added, so d2-2 comes to $7.56.
  • Target: ovh is in targets.ts as first, so pinned_forge accepts it on the page and through MCP with no new tool. docs/CLOUD.md has a short section.
  • Reused: bootConfig and volumeName from machine.ts, ovhCall from ovh_sign.ts, and ovhParts, which I exported from providers.ts.
  • Tests: test/pinned-ovh.test.ts covers each case in the issue: provision end to end, a failed attach then a retry that reuses the volume and makes one instance, replace keeping the volume, and a refused credential making nothing. It also covers the places and the region check.
  • Existing tests updated: two assertions in test/pinned-forge.test.ts counted 6 targets and now count 7.

Unverified guesses

  • The virtio-<first 20 characters of the volume id> device path for the volume.
  • The catalog's <flavor>.consumption plan code and its 1e-8 price unit. A price outside $1–$500 a month is ignored and the fallback is used.
  • A real instance should be tried once an account is attached.

Left out

  • The place does not say "waiting for an OVHcloud US account". A place only exists after a read with an account, so the text is on the target (targets.ts) and in docs/CLOUD.md. Without an account, pinned_forge already answers "No such cloud account."
  • No fileIn/assign project filing, since an OVHcloud credential is already scoped to one project.
  • The spend ceiling's volume-only price (keptVolumeCents in ceiling.ts) has no OVHcloud case yet.

Gate

  • The gate's similar.ts check flags two test helpers in pinned-ovh.test.ts as alike.
  • It also notes five files with comment lines over 100 columns, left for the nightly rewrap.

Try it Attach an ovh account with AK:AS:CK:PROJECT and allow writes. Then deploy with place ovh:US-EAST-VA-1:d2-2. Locally, run bun test test/pinned-ovh.test.ts.

🤖 Generated with Claude Code

Closes #16556

2 earlier comments · 2 events
commented

OVHcloud US can now hold a pinned forge through a new ovh driver and two US regions as places. None of it has run against the real OVHcloud API. The new tests use recorded fetches, and the real deploy still waits for the owner to attach an OVHcloud US account. tsc is clean and the cloud, places, pinned and mcp-size tests I ran pass. I did not run the full suite.

What changed

  • Driver: src/cloud/ovh.ts is registered in drivers.ts. It signs every call against /cloud/project/{id} using the stored AK:AS:CK:PROJECT credential.
    • Create: a classic 10 GiB volume, then an instance whose flavor and Ubuntu 24.04 image are looked up by name in the row's region. The instance's userData is the shared boot config.
    • Attach: the volume is attached once the instance is active. If the attach fails, the instance is deleted so none is left unrecorded.
    • Address: read back from ipAddresses (public, version 4).
    • Replace and retire: replace keeps the volume and waits for it to detach. Retire deletes the instance, and the volume only when told.
  • Shared sequence: I added an optional signed hook on Driver, because the shared caller only does bearer tokens. I also widened the remote id check to letters, digits and dashes, because OVHcloud ids are UUIDs.
  • Boot config: I prepend one runcmd step to the shared bootConfig output. It waits for the volume's block device, formats it only if blank, and mounts it at /mnt/forge_data.
  • Places: ovhPlaces covers US-EAST-VA-1 and US-WEST-OR-1 with d2-2, d2-4 and d2-8. ovh is in LISTED. Availability comes from signed GET flavor?region=, and prices from the unsigned public catalog. The 2026-11-23 prices are the dated fallback, and a place says when it is using them. The volume's $0.048 per GiB-month is added, so d2-2 comes to $7.56.
  • Target: ovh is in targets.ts as first, so pinned_forge accepts it on the page and through MCP with no new tool. docs/CLOUD.md has a short section.
  • Reused: bootConfig and volumeName from machine.ts, ovhCall from ovh_sign.ts, and ovhParts, which I exported from providers.ts.
  • Tests: test/pinned-ovh.test.ts covers each case in the issue: provision end to end, a failed attach then a retry that reuses the volume and makes one instance, replace keeping the volume, and a refused credential making nothing. It also covers the places and the region check.
  • Existing tests updated: two assertions in test/pinned-forge.test.ts counted 6 targets and now count 7.

Unverified guesses

  • The virtio-<first 20 characters of the volume id> device path for the volume.
  • The catalog's <flavor>.consumption plan code and its 1e-8 price unit. A price outside $1–$500 a month is ignored and the fallback is used.
  • A real instance should be tried once an account is attached.

Left out

  • The place does not say "waiting for an OVHcloud US account". A place only exists after a read with an account, so the text is on the target (targets.ts) and in docs/CLOUD.md. Without an account, pinned_forge already answers "No such cloud account."
  • No fileIn/assign project filing, since an OVHcloud credential is already scoped to one project.
  • The spend ceiling's volume-only price (keptVolumeCents in ceiling.ts) has no OVHcloud case yet.

Gate

  • The gate's similar.ts check flags two test helpers in pinned-ovh.test.ts as alike.
  • It also notes five files with comment lines over 100 columns, left for the nightly rewrap.

Try it Attach an ovh account with AK:AS:CK:PROJECT and allow writes. Then deploy with place ovh:US-EAST-VA-1:d2-2. Locally, run bun test test/pinned-ovh.test.ts.

🤖 Generated with Claude Code

Changes requested — before the latest push

The driver, places and target are well shaped and the tests follow the issue. Four things to fix in one round:

  1. FIRST: the mount step is injected by boot(...).replace("\nruncmd:\n", ...). If the shared config's text ever changes, the replace does nothing and the forge boots with no data volume, with no error. Make it fail loudly (throw when the marker is absent), or better give bootConfig in machine.ts a real hook (an extra runcmd line parameter). Add a test that the userData has the mount step before the curl bun.sh line. The current test only checks that the string occurs somewhere.
  2. The spend ceiling has no OVHcloud case. keptVolumeCents in src/cloud/ceiling.ts returns undefined for ovh, so the held-volume cost is not counted for this provider. The PR text lists this as left out, but it is part of the spend safety every other provider has. Add OVH_VOLUME_USD_PER_GIB * VOLUME_GIB with a test.
  3. In createMachine, if the cleanup DELETE instance fails (.catch(() => {})), an instance is left running that the forge never recorded, and it bills. The issue says each remote id is recorded the moment it exists. Either record the instance id through the shared sequence before the wait and attach, or surface the cleanup failure in the thrown error with the instance id so a person can delete it. Test the failing-cleanup path.
  4. places.ts (a pure data module) now imports ovh.ts, which pulls in the driver, the signer and the machine sequence. Move OVH_REGIONS into places.ts and import it from ovh.ts and places_read.ts.

Also: the how-to is a section in docs/CLOUD.md, which is acceptable as the existing cloud doc. The TUI and MCP reach ovh through the generic target list, so no new screen is needed. The ticks below cannot be given until this is fixed. I did not exercise the preview beyond reading the diff, since there is no account behind it to deploy with.

commented

All four review items are fixed and pushed; the OVHcloud, ceiling, places and boot tests I ran pass and tsc is clean. I did not run the full suite. scripts/fast.ts said the diff was too broad to name, so I ran 8 targeted files plus the places tests instead.

  • Mount step: bootConfig in machine.ts takes an optional early list of runcmd lines, written right after the hardening commands and before curl bun.sh. ovh.ts passes its mount step through that parameter, and the string .replace is gone, so there is no marker to go missing. The deploy test now asserts the mount step comes before the curl bun.sh line.
  • Spend ceiling: keptVolumeCents in ceiling.ts has an ovh case, OVH_VOLUME_USD_PER_GIB * VOLUME_GIB (48¢), with a test.
  • Failed cleanup: if DELETE instance fails after a failed wait or attach, createMachine throws an error that names the instance id and says it bills until deleted in the OVHcloud console. It does not swallow the failure. A new test makes both the attach and the cleanup fail and checks that error.
  • OVH_REGIONS: it now lives in places.ts, and ovh.ts and places_read.ts import it from there. places.ts no longer imports the driver.

I did not take the other route for the failed cleanup, which was to record the instance id before the wait. Naming the id in the error covers the one case where an instance outlives the forge's record. Recording it earlier would mean changing the shared sequence in machine.ts for every provider.

gate.ts reports two things I left alone. Five files have comment lines over 100 columns, which the nightly rewrap handles. It also flags recordOvh and fetch in pinned-ovh.test.ts as similar.

Approved

All four earlier asks are met in the diff since 0b7322b19be3. The mount step now goes through bootConfig's early hook, and the test checks it comes before the bun install line. The spend ceiling counts the OVHcloud volume (48 cents), with a test. A failed instance cleanup throws an error naming the instance id and saying it bills until deleted, with a test. OVH_REGIONS lives in places.ts. I opened the preview: / answered 200 with the server-rendered landing page (16 KB). This change adds no page, so there is nothing further to see there. I read the diff and the recorded-fetch tests but did not run them, and no real OVHcloud call has been made.

Next two things I would do:

  1. Once an OVHcloud US account is attached, deploy one real instance. That checks the virtio-<20 chars> device path and the .consumption catalog price unit, which are still guesses.
  2. Record the instance id before the active wait, so an instance can never outlive the forge's record. Naming the id in the error covers it for now.

Non-blocking: the gate flags recordOvh and fetch in the test as similar to other helpers. Share them with the other provider tests when convenient.

commented

Left #16556 open: 1 unticked item remain (src/cloud/ovh.ts is a Driver registered in src/cloud/drivers.ts, using the signer from part 1 against /cloud/project/{projectId}: create a volume (POST volume with region, size, type classic), create an instance (POST instance with flavorId, imageId of the boot image, region, userData = the shared boot config), attach the volume (POST volume/{id}/attach), read the public IPv4 back from GET instance/{id} (ipAddresses with type public, version 4). Each remote id is recorded the moment it exists.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs