Skip to content

A platform for community discussion. Free, open, simple.

DEV: Move puma to test-only dependency (#38652)

Alan Guo Xiang Tan0303bf599e48
diff --git a/Gemfile b/Gemfile
index ebf9beccf85..1b2f247ec5d 100644
--- a/Gemfile
+++ b/Gemfile
@@ -127,6 +127,7 @@ group :test do
gem "rails-dom-testing", require: false
gem "minio_runner", require: false
gem "capybara-playwright-driver"
+ gem "puma", require: false
end
group :test, :development do
@@ -193,7 +194,6 @@ gem "htmlentities", require: false
gem "rack-mini-profiler", require: ["enable_rails_patches"]
gem "unicorn", require: false, platform: :ruby
-gem "puma", require: false
gem "pitchfork", require: false
gem "rbtrace", require: false, platform: :mri
diff --git a/bin/docker/boot_dev b/bin/docker/boot_dev
index 0e9c5ce7d5d..bcef680d915 100755
--- a/bin/docker/boot_dev
+++ b/bin/docker/boot_dev
@@ -85,7 +85,6 @@ done
[[ ! -z "$mount_plugin_symlinks" ]] && echo "Mounting symlinks for plugins: ${mount_plugin_symlinks}"
# 8025 mailhog
-# 3000 puma... if you must (but unicorn is preferred)
# 9292 unicorn
# 9405 prometheus exporter
diff --git a/config/discourse.pill.sample b/config/discourse.pill.sample
index fdf9c24f7d3..ce11ef36107 100644
--- a/config/discourse.pill.sample
+++ b/config/discourse.pill.sample
@@ -86,27 +86,6 @@ Bluepill.application("discourse", :base_dir => ENV["HOME"] + '/.bluepill') do |a
end
end
- # You can use Puma as WebServer as well, please use the scripts below.
- #app.process("puma") do |process|
- # process.start_command = "puma -e production -C #{rails_root}/config/puma.rb"
- #
- # # Puma's Setting file is located in config/puma.rb, if you want to edit them, go to puma.rb.
- # # the upstream section in the nginx config to match.
- # # The nginx.sample.conf file assumes you're using sockets.
- #
- # process.pid_file = "#{rails_root}/tmp/pids/puma.pid"
- # process.start_grace_time = 30.seconds
- # process.stop_grace_time = 10.seconds
- # process.restart_grace_time = 10.seconds
- # process.group = "pumas"
- # process.uid = user
- # process.gid = group
- # process.daemonize = false
- # process.stdout = process.stderr = "#{rails_root}/log/puma.log"
- # # Thanks to: http://www.garrensmith.com/2012/09/24/Staying-up-with-Unicorn-Upstart-Bluepill.html
- # # If the amount of memory is exceeded 3 times out of 5, restart
- # process.checks :mem_usage, :every => 1.minutes, :below => 750.megabytes, :times => [3, 5]
- #end
#debug instance
# app.process("thin-debug") do |process|
diff --git a/config/environments/development.rb b/config/environments/development.rb
index e60babb8c27..3c45fa8c05d 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -81,7 +81,7 @@ Discourse::Application.configure do
end
if ENV["DISCOURSE_SKIP_CSS_WATCHER"] != "1" &&
- (defined?(Rails::Server) || defined?(Puma) || defined?(Unicorn) || defined?(Pitchfork))
+ (defined?(Rails::Server) || defined?(Unicorn) || defined?(Pitchfork))
require "stylesheet/watcher"
STDERR.puts "Starting CSS change watcher"
@watcher = Stylesheet::Watcher.watch
diff --git a/config/puma.rb b/config/puma.rb
deleted file mode 100644
index c349148f57b..00000000000
--- a/config/puma.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-if ENV["RAILS_ENV"] == "production"
- # First, you need to change these below to your situation.
- APP_ROOT = ENV["APP_ROOT"] || "/home/discourse/discourse"
- num_workers = ENV["NUM_WEBS"].to_i > 0 ? ENV["NUM_WEBS"].to_i : 4
-
- # Second, you can choose how many threads that you are going to run at same time.
- workers "#{num_workers}"
- threads 8, 32
-
- # Unless you know what you are changing, do not change them.
- bind "unix://#{APP_ROOT}/tmp/sockets/puma.sock"
- stdout_redirect "#{APP_ROOT}/log/puma.log", "#{APP_ROOT}/log/puma.err.log"
- pidfile "#{APP_ROOT}/tmp/pids/puma.pid"
- state_path "#{APP_ROOT}/tmp/pids/puma.state"
- preload_app!
-end