From 782c5ded6545a493e3e255170af473af99b6e0a0 Mon Sep 17 00:00:00 2001 From: Nelson <194400+nelsonic@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:55:49 +0000 Subject: [PATCH 01/13] Add CX22 instance for Hetzner closes #834 --- .../db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql b/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql index 27ba92317..ac0f78bc1 100644 --- a/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql +++ b/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql @@ -292,6 +292,7 @@ INSERT INTO public.cloud_instances (cloud_provider, instance_group, instance_nam ('digitalocean', 'Medium Size', 'g-32vcpu-128gb', 32, 128, 1.500, 1008.000, '$', '2024-05-15'), ('digitalocean', 'Medium Size', 'm-32vcpu-256gb', 32, 256, 2.000, 1344.000, '$', '2024-05-15'), ('digitalocean', 'Medium Size', 'g-48vcpu-192gb', 48, 192, 2.699, 1814.000, '$', '2024-05-15'), + ('hetzner', 'Small Size', 'CX22', 2, 4, 0.0052, 3.29, '€', '2024-12-09'), ('hetzner', 'Small Size', 'CPX11', 2, 2, 0.007, 5.180, '€', '2024-07-21'), ('hetzner', 'Small Size', 'CPX21', 3, 4, 0.010, 8.980, '€', '2024-07-21'), ('hetzner', 'Small Size', 'CCX13', 2, 8, 0.024, 14.860, '€', '2024-05-15'), From ee9b413732a819e64b3c135093a4930cbe5ae302 Mon Sep 17 00:00:00 2001 From: Nelson <194400+nelsonic@users.noreply.github.com> Date: Mon, 9 Dec 2024 21:06:55 +0000 Subject: [PATCH 02/13] Update 20241205103951_2.1.0.sql with Hetzner Shared vCPU instances in USD #834 --- console/db/migrations/20241205103951_2.1.0.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/console/db/migrations/20241205103951_2.1.0.sql b/console/db/migrations/20241205103951_2.1.0.sql index 46079488e..378231205 100644 --- a/console/db/migrations/20241205103951_2.1.0.sql +++ b/console/db/migrations/20241205103951_2.1.0.sql @@ -23,3 +23,14 @@ WHERE extension_name IN ( -- +goose Down DELETE FROM public.postgres_versions WHERE major_version = 17; + + +-- Extends 20240520144338_2.0.0_initial_scheme_setup.sql#L217 with more cloud instance types +-- The price is approximate because it is specified for one region and may differ in other regions. +-- aws, gcp, azure: the price is for the region 'US East' +INSERT INTO public.cloud_instances (cloud_provider, instance_group, instance_name, cpu, ram, price_hourly, price_monthly, currency, updated_at) VALUES + ('hetzner', 'Small Size', 'CX22', 2, 4, 0.0064 , 3.99, '$', '2024-12-10'), + ('hetzner', 'Small Size', 'CX32', 4, 8, 0.0117 , 6.99, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CX42', 8, 16, 0.0294 , 17.99, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CX52', 16, 32, 0.0601 , 35.49, '$', '2024-12-10'); + From 73c99b883175bb45ead3c4032b1863c1306c0cc4 Mon Sep 17 00:00:00 2001 From: Nelson <194400+nelsonic@users.noreply.github.com> Date: Mon, 9 Dec 2024 21:24:38 +0000 Subject: [PATCH 03/13] Update Hetzner instances in 20240520144338_2.0.0_initial_scheme_setup.sql from EUR to USD ref: https://github.com/vitabaks/autobase/issues/834#issuecomment-2529501091 --- ...0240520144338_2.0.0_initial_scheme_setup.sql | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql b/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql index 3472aa3ae..92a86400e 100644 --- a/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql +++ b/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql @@ -292,15 +292,14 @@ INSERT INTO public.cloud_instances (cloud_provider, instance_group, instance_nam ('digitalocean', 'Medium Size', 'g-32vcpu-128gb', 32, 128, 1.500, 1008.000, '$', '2024-05-15'), ('digitalocean', 'Medium Size', 'm-32vcpu-256gb', 32, 256, 2.000, 1344.000, '$', '2024-05-15'), ('digitalocean', 'Medium Size', 'g-48vcpu-192gb', 48, 192, 2.699, 1814.000, '$', '2024-05-15'), - ('hetzner', 'Small Size', 'CX22', 2, 4, 0.0052, 3.29, '€', '2024-12-09'), - ('hetzner', 'Small Size', 'CPX11', 2, 2, 0.007, 5.180, '€', '2024-07-21'), - ('hetzner', 'Small Size', 'CPX21', 3, 4, 0.010, 8.980, '€', '2024-07-21'), - ('hetzner', 'Small Size', 'CCX13', 2, 8, 0.024, 14.860, '€', '2024-05-15'), - ('hetzner', 'Small Size', 'CCX23', 4, 16, 0.047, 29.140, '€', '2024-05-15'), - ('hetzner', 'Medium Size', 'CCX33', 8, 32, 0.093, 57.700, '€', '2024-05-15'), - ('hetzner', 'Medium Size', 'CCX43', 16, 64, 0.184, 114.820, '€', '2024-05-15'), - ('hetzner', 'Medium Size', 'CCX53', 32, 128, 0.367, 229.060, '€', '2024-05-15'), - ('hetzner', 'Medium Size', 'CCX63', 48, 192, 0.550, 343.300, '€', '2024-05-15'); + ('hetzner', 'Small Size', 'CPX11', 2, 2, 0.0072, 4.49, '$', '2024-12-10'), + ('hetzner', 'Small Size', 'CPX21', 3, 4, 0.0128, 7.99, '$', '2024-12-10'), + ('hetzner', 'Small Size', 'CCX13', 2, 8, 0.0216, 13.49, '$', '2024-12-10'), + ('hetzner', 'Small Size', 'CCX23', 4, 16, 0.0425, 26.49, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CCX33', 8, 32, 0.0857, 53.49, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CCX43', 16, 64, 0.1715, 106.99, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CCX53', 32, 128, 0.3421, 213.49, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CCX63', 48, 192, 0.5128, 319.99, '$', '2024-12-10'); ALTER TABLE ONLY public.cloud_instances ADD CONSTRAINT cloud_instances_pkey PRIMARY KEY (cloud_provider, instance_group, instance_name); From a92286901f41d075150affc57ab3c20e8e00a785 Mon Sep 17 00:00:00 2001 From: Nelson <194400+nelsonic@users.noreply.github.com> Date: Mon, 9 Dec 2024 21:36:39 +0000 Subject: [PATCH 04/13] Update Hetzner cloud_volumes from EUR to USD in 20240520144338_2.0.0_initial_scheme_setup.sql ref: https://github.com/vitabaks/autobase/issues/834#issuecomment-2529571591 --- .../db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql b/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql index 92a86400e..cd37e12ea 100644 --- a/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql +++ b/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql @@ -351,7 +351,7 @@ INSERT INTO public.cloud_volumes (cloud_provider, volume_type, volume_descriptio ('azure', 'Premium_LRS', 'Premium SSD (Max throughput: 900 MiB/s, Max IOPS: 20,000)', 10, 32000, 0.132, '$', false, '2024-05-15'), ('azure', 'UltraSSD_LRS', 'Ultra SSD (Max throughput: 10,000 MiB/s, Max IOPS: 400,000)', 10, 64000, 0.120, '$', false, '2024-05-15'), ('digitalocean', 'ssd', 'SSD Block Storage (Max throughput: 300 MiB/s, Max IOPS: 7,500)', 10, 16000, 0.100, '$', true, '2024-05-15'), - ('hetzner', 'ssd', 'SSD Block Storage (Max throughput: N/A MiB/s, Max IOPS: N/A)', 10, 10000, 0.052, '€', true, '2024-05-15'); + ('hetzner', 'ssd', 'SSD Block Storage (Max throughput: N/A MiB/s, Max IOPS: N/A)', 10, 10000, 0.05, '$', true, '2024-12-10'); ALTER TABLE ONLY public.cloud_volumes ADD CONSTRAINT cloud_volumes_pkey PRIMARY KEY (cloud_provider, volume_type); From aff671bded98209fc1be9f181a98313a265ac1df Mon Sep 17 00:00:00 2001 From: Nelson <194400+nelsonic@users.noreply.github.com> Date: Tue, 10 Dec 2024 08:33:58 +0000 Subject: [PATCH 05/13] Update all Hetzner instance prices to USD inc IPv4 in 20241205103951_2.1.0.sql ref: https://github.com/vitabaks/autobase/pull/835#issuecomment-2530697267 #835 --- .../db/migrations/20241205103951_2.1.0.sql | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/console/db/migrations/20241205103951_2.1.0.sql b/console/db/migrations/20241205103951_2.1.0.sql index 378231205..119a7a5b7 100644 --- a/console/db/migrations/20241205103951_2.1.0.sql +++ b/console/db/migrations/20241205103951_2.1.0.sql @@ -26,11 +26,29 @@ WHERE major_version = 17; -- Extends 20240520144338_2.0.0_initial_scheme_setup.sql#L217 with more cloud instance types --- The price is approximate because it is specified for one region and may differ in other regions. --- aws, gcp, azure: the price is for the region 'US East' +-- Heztner price is for the region 'Geremany / Finland', other regions may vary in price. INSERT INTO public.cloud_instances (cloud_provider, instance_group, instance_name, cpu, ram, price_hourly, price_monthly, currency, updated_at) VALUES - ('hetzner', 'Small Size', 'CX22', 2, 4, 0.0064 , 3.99, '$', '2024-12-10'), - ('hetzner', 'Small Size', 'CX32', 4, 8, 0.0117 , 6.99, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CX42', 8, 16, 0.0294 , 17.99, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CX52', 16, 32, 0.0601 , 35.49, '$', '2024-12-10'); + ('hetzner', 'Small Size', 'CX22', 2, 4, 0.0074 , 4.59, '$', '2024-12-10'), + ('hetzner', 'Small Size', 'CX32', 4, 8, 0.0127 , 7.59, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CX42', 8, 16, 0.0304 , 18.59, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CX52', 16, 32, 0.0611 , 36.09, '$', '2024-12-10'), + ('hetzner', 'Small Size', 'CPX31', 4, 8, 0.025 , 15.59, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CPX41', 8, 16, 0.0464 , 28.09, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CPX51', 16, 32, 0.0979 , 61.09, '$', '2024-12-10'); + +-- Update all existing Hetzner instances to use USD instead of EUR for easy comparison to other IaaS Providers. +-- cloud_instances +-- Update prices and other relevant fields for Hetzner cloud instances indludes an IPv4 address +UPDATE public.cloud_instances SET price_hourly = 0.0082, price_monthly = 5.09, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CPX11'; +UPDATE public.cloud_instances SET price_hourly = 0.0138, price_monthly = 8.59, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CPX21'; +UPDATE public.cloud_instances SET price_hourly = 0.0226, price_monthly = 14.09, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX13'; +UPDATE public.cloud_instances SET price_hourly = 0.0435, price_monthly = 27.09, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX23'; +UPDATE public.cloud_instances SET price_hourly = 0.0867, price_monthly = 54.09, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX33'; +UPDATE public.cloud_instances SET price_hourly = 0.1725, price_monthly = 107.59, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX43'; +UPDATE public.cloud_instances SET price_hourly = 0.3431, price_monthly = 214.09, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX53'; +UPDATE public.cloud_instances SET price_hourly = 0.5138, price_monthly = 320.59, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX63'; + +-- cloud_volumes +-- Update prices and other relevant fields for Hetzner cloud volume +UPDATE public.cloud_volumes SET price_monthly = 0.05, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner'; From e442c248d2ca235c720826cba1779206a6e2e955 Mon Sep 17 00:00:00 2001 From: Nelson <194400+nelsonic@users.noreply.github.com> Date: Tue, 10 Dec 2024 08:35:32 +0000 Subject: [PATCH 06/13] Revert changes in 20240520144338_2.0.0_initial_scheme_setup.sql ref https://github.com/vitabaks/autobase/pull/835#issuecomment-2530551152 instead these are updates in 2.1 #834 --- ...240520144338_2.0.0_initial_scheme_setup.sql | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql b/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql index cd37e12ea..9c10d1a7d 100644 --- a/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql +++ b/console/db/migrations/20240520144338_2.0.0_initial_scheme_setup.sql @@ -292,14 +292,14 @@ INSERT INTO public.cloud_instances (cloud_provider, instance_group, instance_nam ('digitalocean', 'Medium Size', 'g-32vcpu-128gb', 32, 128, 1.500, 1008.000, '$', '2024-05-15'), ('digitalocean', 'Medium Size', 'm-32vcpu-256gb', 32, 256, 2.000, 1344.000, '$', '2024-05-15'), ('digitalocean', 'Medium Size', 'g-48vcpu-192gb', 48, 192, 2.699, 1814.000, '$', '2024-05-15'), - ('hetzner', 'Small Size', 'CPX11', 2, 2, 0.0072, 4.49, '$', '2024-12-10'), - ('hetzner', 'Small Size', 'CPX21', 3, 4, 0.0128, 7.99, '$', '2024-12-10'), - ('hetzner', 'Small Size', 'CCX13', 2, 8, 0.0216, 13.49, '$', '2024-12-10'), - ('hetzner', 'Small Size', 'CCX23', 4, 16, 0.0425, 26.49, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CCX33', 8, 32, 0.0857, 53.49, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CCX43', 16, 64, 0.1715, 106.99, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CCX53', 32, 128, 0.3421, 213.49, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CCX63', 48, 192, 0.5128, 319.99, '$', '2024-12-10'); + ('hetzner', 'Small Size', 'CPX11', 2, 2, 0.007, 5.180, '€', '2024-07-21'), + ('hetzner', 'Small Size', 'CPX21', 3, 4, 0.010, 8.980, '€', '2024-07-21'), + ('hetzner', 'Small Size', 'CCX13', 2, 8, 0.024, 14.860, '€', '2024-05-15'), + ('hetzner', 'Small Size', 'CCX23', 4, 16, 0.047, 29.140, '€', '2024-05-15'), + ('hetzner', 'Medium Size', 'CCX33', 8, 32, 0.093, 57.700, '€', '2024-05-15'), + ('hetzner', 'Medium Size', 'CCX43', 16, 64, 0.184, 114.820, '€', '2024-05-15'), + ('hetzner', 'Medium Size', 'CCX53', 32, 128, 0.367, 229.060, '€', '2024-05-15'), + ('hetzner', 'Medium Size', 'CCX63', 48, 192, 0.550, 343.300, '€', '2024-05-15'); ALTER TABLE ONLY public.cloud_instances ADD CONSTRAINT cloud_instances_pkey PRIMARY KEY (cloud_provider, instance_group, instance_name); @@ -351,7 +351,7 @@ INSERT INTO public.cloud_volumes (cloud_provider, volume_type, volume_descriptio ('azure', 'Premium_LRS', 'Premium SSD (Max throughput: 900 MiB/s, Max IOPS: 20,000)', 10, 32000, 0.132, '$', false, '2024-05-15'), ('azure', 'UltraSSD_LRS', 'Ultra SSD (Max throughput: 10,000 MiB/s, Max IOPS: 400,000)', 10, 64000, 0.120, '$', false, '2024-05-15'), ('digitalocean', 'ssd', 'SSD Block Storage (Max throughput: 300 MiB/s, Max IOPS: 7,500)', 10, 16000, 0.100, '$', true, '2024-05-15'), - ('hetzner', 'ssd', 'SSD Block Storage (Max throughput: N/A MiB/s, Max IOPS: N/A)', 10, 10000, 0.05, '$', true, '2024-12-10'); + ('hetzner', 'ssd', 'SSD Block Storage (Max throughput: N/A MiB/s, Max IOPS: N/A)', 10, 10000, 0.052, '€', true, '2024-05-15'); ALTER TABLE ONLY public.cloud_volumes ADD CONSTRAINT cloud_volumes_pkey PRIMARY KEY (cloud_provider, volume_type); From a73c8087709a2ab0258dabbf0df3fd1270987073 Mon Sep 17 00:00:00 2001 From: Nelson <194400+nelsonic@users.noreply.github.com> Date: Tue, 10 Dec 2024 09:09:44 +0000 Subject: [PATCH 07/13] Move +goose Down to bottom of 20241205103951_2.1.0.sql addresses review comment: https://github.com/vitabaks/autobase/pull/835#discussion_r1877467702 --- console/db/migrations/20241205103951_2.1.0.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/console/db/migrations/20241205103951_2.1.0.sql b/console/db/migrations/20241205103951_2.1.0.sql index 119a7a5b7..6e0c2aa35 100644 --- a/console/db/migrations/20241205103951_2.1.0.sql +++ b/console/db/migrations/20241205103951_2.1.0.sql @@ -20,10 +20,6 @@ WHERE extension_name IN ( 'timescaledb' ); --- +goose Down -DELETE FROM public.postgres_versions -WHERE major_version = 17; - -- Extends 20240520144338_2.0.0_initial_scheme_setup.sql#L217 with more cloud instance types -- Heztner price is for the region 'Geremany / Finland', other regions may vary in price. @@ -52,3 +48,7 @@ UPDATE public.cloud_instances SET price_hourly = 0.5138, price_monthly = 320.59, -- cloud_volumes -- Update prices and other relevant fields for Hetzner cloud volume UPDATE public.cloud_volumes SET price_monthly = 0.05, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner'; + +-- +goose Down +DELETE FROM public.postgres_versions +WHERE major_version = 17; From 223570990762b6cfc5e5ec9f174743047856182a Mon Sep 17 00:00:00 2001 From: Nelson <194400+nelsonic@users.noreply.github.com> Date: Wed, 11 Dec 2024 08:37:50 +0000 Subject: [PATCH 08/13] Add Shared vCPU / Dedicated vCPU string to instance_name in 20241205103951_2.1.0.sql fixes #784 --- .../db/migrations/20241205103951_2.1.0.sql | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/console/db/migrations/20241205103951_2.1.0.sql b/console/db/migrations/20241205103951_2.1.0.sql index 6e0c2aa35..21e7828fb 100644 --- a/console/db/migrations/20241205103951_2.1.0.sql +++ b/console/db/migrations/20241205103951_2.1.0.sql @@ -24,26 +24,26 @@ WHERE extension_name IN ( -- Extends 20240520144338_2.0.0_initial_scheme_setup.sql#L217 with more cloud instance types -- Heztner price is for the region 'Geremany / Finland', other regions may vary in price. INSERT INTO public.cloud_instances (cloud_provider, instance_group, instance_name, cpu, ram, price_hourly, price_monthly, currency, updated_at) VALUES - ('hetzner', 'Small Size', 'CX22', 2, 4, 0.0074 , 4.59, '$', '2024-12-10'), - ('hetzner', 'Small Size', 'CX32', 4, 8, 0.0127 , 7.59, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CX42', 8, 16, 0.0304 , 18.59, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CX52', 16, 32, 0.0611 , 36.09, '$', '2024-12-10'), - ('hetzner', 'Small Size', 'CPX31', 4, 8, 0.025 , 15.59, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CPX41', 8, 16, 0.0464 , 28.09, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CPX51', 16, 32, 0.0979 , 61.09, '$', '2024-12-10'); + ('hetzner', 'Small Size', 'CX22 (Shared vCPU Intel)', 2, 4, 0.0074 , 4.59, '$', '2024-12-10'), + ('hetzner', 'Small Size', 'CX32 (Shared vCPU Intel)', 4, 8, 0.0127 , 7.59, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CX42 (Shared vCPU Intel)', 8, 16, 0.0304 , 18.59, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CX52 (Shared vCPU Intel)', 16, 32, 0.0611 , 36.09, '$', '2024-12-10'), + ('hetzner', 'Small Size', 'CPX31 (Shared vCPU AMD)', 4, 8, 0.025 , 15.59, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CPX41 (Shared vCPU AMD)', 8, 16, 0.0464 , 28.09, '$', '2024-12-10'), + ('hetzner', 'Medium Size', 'CPX51 (Shared vCPU AMD)', 16, 32, 0.0979 , 61.09, '$', '2024-12-10'); -- Update all existing Hetzner instances to use USD instead of EUR for easy comparison to other IaaS Providers. -- cloud_instances -- Update prices and other relevant fields for Hetzner cloud instances indludes an IPv4 address -UPDATE public.cloud_instances SET price_hourly = 0.0082, price_monthly = 5.09, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CPX11'; -UPDATE public.cloud_instances SET price_hourly = 0.0138, price_monthly = 8.59, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CPX21'; -UPDATE public.cloud_instances SET price_hourly = 0.0226, price_monthly = 14.09, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX13'; -UPDATE public.cloud_instances SET price_hourly = 0.0435, price_monthly = 27.09, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX23'; -UPDATE public.cloud_instances SET price_hourly = 0.0867, price_monthly = 54.09, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX33'; -UPDATE public.cloud_instances SET price_hourly = 0.1725, price_monthly = 107.59, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX43'; -UPDATE public.cloud_instances SET price_hourly = 0.3431, price_monthly = 214.09, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX53'; -UPDATE public.cloud_instances SET price_hourly = 0.5138, price_monthly = 320.59, currency = '$', updated_at = '2024-12-10' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX63'; +UPDATE public.cloud_instances SET price_hourly = 0.0082, price_monthly = 5.09, currency = '$', updated_at = '2024-12-10', instance_name = 'CPX11 (Shared vCPU AMD)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CPX11'; +UPDATE public.cloud_instances SET price_hourly = 0.0138, price_monthly = 8.59, currency = '$', updated_at = '2024-12-10', instance_name = 'CPX21 (Shared vCPU AMD)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CPX21'; +UPDATE public.cloud_instances SET price_hourly = 0.0226, price_monthly = 14.09, currency = '$', updated_at = '2024-12-10', instance_name = 'CCX13 (Dedicated vCPU)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX13'; +UPDATE public.cloud_instances SET price_hourly = 0.0435, price_monthly = 27.09, currency = '$', updated_at = '2024-12-10', instance_name = 'CCX23 (Dedicated vCPU)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX23'; +UPDATE public.cloud_instances SET price_hourly = 0.0867, price_monthly = 54.09, currency = '$', updated_at = '2024-12-10', instance_name = 'CCX33 (Dedicated vCPU)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX33'; +UPDATE public.cloud_instances SET price_hourly = 0.1725, price_monthly = 107.59, currency = '$', updated_at = '2024-12-10', instance_name = 'CCX43 (Dedicated vCPU)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX43'; +UPDATE public.cloud_instances SET price_hourly = 0.3431, price_monthly = 214.09, currency = '$', updated_at = '2024-12-10', instance_name = 'CCX53 (Dedicated vCPU)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX53'; +UPDATE public.cloud_instances SET price_hourly = 0.5138, price_monthly = 320.59, currency = '$', updated_at = '2024-12-10', instance_name = 'CCX63 (Dedicated vCPU)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX63'; -- cloud_volumes -- Update prices and other relevant fields for Hetzner cloud volume From 025bbd3839a22d12dfee23a694f6f91711fef65f Mon Sep 17 00:00:00 2001 From: Nelson <194400+nelsonic@users.noreply.github.com> Date: Wed, 11 Dec 2024 09:01:29 +0000 Subject: [PATCH 09/13] Revert update to instance_name, add shared_cpu bool field to cloud_instances for #784 --- .../db/migrations/20241205103951_2.1.0.sql | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/console/db/migrations/20241205103951_2.1.0.sql b/console/db/migrations/20241205103951_2.1.0.sql index 21e7828fb..e6adccf75 100644 --- a/console/db/migrations/20241205103951_2.1.0.sql +++ b/console/db/migrations/20241205103951_2.1.0.sql @@ -20,30 +20,34 @@ WHERE extension_name IN ( 'timescaledb' ); +-- Adds shared_cpu BOOLEAN field to cloud_instances for Hetzner which has both Shared and Dedicated vCPU +-- ref: https://github.com/vitabaks/autobase/issues/784 +ALTER TABLE ONLY public.cloud_instances +ADD COLUMN 'shared_cpu' BOOLEAN DEFAULT FALSE; -- Extends 20240520144338_2.0.0_initial_scheme_setup.sql#L217 with more cloud instance types -- Heztner price is for the region 'Geremany / Finland', other regions may vary in price. -INSERT INTO public.cloud_instances (cloud_provider, instance_group, instance_name, cpu, ram, price_hourly, price_monthly, currency, updated_at) VALUES - ('hetzner', 'Small Size', 'CX22 (Shared vCPU Intel)', 2, 4, 0.0074 , 4.59, '$', '2024-12-10'), - ('hetzner', 'Small Size', 'CX32 (Shared vCPU Intel)', 4, 8, 0.0127 , 7.59, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CX42 (Shared vCPU Intel)', 8, 16, 0.0304 , 18.59, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CX52 (Shared vCPU Intel)', 16, 32, 0.0611 , 36.09, '$', '2024-12-10'), - ('hetzner', 'Small Size', 'CPX31 (Shared vCPU AMD)', 4, 8, 0.025 , 15.59, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CPX41 (Shared vCPU AMD)', 8, 16, 0.0464 , 28.09, '$', '2024-12-10'), - ('hetzner', 'Medium Size', 'CPX51 (Shared vCPU AMD)', 16, 32, 0.0979 , 61.09, '$', '2024-12-10'); +INSERT INTO public.cloud_instances (cloud_provider, instance_group, instance_name, cpu, ram, price_hourly, price_monthly, currency, updated_at, shared_cpu) VALUES + ('hetzner', 'Small Size', 'CX22', 2, 4, 0.0074 , 4.59, '$', '2024-12-10', true), + ('hetzner', 'Small Size', 'CX32', 4, 8, 0.0127 , 7.59, '$', '2024-12-10', true), + ('hetzner', 'Medium Size', 'CX42', 8, 16, 0.0304 , 18.59, '$', '2024-12-10', true), + ('hetzner', 'Medium Size', 'CX52', 16, 32, 0.0611 , 36.09, '$', '2024-12-10', true), + ('hetzner', 'Small Size', 'CPX31', 4, 8, 0.025 , 15.59, '$', '2024-12-10', true), + ('hetzner', 'Medium Size', 'CPX41', 8, 16, 0.0464 , 28.09, '$', '2024-12-10', true), + ('hetzner', 'Medium Size', 'CPX51', 16, 32, 0.0979 , 61.09, '$', '2024-12-10', true); -- Update all existing Hetzner instances to use USD instead of EUR for easy comparison to other IaaS Providers. -- cloud_instances -- Update prices and other relevant fields for Hetzner cloud instances indludes an IPv4 address -UPDATE public.cloud_instances SET price_hourly = 0.0082, price_monthly = 5.09, currency = '$', updated_at = '2024-12-10', instance_name = 'CPX11 (Shared vCPU AMD)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CPX11'; -UPDATE public.cloud_instances SET price_hourly = 0.0138, price_monthly = 8.59, currency = '$', updated_at = '2024-12-10', instance_name = 'CPX21 (Shared vCPU AMD)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CPX21'; -UPDATE public.cloud_instances SET price_hourly = 0.0226, price_monthly = 14.09, currency = '$', updated_at = '2024-12-10', instance_name = 'CCX13 (Dedicated vCPU)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX13'; -UPDATE public.cloud_instances SET price_hourly = 0.0435, price_monthly = 27.09, currency = '$', updated_at = '2024-12-10', instance_name = 'CCX23 (Dedicated vCPU)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX23'; -UPDATE public.cloud_instances SET price_hourly = 0.0867, price_monthly = 54.09, currency = '$', updated_at = '2024-12-10', instance_name = 'CCX33 (Dedicated vCPU)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX33'; -UPDATE public.cloud_instances SET price_hourly = 0.1725, price_monthly = 107.59, currency = '$', updated_at = '2024-12-10', instance_name = 'CCX43 (Dedicated vCPU)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX43'; -UPDATE public.cloud_instances SET price_hourly = 0.3431, price_monthly = 214.09, currency = '$', updated_at = '2024-12-10', instance_name = 'CCX53 (Dedicated vCPU)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX53'; -UPDATE public.cloud_instances SET price_hourly = 0.5138, price_monthly = 320.59, currency = '$', updated_at = '2024-12-10', instance_name = 'CCX63 (Dedicated vCPU)' WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX63'; +UPDATE public.cloud_instances SET price_hourly = 0.0082, price_monthly = 5.09, currency = '$', updated_at = '2024-12-10', shared_cpu = true WHERE cloud_provider = 'hetzner' AND instance_name = 'CPX11'; +UPDATE public.cloud_instances SET price_hourly = 0.0138, price_monthly = 8.59, currency = '$', updated_at = '2024-12-10', shared_cpu = true WHERE cloud_provider = 'hetzner' AND instance_name = 'CPX21'; +UPDATE public.cloud_instances SET price_hourly = 0.0226, price_monthly = 14.09, currency = '$', updated_at = '2024-12-10', shared_cpu = false WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX13'; +UPDATE public.cloud_instances SET price_hourly = 0.0435, price_monthly = 27.09, currency = '$', updated_at = '2024-12-10', shared_cpu = false WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX23'; +UPDATE public.cloud_instances SET price_hourly = 0.0867, price_monthly = 54.09, currency = '$', updated_at = '2024-12-10', shared_cpu = false WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX33'; +UPDATE public.cloud_instances SET price_hourly = 0.1725, price_monthly = 107.59, currency = '$', updated_at = '2024-12-10', shared_cpu = false WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX43'; +UPDATE public.cloud_instances SET price_hourly = 0.3431, price_monthly = 214.09, currency = '$', updated_at = '2024-12-10', shared_cpu = false WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX53'; +UPDATE public.cloud_instances SET price_hourly = 0.5138, price_monthly = 320.59, currency = '$', updated_at = '2024-12-10', shared_cpu = false WHERE cloud_provider = 'hetzner' AND instance_name = 'CCX63'; -- cloud_volumes -- Update prices and other relevant fields for Hetzner cloud volume From f7fc3a12d8ff1ead8d92b23cf64d8526b4068742 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik <37010174+vitabaks@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:52:14 +0500 Subject: [PATCH 10/13] Update console/db/migrations/20241205103951_2.1.0.sql --- .../db/migrations/20241205103951_2.1.0.sql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/console/db/migrations/20241205103951_2.1.0.sql b/console/db/migrations/20241205103951_2.1.0.sql index e6adccf75..7a8c4f46d 100644 --- a/console/db/migrations/20241205103951_2.1.0.sql +++ b/console/db/migrations/20241205103951_2.1.0.sql @@ -25,6 +25,26 @@ WHERE extension_name IN ( ALTER TABLE ONLY public.cloud_instances ADD COLUMN 'shared_cpu' BOOLEAN DEFAULT FALSE; +-- Update AWS shared vCPU instances +UPDATE public.cloud_instances +SET shared_cpu = true +WHERE cloud_provider = 'aws' AND instance_name IN ('t3.small', 't3.medium'); + +-- Update GCP shared vCPU instances +UPDATE public.cloud_instances +SET shared_cpu = true +WHERE cloud_provider = 'gcp' AND instance_name IN ('e2-small', 'e2-medium'); + +-- Update Azure shared vCPU instances +UPDATE public.cloud_instances +SET shared_cpu = true +WHERE cloud_provider = 'azure' AND instance_name IN ('Standard_B1ms', 'Standard_B2s'); + +-- Update DigitalOcean shared vCPU instances +UPDATE public.cloud_instances +SET shared_cpu = true +WHERE cloud_provider = 'digitalocean' AND instance_name IN ('s-2vcpu-2gb', 's-2vcpu-4gb'); + -- Extends 20240520144338_2.0.0_initial_scheme_setup.sql#L217 with more cloud instance types -- Heztner price is for the region 'Geremany / Finland', other regions may vary in price. INSERT INTO public.cloud_instances (cloud_provider, instance_group, instance_name, cpu, ram, price_hourly, price_monthly, currency, updated_at, shared_cpu) VALUES From 523e571b4d06b94e816a9826265e277ebf0480af Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik <37010174+vitabaks@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:52:24 +0500 Subject: [PATCH 11/13] Update console/db/migrations/20241205103951_2.1.0.sql --- console/db/migrations/20241205103951_2.1.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/db/migrations/20241205103951_2.1.0.sql b/console/db/migrations/20241205103951_2.1.0.sql index 7a8c4f46d..5e9a98ed2 100644 --- a/console/db/migrations/20241205103951_2.1.0.sql +++ b/console/db/migrations/20241205103951_2.1.0.sql @@ -20,7 +20,7 @@ WHERE extension_name IN ( 'timescaledb' ); --- Adds shared_cpu BOOLEAN field to cloud_instances for Hetzner which has both Shared and Dedicated vCPU +-- Adds shared_cpu BOOLEAN field to cloud_instances -- ref: https://github.com/vitabaks/autobase/issues/784 ALTER TABLE ONLY public.cloud_instances ADD COLUMN 'shared_cpu' BOOLEAN DEFAULT FALSE; From 604b49c9cd10a340212e6da36522a43b8fec6687 Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik <37010174+vitabaks@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:12:27 +0500 Subject: [PATCH 12/13] Update console/db/migrations/20241205103951_2.1.0.sql --- console/db/migrations/20241205103951_2.1.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/db/migrations/20241205103951_2.1.0.sql b/console/db/migrations/20241205103951_2.1.0.sql index 5e9a98ed2..130a612ac 100644 --- a/console/db/migrations/20241205103951_2.1.0.sql +++ b/console/db/migrations/20241205103951_2.1.0.sql @@ -23,7 +23,7 @@ WHERE extension_name IN ( -- Adds shared_cpu BOOLEAN field to cloud_instances -- ref: https://github.com/vitabaks/autobase/issues/784 ALTER TABLE ONLY public.cloud_instances -ADD COLUMN 'shared_cpu' BOOLEAN DEFAULT FALSE; +ADD COLUMN shared_cpu BOOLEAN DEFAULT FALSE; -- Update AWS shared vCPU instances UPDATE public.cloud_instances From 45b5bdcc0b331e802bca8bc1c83217a2a834842c Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Thu, 12 Dec 2024 13:46:50 +0500 Subject: [PATCH 13/13] Add shared_cpu in API --- console/service/api/swagger.yaml | 3 +++ console/service/internal/convert/external_deployments.go | 3 +++ console/service/internal/storage/models.go | 1 + 3 files changed, 7 insertions(+) diff --git a/console/service/api/swagger.yaml b/console/service/api/swagger.yaml index 00cd33a31..9d9944835 100644 --- a/console/service/api/swagger.yaml +++ b/console/service/api/swagger.yaml @@ -1058,6 +1058,9 @@ definitions: cpu: type: integer example: 8 + shared_cpu: + type: boolean + example: false ram: type: integer example: 256 diff --git a/console/service/internal/convert/external_deployments.go b/console/service/internal/convert/external_deployments.go index fafbf80c0..ac5819929 100644 --- a/console/service/internal/convert/external_deployments.go +++ b/console/service/internal/convert/external_deployments.go @@ -61,6 +61,7 @@ func ProviderInfoToSwagger(providerInfo *storage.CloudProviderInfo, description, resp.InstanceTypes.Small = append(resp.InstanceTypes.Small, &models.DeploymentInstanceType{ Code: instance.InstanceName, CPU: instance.Cpu, + SharedCPU: instance.SharedCpu, PriceHourly: instance.PriceHourly, PriceMonthly: instance.PriceMonthly, Currency: instance.Currency, @@ -70,6 +71,7 @@ func ProviderInfoToSwagger(providerInfo *storage.CloudProviderInfo, description, resp.InstanceTypes.Medium = append(resp.InstanceTypes.Medium, &models.DeploymentInstanceType{ Code: instance.InstanceName, CPU: instance.Cpu, + SharedCPU: instance.SharedCpu, PriceHourly: instance.PriceHourly, PriceMonthly: instance.PriceMonthly, Currency: instance.Currency, @@ -79,6 +81,7 @@ func ProviderInfoToSwagger(providerInfo *storage.CloudProviderInfo, description, resp.InstanceTypes.Large = append(resp.InstanceTypes.Large, &models.DeploymentInstanceType{ Code: instance.InstanceName, CPU: instance.Cpu, + SharedCPU: instance.SharedCpu, PriceHourly: instance.PriceHourly, PriceMonthly: instance.PriceMonthly, Currency: instance.Currency, diff --git a/console/service/internal/storage/models.go b/console/service/internal/storage/models.go index be8e0673f..17e28f98d 100644 --- a/console/service/internal/storage/models.go +++ b/console/service/internal/storage/models.go @@ -29,6 +29,7 @@ type CloudInstance struct { PriceMonthly float64 Currency string UpdatedAt time.Time + SharedCpu bool } type CloudImage struct {