Skip to content

Commit

Permalink
Remove default GCP boot_disk_type setting.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 696254189
  • Loading branch information
andyz422 authored and copybara-github committed Nov 19, 2024
1 parent f9920c8 commit fe03824
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 65 deletions.
1 change: 1 addition & 0 deletions CHANGES.next.md
Original file line number Diff line number Diff line change
Expand Up @@ -526,3 +526,4 @@
based OSes.
- Update Chromium version to 127.0.6533.88.
- Update bigtable_walkthrough/README.md to help reduce the user frictions.
- Remove default boot_disk_type in GCP.
2 changes: 0 additions & 2 deletions perfkitbenchmarker/configs/default_benchmark_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ mysql_tpcc:
# TODO(andytzhu) - Add AWS/Azure
GCP:
boot_disk_size: 200
boot_disk_type: pd-ssd
disk_spec:
GCP:
disk_size: 4000
Expand Down Expand Up @@ -141,7 +140,6 @@ postgres_tpcc:
# TODO(andytzhu) - Add AWS/Azure
GCP:
boot_disk_size: 200
boot_disk_type: pd-ssd
disk_spec:
GCP:
disk_size: 4000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
GCP:
machine_type: n1-standard-16
zone: us-central1-c
boot_disk_size: 200
AWS:
machine_type: m4.4xlarge
zone: us-west-1a
Expand Down
37 changes: 0 additions & 37 deletions perfkitbenchmarker/providers/gcp/gce_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@

import json
import logging
import re
import time
from typing import Any

from absl import flags
import dateutil.parser
from perfkitbenchmarker import background_tasks
from perfkitbenchmarker import boot_disk
from perfkitbenchmarker import custom_virtual_machine_spec
from perfkitbenchmarker import disk
from perfkitbenchmarker import errors
from perfkitbenchmarker import provider_info
Expand Down Expand Up @@ -145,16 +143,6 @@
}

NVME_PD_MACHINE_FAMILIES = ['m3']
# Some machine families cannot use pd-ssd
HYPERDISK_ONLY_MACHINE_FAMILIES = [
'c3a',
'n4',
'c4',
'c4a',
]
# Default boot disk type in pkb.
# Console defaults to pd-balanced & gcloud defaults to pd-standard as of 11/23
PKB_DEFAULT_BOOT_DISK_TYPE = PD_BALANCED


class GceServiceUnavailableError(Exception):
Expand Down Expand Up @@ -322,31 +310,6 @@ def GetResourceMetadata(self):
return result


def GetDefaultBootDiskType(machine_type: str) -> str:
"""Defaults the gce boot disk to pd-balanced/hyperdisk-balanced.
Console defaults to pd-balanced (ssd) and hyperdisk-balanced (ssd).
But gcloud tool defaults to pd-standard (hdd). This is a pkb default to
use a slightly better (lower latency) default of pd-balanced.
This lets us align with console and boot windows machines without
thinking about boot disk.
Args:
machine_type: machine type
Returns:
default boot disk type.
"""
if not machine_type or isinstance(
machine_type, custom_virtual_machine_spec.CustomMachineTypeSpec
):
return PKB_DEFAULT_BOOT_DISK_TYPE
family = machine_type.split('-')[0].lower()
if family in HYPERDISK_ONLY_MACHINE_FAMILIES:
return HYPERDISK_BALANCED
return PKB_DEFAULT_BOOT_DISK_TYPE


class GceLocalDisk(disk.BaseDisk):
"""Object representing a GCE Local Disk."""

Expand Down
2 changes: 0 additions & 2 deletions perfkitbenchmarker/providers/gcp/gce_virtual_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ def __init__(self, *args, **kwargs):
self.min_node_cpus: int = None
self.subnet_names: List[str] = None
super().__init__(*args, **kwargs)
if not self.boot_disk_type:
self.boot_disk_type = gce_disk.GetDefaultBootDiskType(self.machine_type)
self.boot_disk_spec = boot_disk.BootDiskSpec(
self.boot_disk_size,
self.boot_disk_type,
Expand Down
3 changes: 0 additions & 3 deletions tests/gce_virtual_machine_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ def testCreateUbuntu2004(self):
command_string,
)
self.assertNotIn('--boot-disk-size', command_string)
self.assertIn('--boot-disk-type', command_string)
vm._PostCreate()
self.assertEqual(issue_command.call_count, 3)
self.assertDictContainsSubset(
Expand Down Expand Up @@ -522,7 +521,6 @@ def testCreateUbuntuInCustomDisk(self):
image=fake_image,
image_project=fake_image_project,
boot_disk_size=20,
boot_disk_type='fake-disk-type',
)
fake_disk = {
'id': '123456',
Expand All @@ -545,7 +543,6 @@ def testCreateUbuntuInCustomDisk(self):
self.assertEqual(issue_command.call_count, 1)
self.assertIn('gcloud compute instances create', command_string)
self.assertIn('--boot-disk-size 20', command_string)
self.assertIn('--boot-disk-type fake-disk-type', command_string)
vm._PostCreate()
self.assertEqual(issue_command.call_count, 3)
vm_metadata = vm.GetResourceMetadata()
Expand Down
21 changes: 0 additions & 21 deletions tests/providers/gcp/gce_disk_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
import json
import unittest
from absl import flags
from absl.testing import parameterized
import mock
from perfkitbenchmarker import context
from perfkitbenchmarker import custom_virtual_machine_spec
from perfkitbenchmarker import disk
from perfkitbenchmarker import os_types
from perfkitbenchmarker import virtual_machine
Expand Down Expand Up @@ -498,24 +496,5 @@ def testNFSDiskOnLinux(self):
)


class DiskUtilTest(pkb_common_test_case.PkbCommonTestCase):

@parameterized.named_parameters(
(
'custom',
custom_virtual_machine_spec.CustomMachineTypeSpec(
_COMPONENT, cpus=1, memory='4.0GiB'
),
gce_disk.PKB_DEFAULT_BOOT_DISK_TYPE,
),
('n2', 'n2-standard-2', gce_disk.PKB_DEFAULT_BOOT_DISK_TYPE),
('c3a', 'c3a-standard-8', gce_disk.HYPERDISK_BALANCED),
('c4a', 'c4a-standard-4', gce_disk.HYPERDISK_BALANCED),
)
def testGetDefaultBootDiskType(self, machine_type, expected_boot_disk_type):
boot_disk = gce_disk.GetDefaultBootDiskType(machine_type)
self.assertEqual(boot_disk, expected_boot_disk_type)


if __name__ == '__main__':
unittest.main()

0 comments on commit fe03824

Please sign in to comment.