Implement RunPod cloud adapter#748
Conversation
Greptile SummaryThis PR replaces the RunPod cloud stub with a complete GraphQL-backed GPU pod adapter. It correctly addresses every concern raised in prior review rounds: null guards on
Confidence Score: 5/5Safe to merge; every previously identified issue has been addressed with tests to confirm. Every concern from the previous review rounds has been resolved: null guards on No files require special attention; all changed files look correct. Important Files Changed
Sequence DiagramsequenceDiagram
participant C as sh1pt CLI
participant A as RunPod Adapter
participant R as RunPod GraphQL API
C->>A: connect(ctx, config)
A->>R: "query Myself { myself { id email } }"
R-->>A: "{ myself: { id, email } }"
A-->>C: "{ accountId }"
C->>A: quote(ctx, spec, config)
alt hourlyPrice in config
A-->>C: Quote (no network call)
else
A->>R: "query GpuTypes(input: { id: gpuTypeId })"
R-->>A: "{ gpuTypes: [...] }"
A-->>C: Quote (on-demand price x count)
end
C->>A: provision(ctx, spec, config)
alt dryRun and no hourlyPrice
A-->>C: synthetic dry-run Instance (no network call)
else
A->>A: quote() check maxHourlyPrice
A->>R: "mutation DeployPod(input: {...})"
R-->>A: "{ podFindAndDeployOnDemand: pod | null }"
alt pod is null
A-->>C: throw pod was not provisioned
else
A-->>C: Instance (mapped from pod)
end
end
C->>A: list(ctx, config)
A->>R: "query Pods { myself { pods { ... } } }"
R-->>A: "{ myself: { pods: [...] } }"
A-->>C: Instance[]
C->>A: status(ctx, instanceId, config)
A->>R: "query Pod(input: { podId })"
R-->>A: "{ pod: pod | null }"
A-->>C: Instance
C->>A: destroy(ctx, instanceId, config)
alt dryRun
A-->>C: log only
else
A->>R: "mutation TerminatePod(input: { podId })"
R-->>A: "{ podTerminate: null }"
A-->>C: void
end
Reviews (5): Last reviewed commit: "Guard empty RunPod provision response" | Re-trigger Greptile |
|
Addressed the Greptile feedback in
Validation after the fix:
|
|
Follow-up pushed in
Validation after this follow-up:
|
|
Addressed the latest Greptile follow-up in
Validation after this fix:
|
|
Addressed the spot-pricing guardrail issue in
Validation after this fix:
|
|
Addressed the latest Greptile finding in
Validation after this fix:
|
Summary
Replaces the RunPod cloud stub with a GraphQL-backed GPU pod adapter:
myselfhourlyPriceconfig or RunPodgpuTypespricingpodFindAndDeployOnDemandmyself { pods }pod(input: ...)podTerminateInstancevaluesimageNamefor real provisioningRunPod reference used:
Safety
Real provisioning requires
config.imageName. GPU pods still honorspec.maxHourlyPricebefore any mutation is sent. Dry-run provisioning returns a local instance and does not call RunPod.Validation
corepack pnpm --filter @profullstack/sh1pt-core buildcorepack pnpm --filter @profullstack/sh1pt-cloud-runpod typecheckcorepack pnpm --filter @profullstack/sh1pt-cloud-runpod buildcorepack pnpm vitest run packages/cloud/runpod/src/index.test.tsgit diff --check