A procurement automatically buys and sells compute to maintain a target number of nodes on a
capacity. It participates in the market on your behalf, placing orders within
your price bounds.
A procurement does not guarantee continuous access. Your nodes may shut down if the market price
exceeds your buy limit or other buyers place reservations that consume the capacity. Design
workloads to handle interruptions.
Create a procurement
sf procurements create \
--capacity dev \
--target node_count \
--max-buy-price 20.00 \
--min-sell-price 10.00 \
--window 1h
This creates a procurement on the dev capacity that buys compute at up to $20.00/node/hr and sells
excess at no less than $10.00/node/hr. With node_count as the target, it matches the number of
non-terminated nodes on the capacity.
How it works
The procurement compares the capacity’s current allocation against your target. When allocation is
below target, it places buy orders. When allocation exceeds the target, it places sell orders.
Orders placed by a procurement follow the same rules as manual orders and appear in
sf orders ls.
Tuning the managed window
The --window setting controls how far ahead the procurement both buys and sells compute (between
60 minutes and 24 hours). This is also how far in advance your compute can be sold to other buyers
placing reservations.
Higher values (e.g., 24h) secure compute further in advance, reducing risk of gaps. But if you
scale down, you will most likely sell remaining compute at a loss. Lower values (e.g., 1h) are
more flexible with less commitment, but compute may not be available when you need it.
Target modes
The --target flag accepts two kinds of values.
The value node_count uses the number of non-terminated nodes on the capacity as the target. This
pairs well with deployments: the deployment decides how many nodes to run,
and the procurement buys compute to cover them.
sf procurements create --capacity dev --target node_count \
--max-buy-price 20.00 --min-sell-price 10.00 --window 1h
A number maintains a fixed allocation regardless of how many nodes exist.
sf procurements create --capacity dev --target 8 \
--max-buy-price 20.00 --min-sell-price 10.00 --window 1h
List procurements
NAME CAPACITY TARGET ON STATUS MESSAGE
prod-procurement prod-cluster 50 yes info running
auto-scaler dev-cluster node_count yes info running
Get procurement details
sf procurements get prod-procurement
│ PROCUREMENT ID proc_k3RnX9vLm7Qp2Yw5Jd8F
│ NAME prod-procurement
│ CAPACITY prod-cluster (cap_yIwQRIaE8bJo4Gs0000)
│ TARGET 50
│ BUY PRICE $20.00/node/hr
│ SELL PRICE $10.00/node/hr
│ WINDOW 60 minutes
│ ENABLED yes
│ STATUS info
│ MESSAGE running
│ CREATED Mar 23, 4:40pm PDT
└ UPDATED Mar 30, 3:00pm PDT
Update a procurement
Change price limits, the managed window, or enable/disable the procurement.
sf procurements set prod-procurement --max-buy-price 25.00
Disable a procurement to stop it from placing new orders. Existing orders remain on the book.
sf procurements set prod-procurement --enabled false
Re-enable it to resume.
sf procurements set prod-procurement --enabled true
Delete a procurement
sf procurements delete prod-procurement
Deleting a procurement cancels all standing orders it placed. Existing allocations remain until they
expire.
To sell all your compute, set the target to 0 instead of deleting. The procurement will place sell
orders for everything in the managed window.
Status
Each procurement reports a reconciliation status with a state and a message.
| State | Meaning |
|---|
| info | Operating normally |
| warning | Non-critical issue |
| error | Cannot place orders, such as insufficient balance |
Check the MESSAGE column in sf procurements list or the message field in
sf procurements get for details.
API reference
See the Procurements API for programmatic
access.