mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
## What kind of change does this PR introduce? Copy/label update in Studio's compute surfaces. ## Description Compute CPU descriptions now branch on the compute size tier: - Sizes below Large read **"Shared compute"** (no core count) - Large and up read **"Dedicated · N vCPUs"** — the unit is always vCPU Changes: - New `lib/compute-labels.ts` helper (`isSharedComputeSize`, `getComputeCpuLabel`) with unit tests - Compute badge hover card, compute size picker, and project-creation selector use the new labels - `new-project.constants.ts` cpu strings updated accordingly - ">16XL" card: "Custom CPU" → "Custom compute"; upsell copy now says "64 vCPUs" - The synthetic Nano/Micro addon `meta` no longer has `cpu_cores`/`cpu_dedicated`; removed the now-unused cpu fields from the hardcoded instance specs - Project-creation sub-text: "Larger, dedicated compute available after creation" ## Tests - New unit tests for the label helper - Infrastructure settings page test now asserts the rendered labels Fixes PROD-663 Related #49998 #49996 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **User Interface** * Updated compute-size labels to use “Shared compute” and vCPU terminology. * Clarified dedicated compute options and availability messaging. * Updated custom instance and upgrade labels, including “Custom compute” and “64 vCPUs.” * **Consistency** * Standardized compute labels across project creation, infrastructure settings, and compute details. * **Tests** * Added coverage verifying shared and dedicated compute classifications and displayed labels. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
174 lines
4.6 KiB
TypeScript
174 lines
4.6 KiB
TypeScript
import { components } from 'api-types'
|
|
|
|
import { PROVIDERS } from '@/lib/constants'
|
|
|
|
export type DesiredInstanceSize = Exclude<
|
|
components['schemas']['CreateProjectBody']['desired_instance_size'],
|
|
undefined | 'pico' | 'nano'
|
|
>
|
|
export type ReleaseChannel = Exclude<
|
|
components['schemas']['CreateProjectBody']['release_channel'],
|
|
undefined
|
|
>
|
|
export type PostgresEngine = Exclude<
|
|
components['schemas']['CreateProjectBody']['postgres_engine'],
|
|
undefined
|
|
>
|
|
|
|
export const instanceSizeSpecs: Record<
|
|
DesiredInstanceSize,
|
|
{
|
|
label: string
|
|
ram: string
|
|
cpu: string
|
|
priceHourly: number
|
|
priceMonthly: number
|
|
cloud_providers: string[]
|
|
}
|
|
> = {
|
|
micro: {
|
|
label: 'Micro',
|
|
ram: '1 GB',
|
|
cpu: 'Shared compute',
|
|
priceHourly: 0.01344,
|
|
priceMonthly: 10,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
small: {
|
|
label: 'Small',
|
|
ram: '2 GB',
|
|
cpu: 'Shared compute',
|
|
priceHourly: 0.0206,
|
|
priceMonthly: 15,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
medium: {
|
|
label: 'Medium',
|
|
ram: '4 GB',
|
|
cpu: 'Shared compute',
|
|
priceHourly: 0.0822,
|
|
priceMonthly: 60,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
large: {
|
|
label: 'Large',
|
|
ram: '8 GB',
|
|
cpu: '2 vCPUs',
|
|
priceHourly: 0.1517,
|
|
priceMonthly: 110,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
xlarge: {
|
|
label: 'XL',
|
|
ram: '16 GB',
|
|
cpu: '4 vCPUs',
|
|
priceHourly: 0.2877,
|
|
priceMonthly: 210,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
'2xlarge': {
|
|
label: '2XL',
|
|
ram: '32 GB',
|
|
cpu: '8 vCPUs',
|
|
priceHourly: 0.562,
|
|
priceMonthly: 410,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
'4xlarge': {
|
|
label: '4XL',
|
|
ram: '64 GB',
|
|
cpu: '16 vCPUs',
|
|
priceHourly: 1.32,
|
|
priceMonthly: 960,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
'8xlarge': {
|
|
label: '8XL',
|
|
ram: '128 GB',
|
|
cpu: '32 vCPUs',
|
|
priceHourly: 2.562,
|
|
priceMonthly: 1870,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
'12xlarge': {
|
|
label: '12XL',
|
|
ram: '192 GB',
|
|
cpu: '48 vCPUs',
|
|
priceHourly: 3.836,
|
|
priceMonthly: 2800,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
'16xlarge': {
|
|
label: '16XL',
|
|
ram: '256 GB',
|
|
cpu: '64 vCPUs',
|
|
priceHourly: 5.12,
|
|
priceMonthly: 3730,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
'24xlarge': {
|
|
label: '24XL',
|
|
ram: '384 GB',
|
|
cpu: '96 vCPUs',
|
|
priceHourly: 9.73,
|
|
priceMonthly: 7100,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
'24xlarge_optimized_cpu': {
|
|
label: '24XL - Optimized CPU',
|
|
ram: '192 GB',
|
|
cpu: '96 vCPUs',
|
|
priceHourly: 8.9,
|
|
priceMonthly: 6500,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
'24xlarge_optimized_memory': {
|
|
label: '24XL - Optimized Memory',
|
|
ram: '768 GB',
|
|
cpu: '96 vCPUs',
|
|
priceHourly: 13.84,
|
|
priceMonthly: 10100,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
'24xlarge_high_memory': {
|
|
label: '24XL - High Memory',
|
|
ram: '1536 GB',
|
|
cpu: '96 vCPUs',
|
|
priceHourly: 21.91,
|
|
priceMonthly: 16000,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
'48xlarge': {
|
|
label: '48XL',
|
|
ram: '768 GB',
|
|
cpu: '192 vCPUs',
|
|
priceHourly: 19.47,
|
|
priceMonthly: 14200,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
'48xlarge_optimized_cpu': {
|
|
label: '48XL - Optimized CPU',
|
|
ram: '384 GB',
|
|
cpu: '192 vCPUs',
|
|
priceHourly: 17.8,
|
|
priceMonthly: 13000,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
'48xlarge_optimized_memory': {
|
|
label: '48XL - Optimized Memory',
|
|
ram: '1536 GB',
|
|
cpu: '192 vCPUs',
|
|
priceHourly: 27.68,
|
|
priceMonthly: 20200,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
'48xlarge_high_memory': {
|
|
label: '48XL - High Memory',
|
|
ram: '3072 GB',
|
|
cpu: '192 vCPUs',
|
|
priceHourly: 43.84,
|
|
priceMonthly: 32000,
|
|
cloud_providers: [PROVIDERS.AWS.id, PROVIDERS.AWS_K8S.id, PROVIDERS.AWS_NIMBUS.id],
|
|
},
|
|
}
|