From 5c26cae3d57d3cdd7f8484267c08713177e5deea Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 09:23:38 +0100 Subject: [PATCH 01/17] downscale machines for cost reason --- backend/fly.toml | 3 ++- frontend/fly.toml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/fly.toml b/backend/fly.toml index 19568e6..0dd5026 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -17,6 +17,7 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - memory = '1gb' + size = "shared-cpu-1x" + memory = '256mb' cpu_kind = 'shared' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index 104d581..f9581c6 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -17,6 +17,7 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - memory = '1gb' + size = "shared-cpu-1x" + memory = '256mb' cpu_kind = 'shared' cpus = 1 From b7c153deb3fc32562bd1e55c2ae3236c1b977ad6 Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 09:28:51 +0100 Subject: [PATCH 02/17] upgrade vm memory --- backend/fly.toml | 2 +- frontend/fly.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/fly.toml b/backend/fly.toml index 0dd5026..7f470c5 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -18,6 +18,6 @@ primary_region = 'cdg' [[vm]] size = "shared-cpu-1x" - memory = '256mb' + memory = '512mb' cpu_kind = 'shared' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index f9581c6..9453388 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -18,6 +18,6 @@ primary_region = 'cdg' [[vm]] size = "shared-cpu-1x" - memory = '256mb' + memory = '512mb' cpu_kind = 'shared' cpus = 1 From 009d053d78142066c1cbb56576da244d2a129602 Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 09:34:45 +0100 Subject: [PATCH 03/17] switch back to 2 cpu --- backend/fly.toml | 2 +- frontend/fly.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/fly.toml b/backend/fly.toml index 7f470c5..9f1f7d6 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -17,7 +17,7 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - size = "shared-cpu-1x" + size = "shared-cpu-2x" memory = '512mb' cpu_kind = 'shared' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index 9453388..b70ee68 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -17,7 +17,7 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - size = "shared-cpu-1x" + size = "shared-cpu-2x" memory = '512mb' cpu_kind = 'shared' cpus = 1 From 8bf1bb5ca038e371efb011ac7e9801d23be1977d Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 09:41:25 +0100 Subject: [PATCH 04/17] removed shared machines --- backend/fly.toml | 1 - frontend/fly.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/backend/fly.toml b/backend/fly.toml index 9f1f7d6..7ec755c 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -17,7 +17,6 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - size = "shared-cpu-2x" memory = '512mb' cpu_kind = 'shared' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index b70ee68..05afbaa 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -17,7 +17,6 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - size = "shared-cpu-2x" memory = '512mb' cpu_kind = 'shared' cpus = 1 From c6cef349a2ef827b3e73af348303d249c94dd703 Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 09:45:05 +0100 Subject: [PATCH 05/17] back to 1gb memory --- backend/fly.toml | 2 +- frontend/fly.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/fly.toml b/backend/fly.toml index 7ec755c..19568e6 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -17,6 +17,6 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - memory = '512mb' + memory = '1gb' cpu_kind = 'shared' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index 05afbaa..104d581 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -17,6 +17,6 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - memory = '512mb' + memory = '1gb' cpu_kind = 'shared' cpus = 1 From 397e49cc3c5cd3843b09ae275eb5df626b67a6b7 Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 09:51:52 +0100 Subject: [PATCH 06/17] fix pipleine? --- .github/workflows/deploy-preview.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 3740396..cb6f1d2 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -71,5 +71,7 @@ jobs: id: deploy uses: superfly/fly-pr-review-apps@1.3.0 with: + region: cdg + memory: '256' path: ./backend secrets: DATABASE_URL=${{ env.DATABASE_URL }} \ No newline at end of file From e4d8f0201c507731f63b3a80e60d81775d9edc30 Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 09:52:13 +0100 Subject: [PATCH 07/17] fix toml? --- backend/fly.toml | 2 +- frontend/fly.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/fly.toml b/backend/fly.toml index 19568e6..7ec755c 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -17,6 +17,6 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - memory = '1gb' + memory = '512mb' cpu_kind = 'shared' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index 104d581..05afbaa 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -17,6 +17,6 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - memory = '1gb' + memory = '512mb' cpu_kind = 'shared' cpus = 1 From 1af67047b4fe9d950e776ae0f2bbcf05b8335abb Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 09:57:30 +0100 Subject: [PATCH 08/17] dunno what's goin on --- .github/workflows/deploy-preview.yml | 4 +++- backend/fly.toml | 2 +- frontend/fly.toml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index cb6f1d2..0221595 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -72,6 +72,8 @@ jobs: uses: superfly/fly-pr-review-apps@1.3.0 with: region: cdg - memory: '256' + memory: '512' + cpukind: 'shared' + vmsize: 'shared-cpu-1x' path: ./backend secrets: DATABASE_URL=${{ env.DATABASE_URL }} \ No newline at end of file diff --git a/backend/fly.toml b/backend/fly.toml index 7ec755c..5e18ac5 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -1,7 +1,7 @@ # fly.toml app configuration file generated for blog-app-black-pine-3535 on 2024-10-31T12:45:04+01:00 # # See https://fly.io/docs/reference/configuration/ for information about how to use this file. -# + app = 'blog-app-black-pine-3535' primary_region = 'cdg' diff --git a/frontend/fly.toml b/frontend/fly.toml index 05afbaa..fb7d43b 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -1,7 +1,7 @@ # fly.toml app configuration file generated for blog-app-frontend on 2024-11-06T13:37:30+01:00 # # See https://fly.io/docs/reference/configuration/ for information about how to use this file. -# + app = 'blog-app-frontend' primary_region = 'cdg' From 68f101a2886f5fc851098bb9bd1c91b225b01e15 Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 10:01:34 +0100 Subject: [PATCH 09/17] test after pr fix --- backend/fly.toml | 2 +- frontend/fly.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/fly.toml b/backend/fly.toml index 5e18ac5..51a2cd9 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -17,6 +17,6 @@ primary_region = 'cdg' processes = ['app'] [[vm]] + size = "shared-cpu-1x" memory = '512mb' - cpu_kind = 'shared' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index fb7d43b..9453388 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -1,7 +1,7 @@ # fly.toml app configuration file generated for blog-app-frontend on 2024-11-06T13:37:30+01:00 # # See https://fly.io/docs/reference/configuration/ for information about how to use this file. - +# app = 'blog-app-frontend' primary_region = 'cdg' @@ -17,6 +17,7 @@ primary_region = 'cdg' processes = ['app'] [[vm]] + size = "shared-cpu-1x" memory = '512mb' cpu_kind = 'shared' cpus = 1 From f19566912c7ffda60d1c56f4c26ca5240cea53cc Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 10:06:24 +0100 Subject: [PATCH 10/17] jeez what the heck --- backend/fly.toml | 1 - frontend/fly.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/backend/fly.toml b/backend/fly.toml index 51a2cd9..54414de 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -17,6 +17,5 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - size = "shared-cpu-1x" memory = '512mb' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index 9453388..05afbaa 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -17,7 +17,6 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - size = "shared-cpu-1x" memory = '512mb' cpu_kind = 'shared' cpus = 1 From 9fc8f86e9930f6c21a05034fdc3db8dcb3e1b72f Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 10:11:12 +0100 Subject: [PATCH 11/17] changed reverted on PR --- .github/workflows/deploy-preview.yml | 2 +- backend/fly.toml | 2 ++ frontend/fly.toml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 0221595..f0eb15d 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -74,6 +74,6 @@ jobs: region: cdg memory: '512' cpukind: 'shared' - vmsize: 'shared-cpu-1x' + vmsize: 'shared-cpu-2x' path: ./backend secrets: DATABASE_URL=${{ env.DATABASE_URL }} \ No newline at end of file diff --git a/backend/fly.toml b/backend/fly.toml index 54414de..eabb84e 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -17,5 +17,7 @@ primary_region = 'cdg' processes = ['app'] [[vm]] + size = "shared-cpu-1x" memory = '512mb' + cpu_kind = 'shared' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index 05afbaa..9453388 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -17,6 +17,7 @@ primary_region = 'cdg' processes = ['app'] [[vm]] + size = "shared-cpu-1x" memory = '512mb' cpu_kind = 'shared' cpus = 1 From 87d2ec981c41b85a22a18b662fd13d8deddd5d17 Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 10:13:45 +0100 Subject: [PATCH 12/17] again and over --- .github/workflows/deploy-preview.yml | 2 +- backend/fly.toml | 1 - frontend/fly.toml | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index f0eb15d..0221595 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -74,6 +74,6 @@ jobs: region: cdg memory: '512' cpukind: 'shared' - vmsize: 'shared-cpu-2x' + vmsize: 'shared-cpu-1x' path: ./backend secrets: DATABASE_URL=${{ env.DATABASE_URL }} \ No newline at end of file diff --git a/backend/fly.toml b/backend/fly.toml index eabb84e..5e18ac5 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -17,7 +17,6 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - size = "shared-cpu-1x" memory = '512mb' cpu_kind = 'shared' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index 9453388..05afbaa 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -17,7 +17,6 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - size = "shared-cpu-1x" memory = '512mb' cpu_kind = 'shared' cpus = 1 From 0454c2cacc55bbee5df3e318340ce11a833aa82d Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 10:19:03 +0100 Subject: [PATCH 13/17] try the high availability on pr --- .github/workflows/deploy-preview.yml | 1 + backend/fly.toml | 1 + frontend/fly.toml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 0221595..4c14507 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -71,6 +71,7 @@ jobs: id: deploy uses: superfly/fly-pr-review-apps@1.3.0 with: + ha: 'true' region: cdg memory: '512' cpukind: 'shared' diff --git a/backend/fly.toml b/backend/fly.toml index 5e18ac5..eabb84e 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -17,6 +17,7 @@ primary_region = 'cdg' processes = ['app'] [[vm]] + size = "shared-cpu-1x" memory = '512mb' cpu_kind = 'shared' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index 05afbaa..9453388 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -17,6 +17,7 @@ primary_region = 'cdg' processes = ['app'] [[vm]] + size = "shared-cpu-1x" memory = '512mb' cpu_kind = 'shared' cpus = 1 From 2ad3d35c5241d817001cb7446f02885fa314d40b Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 10:23:26 +0100 Subject: [PATCH 14/17] heelya this is one ? --- .github/workflows/deploy-preview.yml | 2 +- backend/fly.toml | 1 - frontend/fly.toml | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 4c14507..080ffd6 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -74,7 +74,7 @@ jobs: ha: 'true' region: cdg memory: '512' - cpukind: 'shared' + cpukind: 'performance' vmsize: 'shared-cpu-1x' path: ./backend secrets: DATABASE_URL=${{ env.DATABASE_URL }} \ No newline at end of file diff --git a/backend/fly.toml b/backend/fly.toml index eabb84e..5e18ac5 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -17,7 +17,6 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - size = "shared-cpu-1x" memory = '512mb' cpu_kind = 'shared' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index 9453388..05afbaa 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -17,7 +17,6 @@ primary_region = 'cdg' processes = ['app'] [[vm]] - size = "shared-cpu-1x" memory = '512mb' cpu_kind = 'shared' cpus = 1 From 5e563d117215ba1940f85903dc98da7ff02f9fce Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 10:35:49 +0100 Subject: [PATCH 15/17] let's try this --- .github/workflows/deploy-preview.yml | 2 +- backend/fly.toml | 26 ++++++++++++++++++++++++++ frontend/fly.toml | 26 ++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 080ffd6..4c14507 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -74,7 +74,7 @@ jobs: ha: 'true' region: cdg memory: '512' - cpukind: 'performance' + cpukind: 'shared' vmsize: 'shared-cpu-1x' path: ./backend secrets: DATABASE_URL=${{ env.DATABASE_URL }} \ No newline at end of file diff --git a/backend/fly.toml b/backend/fly.toml index 5e18ac5..f1feb4f 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -16,6 +16,32 @@ primary_region = 'cdg' min_machines_running = 0 processes = ['app'] +[[services]] +http_checks = [] +internal_port = 80 +processes = ["app"] +protocol = "tcp" +script_checks = [] +[services.concurrency] +hard_limit = 25 +soft_limit = 20 +type = "connections" + +[[services.ports]] +force_https = true +handlers = ["http"] +port = 80 + +[[services.ports]] +handlers = ["tls", "http"] +port = 443 + +[[services.tcp_checks]] +grace_period = "1s" +interval = "15s" +restart_limit = 0 +timeout = "2s" + [[vm]] memory = '512mb' cpu_kind = 'shared' diff --git a/frontend/fly.toml b/frontend/fly.toml index 05afbaa..c8c3540 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -16,6 +16,32 @@ primary_region = 'cdg' min_machines_running = 0 processes = ['app'] +[[services]] +http_checks = [] +internal_port = 80 +processes = ["app"] +protocol = "tcp" +script_checks = [] +[services.concurrency] +hard_limit = 25 +soft_limit = 20 +type = "connections" + +[[services.ports]] +force_https = true +handlers = ["http"] +port = 80 + +[[services.ports]] +handlers = ["tls", "http"] +port = 443 + +[[services.tcp_checks]] +grace_period = "1s" +interval = "15s" +restart_limit = 0 +timeout = "2s" + [[vm]] memory = '512mb' cpu_kind = 'shared' From 905bd8db6fb5d98373e8f6059e0e0aae0d7c6be7 Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 10:44:49 +0100 Subject: [PATCH 16/17] no more shared 2x --- backend/fly.toml | 1 + frontend/fly.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/backend/fly.toml b/backend/fly.toml index f1feb4f..03361b4 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -43,6 +43,7 @@ restart_limit = 0 timeout = "2s" [[vm]] + size = 'shared-cpu-1x memory = '512mb' cpu_kind = 'shared' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index c8c3540..0b8bcd6 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -43,6 +43,7 @@ restart_limit = 0 timeout = "2s" [[vm]] + size = 'shared-cpu-1x memory = '512mb' cpu_kind = 'shared' cpus = 1 From ebddb7c2af48ac01d98e028e0742efbee69dfc4b Mon Sep 17 00:00:00 2001 From: Daniel Laera Date: Tue, 7 Jan 2025 10:46:53 +0100 Subject: [PATCH 17/17] fak ya! --- backend/fly.toml | 2 +- frontend/fly.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/fly.toml b/backend/fly.toml index 03361b4..0d21faa 100644 --- a/backend/fly.toml +++ b/backend/fly.toml @@ -43,7 +43,7 @@ restart_limit = 0 timeout = "2s" [[vm]] - size = 'shared-cpu-1x + size = 'shared-cpu-1x' memory = '512mb' cpu_kind = 'shared' cpus = 1 diff --git a/frontend/fly.toml b/frontend/fly.toml index 0b8bcd6..085e52c 100644 --- a/frontend/fly.toml +++ b/frontend/fly.toml @@ -43,7 +43,7 @@ restart_limit = 0 timeout = "2s" [[vm]] - size = 'shared-cpu-1x + size = 'shared-cpu-1x' memory = '512mb' cpu_kind = 'shared' cpus = 1