Skip to content

Commit 5942abc

Browse files
docs: add compute brokers/marketplaces guidance and README audience update
Co-Authored-By: Alec Fong <[email protected]>
1 parent 7107ef3 commit 5942abc

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ See [SECURITY.md](docs/SECURITY.md) for complete security specifications and imp
6161
- **NVIDIA Cloud Partners (NCPs)** looking to offer Brev-compatible GPU compute
6262
- **Infra teams** building cluster-aware systems or abstractions on raw compute
6363
- **Cloud providers** interested in contributing to a shared interface for accelerated compute
64+
- **Compute brokers & marketplaces (aggregators)** offering multi-cloud compute; use `Location`, `SubLocation`, and `CloudProviderID` to differentiate upstream sources behind a consistent interface
6465

65-
---
66+
## Aggregators (Brokers/Marketplaces/Multi-cloud)
67+
68+
Aggregator providers can integrate with this SDK to expose heterogeneous upstream compute behind a single provider surface. Map upstream regions/zones into `Location` and `SubLocation`, declare the common-denominator `Capabilities`, and maintain stable instance type identifiers (use `MakeGenericInstanceTypeID` if needed). Use `CloudProviderID` to represent your aggregator while preserving upstream metadata via tags/labels where helpful.
6669

6770
---
6871

docs/how-to-add-a-provider.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,42 @@ Patterns to follow:
3838

3939
---
4040

41+
---
42+
## Compute Brokers & Marketplaces (Aggregators)
43+
44+
This SDK supports providers that aggregate compute from multiple upstream sources (multi-cloud brokers, marketplaces, or exchanges). When implementing an aggregator, use these fields to differentiate where the compute comes from and to present consistent placement semantics:
45+
46+
- Provider (CloudProviderID): Identify your aggregator (e.g., "mybroker"). If you expose underlying vendors, include that metadata on the returned resources (e.g., via tags/labels) or encode it in stable IDs that you control.
47+
- Location and SubLocation: Map upstream regions/zones into `Location` and `SubLocation` so users can choose placement consistently across sources. For example, use `Location="us-west"` and `SubLocation="vendorA/zone-2"` or `SubLocation="sv15/DC3"` for finer placement.
48+
- InstanceType IDs: If upstream vendors don’t provide stable, cross-market IDs, generate stable IDs using `MakeGenericInstanceTypeID` and include upstream hints in IDs or metadata. Ensure stability over time to avoid breaking consumers.
49+
- Capabilities: Only advertise features that your aggregator reliably supports across upstream vendors (e.g., Create/Terminate/Reboot). Omit capabilities (ModifyFirewall, Stop/Start, ResizeVolume, MachineImage, Tags) if they are not uniformly supported.
50+
51+
Minimal pattern:
52+
53+
- Credential.GetAPIType: Return `APITypeLocational` when placement is region-scoped; `APITypeGlobal` otherwise.
54+
- Client.MakeClient(ctx, location): Bind the client to the chosen `Location` for list/launch operations.
55+
- Security: Conform to the default-deny inbound model; document any upstream limitations under `internal/{provider}/SECURITY.md` and reflect them in capabilities.
56+
57+
Conceptual example:
58+
59+
```
60+
func (c *BrokerClient) CreateInstance(ctx context.Context, attrs v1.CreateInstanceAttrs) (*v1.Instance, error) {
61+
// attrs.Location: "us-west"; attrs.SubLocation: "vendorA/zone-2"
62+
// 1) Select upstream pool by Location/SubLocation and InstanceType availability
63+
// 2) Launch via upstream vendor API
64+
// 3) Return v1.Instance:
65+
// - CloudProviderID: "mybroker"
66+
// - Location/SubLocation set from attrs/placement
67+
// - Stable InstanceTypeID (use v1.MakeGenericInstanceTypeID if needed)
68+
// - Include upstream vendor metadata in tags/labels for observability
69+
return inst, nil
70+
}
71+
```
72+
73+
Design notes:
74+
- Keep your `Location`/`SubLocation` stable even if upstream identifiers change; translate upstream → broker-stable naming.
75+
- Prefer lowest common denominator in `Capabilities` when upstreams differ.
76+
- If firewall models are project- or network-scoped upstream, omit `CapabilityModifyFirewall` and document the nuance.
4177
## Directory Layout
4278

4379
Create a new provider folder:

0 commit comments

Comments
 (0)