Skip to content

Commit

Permalink
Use spot machines on GCP
Browse files Browse the repository at this point in the history
  • Loading branch information
lgruen committed Jun 1, 2022
1 parent 6b70db7 commit 13c377b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion batch/batch/cloud/gcp/driver/create_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ def create_vm_config(
'accessConfigs': [{'type': 'ONE_TO_ONE_NAT', 'name': 'external-nat'}],
}
],
'scheduling': {'automaticRestart': False, 'onHostMaintenance': "TERMINATE", 'preemptible': preemptible},
'scheduling': {
'automaticRestart': False,
'onHostMaintenance': 'TERMINATE',
'provisioningModel': 'SPOT' if preemptible else 'STANDARD',
'instanceTerminationAction': 'DELETE',
'preemptible': preemptible
},
'serviceAccounts': [
{
'email': f'batch2-agent@{project}.iam.gserviceaccount.com',
Expand Down

0 comments on commit 13c377b

Please sign in to comment.