Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joel/add balanced pd #8843

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ LeonardoKubernetesRuntimeConfig toLeonardoKubernetesRuntimeConfig(
@ValueMapping(source = "CROMWELL", target = MappingConstants.NULL)
LeonardoAllowedChartName toLeonardoAllowedChartName(AppType appType);

@ValueMapping(source = "BALANCED", target = MappingConstants.NULL)
DiskType toDiskType(org.broadinstitute.dsde.workbench.client.leonardo.model.DiskType diskType);

@AfterMapping
Expand Down
1 change: 1 addition & 0 deletions api/src/main/resources/leonardo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,7 @@ components:
enum:
- pd-standard
- pd-ssd
- pd-balanced
CloudProvider:
type: string
enum:
Expand Down
1 change: 1 addition & 0 deletions api/src/main/resources/workbench-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7164,6 +7164,7 @@ components:
enum:
- pd-standard
- pd-ssd
- pd-balanced
Disk:
required:
- blockSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -783,15 +783,15 @@ public void testGetRuntime_diskConfig() throws ApiException {
.runtimeConfig(gceConfigObj)
.diskConfig(
new LeonardoDiskConfig()
.diskType(LeonardoDiskType.SSD)
.diskType(LeonardoDiskType.BALANCED)
.name("pd")
.blockSize(100)
.size(200)));

Runtime runtime = runtimeController.getRuntime(WORKSPACE_NS).getBody();

assertThat(runtime.getGceWithPdConfig().getPersistentDisk())
.isEqualTo(new PersistentDiskRequest().diskType(DiskType.SSD).name("pd").size(200));
.isEqualTo(new PersistentDiskRequest().diskType(DiskType.BALANCED).name("pd").size(200));
}

@Test
Expand Down Expand Up @@ -1173,7 +1173,7 @@ public void testCreateRuntime_gceWithPD_wihGpu() throws ApiException {
.machineType("standard")
.persistentDisk(
new PersistentDiskRequest()
.diskType(DiskType.SSD)
.diskType(DiskType.STANDARD)
.name(getPdName())
.size(500))
.gpuConfig(new GpuConfig().gpuType("nvidia-tesla-t4").numOfGpus(2))
Expand Down
1 change: 1 addition & 0 deletions ui/src/app/components/runtime-configuration-panel.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2079,6 +2079,7 @@ describe(RuntimeConfigurationPanel.name, () => {
await pickDetachableDiskSize(MIN_DISK_SIZE_GB);
});

// parameterize for STANDARD, SSD, BALANCED
it('should prevent runtime update when PD disk size is invalid', async () => {
mockUseCustomRuntime();
const { container } = component();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export const PersistentDiskSelector = ({
{...{ disabled }}
id={`disk-type`}
name={`disk-type`}
options={[DiskType.STANDARD, DiskType.SSD].map((value) => ({
options={[
DiskType.STANDARD,
DiskType.SSD,
DiskType.BALANCED,
].map((value) => ({
label: diskTypeLabels[value],
value,
}))}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/utils/analysis-config.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ describe(toAnalysisConfig.name, () => {
const gpuConfig: GpuConfig = { gpuType: 'a good one', numOfGpus: 2 };
const persistentDisk: PersistentDiskRequest = {
size: 123,
diskType: DiskType.SSD,
diskType: DiskType.BALANCED,
name: 'the disk associated with the runtime',
};
const testRuntime: Runtime = {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/utils/machines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export const diskConfigPricePerMonth = ({
}: Partial<DiskConfig>) => {
return (
size *
(detachableType === DiskType.SSD ? ssdPricePerMonth : diskPricePerMonth)
(detachableType === DiskType.SSD ? ssdPricePerMonth : diskPricePerMonth) // add balanced
);
};

Expand Down
1 change: 1 addition & 0 deletions ui/src/app/utils/runtime-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export enum RuntimeStatusRequest {
export const diskTypeLabels = {
[DiskType.STANDARD]: 'Standard Disk',
[DiskType.SSD]: 'Solid State Disk',
[DiskType.BALANCED]: 'Balanced Disk',
};

export interface DiskConfig {
Expand Down