Skip to content
Merged
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
2 changes: 1 addition & 1 deletion OMICRON_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
985304a607b16191bdc35e0ea87fa522d925b514
c007af2f407ddbee44a9c37a690e3208a0f848cc
56 changes: 52 additions & 4 deletions app/api/__generated__/Api.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/api/__generated__/OMICRON_VERSION

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions app/api/__generated__/msw-handlers.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 40 additions & 3 deletions app/api/__generated__/validate.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/pages/project/instances/AutoRestartCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export function AutoRestartCard() {
memory: instance.memory,
cpuPlatform: instance.cpuPlatform || null,
bootDisk: instance.bootDiskId || null,
enableJumboFrames: instance.enableJumboFrames,
},
})
})
Expand Down
1 change: 1 addition & 0 deletions app/pages/project/instances/InstancePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ export function ResizeInstanceModal({
bootDisk: instance.bootDiskId || null,
cpuPlatform: instance.cpuPlatform || null,
autoRestartPolicy: instance.autoRestartPolicy || null,
enableJumboFrames: instance.enableJumboFrames,
},
})
})
Expand Down
4 changes: 4 additions & 0 deletions app/pages/project/instances/StorageTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export default function StorageTab() {
memory: instance.memory,
autoRestartPolicy: instance.autoRestartPolicy || null,
cpuPlatform: instance.cpuPlatform || null,
enableJumboFrames: instance.enableJumboFrames,
},
}),
errorTitle: 'Could not unset boot disk',
Expand Down Expand Up @@ -224,6 +225,7 @@ export default function StorageTab() {
instance.ncpus,
instance.memory,
instance.cpuPlatform,
instance.enableJumboFrames,
getSnapshotAction,
]
)
Expand Down Expand Up @@ -252,6 +254,7 @@ export default function StorageTab() {
memory: instance.memory,
autoRestartPolicy: instance.autoRestartPolicy || null,
cpuPlatform: instance.cpuPlatform || null,
enableJumboFrames: instance.enableJumboFrames,
},
}),
errorTitle: `Could not ${verb} boot disk`,
Expand Down Expand Up @@ -304,6 +307,7 @@ export default function StorageTab() {
instance.ncpus,
instance.memory,
instance.cpuPlatform,
instance.enableJumboFrames,
getSnapshotAction,
bootDisks,
]
Expand Down
4 changes: 2 additions & 2 deletions mock-api/disk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ export const disks: Json<Disk>[] = [
device_path: '/jkl',
size: 12 * GiB,
block_size: 2048,
disk_type: 'distributed' as const,
disk_type: 'distributed',
read_only: false,
}
} satisfies Json<Disk>
}),
]
2 changes: 1 addition & 1 deletion mock-api/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { project } from './project'
const base = {
time_created: new Date().toISOString(),
time_modified: new Date().toISOString(),
block_size: 512,
block_size: 512 as const,
}

export const images: Json<Image>[] = [
Expand Down
1 change: 1 addition & 0 deletions mock-api/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const base = {
auto_restart_enabled: true,
ncpus: 2,
memory: 4 * GiB,
enable_jumbo_frames: false,
}

export const instance: Json<Instance> = {
Expand Down
6 changes: 6 additions & 0 deletions mock-api/msw/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,7 @@ export const handlers = makeHandlers({
time_run_state_updated: new Date().toISOString(),
boot_disk_id: bootDiskId,
auto_restart_enabled: true,
enable_jumbo_frames: body.enable_jumbo_frames ?? false,
}

if (body.start) {
Expand Down Expand Up @@ -892,6 +893,9 @@ export const handlers = makeHandlers({
instance.auto_restart_policy = body.auto_restart_policy
instance.cpu_platform = body.cpu_platform

// required on the body, so always set it (effective on next restart in nexus)
instance.enable_jumbo_frames = body.enable_jumbo_frames

// We depart here from nexus in that nexus does both of the following
// calculations at view time (when converting model to view). We can't
// do that/don't need because our mock DB stores and returns the view
Expand Down Expand Up @@ -2681,6 +2685,8 @@ export const handlers = makeHandlers({
supportBundleUpdate: NotImplemented,
supportBundleView: NotImplemented,
switchView: NotImplemented,
systemNetworkingSettingsUpdate: NotImplemented,
systemNetworkingSettingsView: NotImplemented,
systemQuotasList: NotImplemented,
systemTimeseriesSchemaList: NotImplemented,
systemUpdateRecoveryFinish: NotImplemented,
Expand Down
5 changes: 3 additions & 2 deletions mock-api/msw/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
MAX_DISK_SIZE_GiB,
MIN_DISK_SIZE_GiB,
totalCapacity,
type BlockSize,
type DiskBackend,
type DiskCreate,
type IpRange,
Expand Down Expand Up @@ -156,9 +157,9 @@ export const errIfExists = <T extends Record<string, unknown>>(
* https://github.com/oxidecomputer/omicron/blob/dd74446/nexus/src/app/sagas/disk_create.rs#L292-L304
* https://github.com/oxidecomputer/omicron/blob/dd74446/nexus/src/app/disk.rs#L159-L174
*/
export function getBlockSize(backend: Json<DiskBackend>): number {
export function getBlockSize(backend: Json<DiskBackend>): BlockSize {
return match(backend)
.with({ type: 'local' }, () => 4096) // All local disks use 4k block size (AdvancedFormat)
.with({ type: 'local' }, () => 4096 as const) // All local disks use 4k block size (AdvancedFormat)
.with({ type: 'distributed' }, ({ disk_source: source }) =>
match(source)
.with({ type: 'blank' }, (s) => s.block_size)
Expand Down
Loading