From 195edad933306c2e537cbe86e7c44e9e1686bcaa Mon Sep 17 00:00:00 2001 From: Samnang Chhun Date: Thu, 9 Jan 2025 15:03:19 +0700 Subject: [PATCH] Remove coverband (#1694) --- Gemfile | 1 - Gemfile.lock | 7 ------ config/app_settings.yml | 1 - config/coverband.rb | 9 ------- config/initializers/coverband.rb | 1 - config/routes.rb | 1 - infrastructure/core/elasticache.tf | 30 ------------------------ infrastructure/core/outputs.tf | 8 ------- infrastructure/core/variables.tf | 8 ------- infrastructure/modules/scfm/ecs.tf | 6 ----- infrastructure/modules/scfm/variables.tf | 2 -- infrastructure/production/main.tf | 4 ---- infrastructure/staging/main.tf | 3 --- 13 files changed, 81 deletions(-) delete mode 100644 config/coverband.rb delete mode 100644 config/initializers/coverband.rb delete mode 100644 infrastructure/core/elasticache.tf diff --git a/Gemfile b/Gemfile index 35f57ff6c..44e062e99 100644 --- a/Gemfile +++ b/Gemfile @@ -29,7 +29,6 @@ gem "bitmask_attributes", github: "numerex/bitmask_attributes" gem "bootsnap", require: false gem "cocoon" gem "cssbundling-rails" -gem "coverband" gem "countries" gem "cursor_paginator" gem "devise" diff --git a/Gemfile.lock b/Gemfile.lock index ea40cf627..15de80f3d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -210,8 +210,6 @@ GEM connection_pool (2.4.1) countries (7.1.0) unaccent (~> 0.3) - coverband (6.1.4) - redis (>= 3.0) crack (1.0.0) bigdecimal rexml @@ -476,10 +474,6 @@ GEM ffi (~> 1.0) rdoc (6.9.1) psych (>= 4.0.0) - redis (5.3.0) - redis-client (>= 0.22.0) - redis-client (0.22.2) - connection_pool regexp_parser (2.10.0) reline (0.6.0) io-console (~> 0.5) @@ -636,7 +630,6 @@ DEPENDENCIES capybara cocoon countries - coverband cssbundling-rails cursor_paginator devise diff --git a/config/app_settings.yml b/config/app_settings.yml index e70e5d795..96c31526b 100644 --- a/config/app_settings.yml +++ b/config/app_settings.yml @@ -11,7 +11,6 @@ default: &default audio_bucket: <%= ENV.fetch("AUDIO_BUCKET", "audio.somleng.org") %> admin_username: "admin" admin_password: "password" - coverband_redis_url: "<%= ENV.fetch("COVERBAND_REDIS_URL", "redis://localhost:6379") %>" production: &production <<: *default diff --git a/config/coverband.rb b/config/coverband.rb deleted file mode 100644 index 12fc86f2f..000000000 --- a/config/coverband.rb +++ /dev/null @@ -1,9 +0,0 @@ -Coverband.configure do |config| - config.logger = Rails.logger - - # default false. button at the top of the web interface which clears all data - config.web_enable_clear = true - - # default false. Experimental support for routes usage tracking. - config.track_routes = true -end diff --git a/config/initializers/coverband.rb b/config/initializers/coverband.rb deleted file mode 100644 index 782792d71..000000000 --- a/config/initializers/coverband.rb +++ /dev/null @@ -1 +0,0 @@ -ENV["COVERBAND_PASSWORD"] = Rails.configuration.app_settings.fetch(:admin_password) diff --git a/config/routes.rb b/config/routes.rb index 7ba5a03f3..888e65cb9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,7 +18,6 @@ namespace :admin do mount(PgHero::Engine, at: "pghero") - mount Coverband::Reporters::Web.new, at: "coverage" end namespace "dashboard" do diff --git a/infrastructure/core/elasticache.tf b/infrastructure/core/elasticache.tf deleted file mode 100644 index d76270e6a..000000000 --- a/infrastructure/core/elasticache.tf +++ /dev/null @@ -1,30 +0,0 @@ -resource "aws_elasticache_subnet_group" "redis" { - name = "open-ews-redis" - subnet_ids = local.region.vpc.database_subnets -} - -resource "aws_security_group" "redis" { - name = "open-ews-redis" - vpc_id = local.region.vpc.vpc_id - - ingress { - from_port = "6379" - to_port = "6379" - protocol = "TCP" - self = true - } - - tags = { - Name = "open-ews-redis" - } -} - -resource "aws_elasticache_cluster" "redis" { - cluster_id = "open-ews-redis" - engine = "redis" - node_type = "cache.t4g.micro" - num_cache_nodes = 1 - subnet_group_name = aws_elasticache_subnet_group.redis.name - security_group_ids = [aws_security_group.redis.id] - auto_minor_version_upgrade = true -} diff --git a/infrastructure/core/outputs.tf b/infrastructure/core/outputs.tf index 4546f345f..8276b9509 100644 --- a/infrastructure/core/outputs.tf +++ b/infrastructure/core/outputs.tf @@ -10,11 +10,3 @@ output "rds_cluster" { value = module.rds_cluster sensitive = true } - -output "elasticache_redis_endpoint" { - value = aws_elasticache_cluster.redis.cache_nodes.0.address -} - -output "redis_security_group" { - value = aws_security_group.redis -} diff --git a/infrastructure/core/variables.tf b/infrastructure/core/variables.tf index 8ef14f011..7a8d0147d 100644 --- a/infrastructure/core/variables.tf +++ b/infrastructure/core/variables.tf @@ -2,14 +2,6 @@ variable "aws_region" { default = "ap-southeast-1" } -variable "redis_security_group_name" { - default = "somleng-redis" -} - -variable "redis_cluster_id" { - default = "somleng-redis" -} - locals { region = data.terraform_remote_state.core_infrastructure.outputs.hydrogen_region } diff --git a/infrastructure/modules/scfm/ecs.tf b/infrastructure/modules/scfm/ecs.tf index b73692418..d1ec65bc7 100644 --- a/infrastructure/modules/scfm/ecs.tf +++ b/infrastructure/modules/scfm/ecs.tf @@ -77,10 +77,6 @@ locals { { name = "AUDIO_BUCKET", value = aws_s3_bucket.audio.id - }, - { - name = "COVERBAND_REDIS_URL", - value = var.redis_url } ] @@ -187,7 +183,6 @@ resource "aws_ecs_service" "webserver" { security_groups = [ aws_security_group.webserver.id, var.rds_cluster.security_group.id, - var.redis_security_group ] } @@ -268,7 +263,6 @@ resource "aws_ecs_service" "worker" { security_groups = [ aws_security_group.worker.id, var.rds_cluster.security_group.id, - var.redis_security_group ] } diff --git a/infrastructure/modules/scfm/variables.tf b/infrastructure/modules/scfm/variables.tf index 5a83bce6d..4828df320 100644 --- a/infrastructure/modules/scfm/variables.tf +++ b/infrastructure/modules/scfm/variables.tf @@ -14,8 +14,6 @@ variable "cdn_certificate" {} variable "region" {} variable "global_accelerator" {} variable "rds_cluster" {} -variable "redis_security_group" {} -variable "redis_url" {} variable "webserver_container_port" { default = 80 diff --git a/infrastructure/production/main.tf b/infrastructure/production/main.tf index 0f29a117b..e9d212e69 100644 --- a/infrastructure/production/main.tf +++ b/infrastructure/production/main.tf @@ -20,8 +20,4 @@ module "scfm" { db_name = "scfm" worker_min_tasks = 1 worker_max_tasks = 10 - - redis_security_group = data.terraform_remote_state.core.outputs.redis_security_group.id - redis_url = "redis://${data.terraform_remote_state.core.outputs.elasticache_redis_endpoint}/0" - } diff --git a/infrastructure/staging/main.tf b/infrastructure/staging/main.tf index ac04d4682..56f13ce17 100644 --- a/infrastructure/staging/main.tf +++ b/infrastructure/staging/main.tf @@ -22,7 +22,4 @@ module "scfm" { webserver_max_tasks = 0 worker_min_tasks = 0 worker_max_tasks = 0 - - redis_security_group = data.terraform_remote_state.core.outputs.redis_security_group.id - redis_url = "redis://${data.terraform_remote_state.core.outputs.elasticache_redis_endpoint}/1" }