dstack-cloud: add gcp_config.provisioning_model for SPOT instances#15
Merged
Conversation
Many GCP projects only ship preemptible (SPOT) quota for newer GPUs —
in particular `PREEMPTIBLE-NVIDIA-H100-GPUS-per-project-{region,zone}`
is granted by default while `NVIDIA-H100-GPUS-per-project-region` is
zero. Without on-demand quota, the only way to launch H100 in a
Confidential TDX VM is to request `--provisioning-model=SPOT`.
Expose a `provisioning_model` field in `gcp_config` (default
`STANDARD`, backwards-compatible). When set to `SPOT`, also emit
`--instance-termination-action=STOP` so the boot/data disks survive
preemption and the instance can be resumed via `dstack-cloud start`
(important for the LUKS-encrypted data disk, which is keyed by the
KMS-provisioned per-instance secret).
Anything other than `STANDARD`/`SPOT` raises an early error rather
than silently dropping through.
Example `app.json` snippet for an H100 deploy:
"gcp_config": {
"machine_type": "a3-highgpu-1g",
"zone": "us-central1-a",
"provisioning_model": "SPOT"
}
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a
provisioning_modelfield togcp_config(STANDARD/SPOT), and pass the corresponding flags through togcloud compute instances create.Why
Many GCP projects only ship preemptible (SPOT) quota for newer GPUs. For example, on a typical project
PREEMPTIBLE-NVIDIA-H100-GPUS-per-project-{region,zone}is granted whileNVIDIA-H100-GPUS-per-project-regionis zero. Without on-demand quota, the only way to launcha3-highgpu-1g(H100) in a Confidential TDX VM is to ask for--provisioning-model=SPOT. Currentlydstack-cloud deployhard-codes STANDARD and the launch fails withQUOTA_EXCEEDED.Behavior
provisioning_modeldefaults toSTANDARD— fully backwards-compatible.SPOT, the deploy adds:--provisioning-model=SPOT--instance-termination-action=STOP(so the LUKS-encrypted data disk survives preemption anddstack-cloud startcan resume the instance — gcloud's default isDELETE)RuntimeErrorearly instead of silently dropping through.Example app.json:
```json
"gcp_config": {
"machine_type": "a3-highgpu-1g",
"zone": "us-central1-a",
"provisioning_model": "SPOT"
}
```
Test plan
dstack-cloud new: template now includes"provisioning_model": "STANDARD"dstack-cloud deploywith default (STANDARD) — unchanged gcloud invocationdstack-cloud deploywithSPOT— emits--provisioning-model=SPOT --instance-termination-action=STOP; verified on GCP a3-highgpu-1gdstack-cloud deploywith bogus value — raisesUnsupported provisioning_model