Switch gitlab internal webserver to puma.

Gitlab switched with version 13.0 to puma as default.

PR:		247564
This commit is contained in:
Matthias Fechner 2020-08-11 14:15:00 +00:00
parent 615fadcde7
commit 711b0fc2f2
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=544686
7 changed files with 56 additions and 6 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= gitlab-ce
PORTVERSION= 13.2.3
PORTREVISION= 0
PORTREVISION= 1
CATEGORIES= www devel
MAINTAINER= mfechner@FreeBSD.org

View File

@ -49,7 +49,7 @@ load_rc_config $name
### Environment variables
RAILS_ENV=${RAILS_ENV:-'production'}
SIDEKIQ_WORKERS=${SIDEKIQ_WORKERS:-1}
USE_WEB_SERVER=${USE_WEB_SERVER:-'unicorn'}
USE_WEB_SERVER=${USE_WEB_SERVER:-'puma'}
case "${USE_WEB_SERVER}" in
puma|unicorn)

View File

@ -0,0 +1,11 @@
--- bin/actioncable.orig 2020-08-11 09:44:44 UTC
+++ bin/actioncable
@@ -10,7 +10,7 @@ puma_config="$app_root/config/puma_actioncable.rb"
spawn_puma()
{
- exec bundle exec puma --config "${puma_config}" --environment "$RAILS_ENV" "$@"
+ exec bundle exec gpuma --config "${puma_config}" --environment "$RAILS_ENV" "$@"
}
get_puma_pid()

View File

@ -0,0 +1,11 @@
--- bin/web_puma.orig 2020-08-11 09:44:03 UTC
+++ bin/web_puma
@@ -10,7 +10,7 @@ puma_config="$app_root/config/puma.rb"
spawn_puma()
{
- exec bundle exec puma --config "${puma_config}" --environment "$RAILS_ENV" "$@"
+ exec bundle exec gpuma --config "${puma_config}" --environment "$RAILS_ENV" "$@"
}
get_puma_pid()

View File

@ -1,4 +1,4 @@
--- config/puma.rb.example.orig 2019-08-17 12:35:36 UTC
--- config/puma.rb.example.orig 2020-08-05 09:54:00 UTC
+++ config/puma.rb.example
@@ -5,11 +5,11 @@
# The default is "config.ru".
@ -32,3 +32,16 @@
on_restart do
# Signal application hooks that we're about to restart
@@ -70,9 +70,9 @@ tag 'gitlab-puma-worker'
worker_timeout 60
# Use json formatter
-require_relative "/home/git/gitlab/lib/gitlab/puma_logging/json_formatter"
+require_relative "%%PREFIX%%/www/gitlab-ce/lib/gitlab/puma_logging/json_formatter"
json_formatter = Gitlab::PumaLogging::JSONFormatter.new
log_formatter do |str|
json_formatter.call(str)
-end
\ No newline at end of file
+end

View File

@ -3,6 +3,7 @@
PORTNAME= gitlab-puma
DISTVERSION= 4.3.3.gitlab.2
PORTREVISION= 1
CATEGORIES= www rubygems
MASTER_SITES= RG
@ -22,8 +23,8 @@ PLIST_FILES= bin/gpuma bin/gpumactl
SHEBANG_FILES= tools/jungle/init.d/run-puma
post-install:
${MV} ${STAGEDIR}${PREFIX}/bin/puma ${STAGEDIR}${PREFIX}/bin/gpuma
${MV} ${STAGEDIR}${PREFIX}/bin/pumactl ${STAGEDIR}${PREFIX}/bin/gpumactl
post-patch:
${MV} ${WRKSRC}/bin/puma ${WRKSRC}/bin/gpuma
${MV} ${WRKSRC}/bin/pumactl ${WRKSRC}/bin/gpumactl
.include <bsd.port.mk>

View File

@ -0,0 +1,14 @@
--- gitlab-puma.gemspec.orig 2020-08-11 09:30:41 UTC
+++ gitlab-puma.gemspec
@@ -13,9 +13,9 @@ Gem::Specification.new do |s|
s.date = "2020-03-04"
s.description = "Puma is a simple, fast, threaded, and highly concurrent HTTP 1.1 server for Ruby/Rack applications. Puma is intended for use in both development and production environments. It's great for highly concurrent Ruby implementations such as Rubinius and JRuby as well as as providing process worker support to support CRuby well.".freeze
s.email = ["kamil@gitlab.com".freeze, "evan@phx.io".freeze]
- s.executables = ["puma".freeze, "pumactl".freeze]
+ s.executables = ["gpuma".freeze, "gpumactl".freeze]
s.extensions = ["ext/puma_http11/extconf.rb".freeze]
- s.files = ["History.md".freeze, "LICENSE".freeze, "README.md".freeze, "bin/puma".freeze, "bin/puma-wild".freeze, "bin/pumactl".freeze, "docs/architecture.md".freeze, "docs/deployment.md".freeze, "docs/images/puma-connection-flow-no-reactor.png".freeze, "docs/images/puma-connection-flow.png".freeze, "docs/images/puma-general-arch.png".freeze, "docs/nginx.md".freeze, "docs/plugins.md".freeze, "docs/restart.md".freeze, "docs/signals.md".freeze, "docs/systemd.md".freeze, "docs/tcp_mode.md".freeze, "ext/puma_http11/PumaHttp11Service.java".freeze, "ext/puma_http11/ext_help.h".freeze, "ext/puma_http11/extconf.rb".freeze, "ext/puma_http11/http11_parser.c".freeze, "ext/puma_http11/http11_parser.h".freeze, "ext/puma_http11/http11_parser.java.rl".freeze, "ext/puma_http11/http11_parser.rl".freeze, "ext/puma_http11/http11_parser_common.rl".freeze, "ext/puma_http11/io_buffer.c".freeze, "ext/puma_http11/mini_ssl.c".freeze, "ext/puma_http11/org/jruby/puma/Http11.java".freeze, "ext/puma_http11/org/jruby/puma/Http11Parser.java".freeze, "ext/puma_http11/org/jruby/puma/IOBuffer.java".freeze, "ext/puma_http11/org/jruby/puma/MiniSSL.java".freeze, "ext/puma_http11/puma_http11.c".freeze, "lib/puma.rb".freeze, "lib/puma/accept_nonblock.rb".freeze, "lib/puma/app/status.rb".freeze, "lib/puma/binder.rb".freeze, "lib/puma/cli.rb".freeze, "lib/puma/client.rb".freeze, "lib/puma/cluster.rb".freeze, "lib/puma/commonlogger.rb".freeze, "lib/puma/configuration.rb".freeze, "lib/puma/const.rb".freeze, "lib/puma/control_cli.rb".freeze, "lib/puma/detect.rb".freeze, "lib/puma/dsl.rb".freeze, "lib/puma/events.rb".freeze, "lib/puma/io_buffer.rb".freeze, "lib/puma/jruby_restart.rb".freeze, "lib/puma/launcher.rb".freeze, "lib/puma/minissl.rb".freeze, "lib/puma/minissl/context_builder.rb".freeze, "lib/puma/null_io.rb".freeze, "lib/puma/plugin.rb".freeze, "lib/puma/plugin/tmp_restart.rb".freeze, "lib/puma/rack/builder.rb".freeze, "lib/puma/rack/urlmap.rb".freeze, "lib/puma/rack_default.rb".freeze, "lib/puma/reactor.rb".freeze, "lib/puma/runner.rb".freeze, "lib/puma/server.rb".freeze, "lib/puma/single.rb".freeze, "lib/puma/state_file.rb".freeze, "lib/puma/tcp_logger.rb".freeze, "lib/puma/thread_pool.rb".freeze, "lib/puma/util.rb".freeze, "lib/rack/handler/puma.rb".freeze, "tools/docker/Dockerfile".freeze, "tools/jungle/README.md".freeze, "tools/jungle/init.d/README.md".freeze, "tools/jungle/init.d/puma".freeze, "tools/jungle/init.d/run-puma".freeze, "tools/jungle/rc.d/README.md".freeze, "tools/jungle/rc.d/puma".freeze, "tools/jungle/rc.d/puma.conf".freeze, "tools/jungle/upstart/README.md".freeze, "tools/jungle/upstart/puma-manager.conf".freeze, "tools/jungle/upstart/puma.conf".freeze, "tools/trickletest.rb".freeze]
+ s.files = ["History.md".freeze, "LICENSE".freeze, "README.md".freeze, "bin/gpuma".freeze, "bin/puma-wild".freeze, "bin/gpumactl".freeze, "docs/architecture.md".freeze, "docs/deployment.md".freeze, "docs/images/puma-connection-flow-no-reactor.png".freeze, "docs/images/puma-connection-flow.png".freeze, "docs/images/puma-general-arch.png".freeze, "docs/nginx.md".freeze, "docs/plugins.md".freeze, "docs/restart.md".freeze, "docs/signals.md".freeze, "docs/systemd.md".freeze, "docs/tcp_mode.md".freeze, "ext/puma_http11/PumaHttp11Service.java".freeze, "ext/puma_http11/ext_help.h".freeze, "ext/puma_http11/extconf.rb".freeze, "ext/puma_http11/http11_parser.c".freeze, "ext/puma_http11/http11_parser.h".freeze, "ext/puma_http11/http11_parser.java.rl".freeze, "ext/puma_http11/http11_parser.rl".freeze, "ext/puma_http11/http11_parser_common.rl".freeze, "ext/puma_http11/io_buffer.c".freeze, "ext/puma_http11/mini_ssl.c".freeze, "ext/puma_http11/org/jruby/puma/Http11.java".freeze, "ext/puma_http11/org/jruby/puma/Http11Parser.java".freeze, "ext/puma_http11/org/jruby/puma/IOBuffer.java".freeze, "ext/puma_http11/org/jruby/puma/MiniSSL.java".freeze, "ext/puma_http11/puma_http11.c".freeze, "lib/puma.rb".freeze, "lib/puma/accept_nonblock.rb".freeze, "lib/puma/app/status.rb".freeze, "lib/puma/binder.rb".freeze, "lib/puma/cli.rb".freeze, "lib/puma/client.rb".freeze, "lib/puma/cluster.rb".freeze, "lib/puma/commonlogger.rb".freeze, "lib/puma/configuration.rb".freeze, "lib/puma/const.rb".freeze, "lib/puma/control_cli.rb".freeze, "lib/puma/detect.rb".freeze, "lib/puma/dsl.rb".freeze, "lib/puma/events.rb".freeze, "lib/puma/io_buffer.rb".freeze, "lib/puma/jruby_restart.rb".freeze, "lib/puma/launcher.rb".freeze, "lib/puma/minissl.rb".freeze, "lib/puma/minissl/context_builder.rb".freeze, "lib/puma/null_io.rb".freeze, "lib/puma/plugin.rb".freeze, "lib/puma/plugin/tmp_restart.rb".freeze, "lib/puma/rack/builder.rb".freeze, "lib/puma/rack/urlmap.rb".freeze, "lib/puma/rack_default.rb".freeze, "lib/puma/reactor.rb".freeze, "lib/puma/runner.rb".freeze, "lib/puma/server.rb".freeze, "lib/puma/single.rb".freeze, "lib/puma/state_file.rb".freeze, "lib/puma/tcp_logger.rb".freeze, "lib/puma/thread_pool.rb".freeze, "lib/puma/util.rb".freeze, "lib/rack/handler/puma.rb".freeze, "tools/docker/Dockerfile".freeze, "tools/jungle/README.md".freeze, "tools/jungle/init.d/README.md".freeze, "tools/jungle/init.d/puma".freeze, "tools/jungle/init.d/run-puma".freeze, "tools/jungle/rc.d/README.md".freeze, "tools/jungle/rc.d/puma".freeze, "tools/jungle/rc.d/puma.conf".freeze, "tools/jungle/upstart/README.md".freeze, "tools/jungle/upstart/puma-manager.conf".freeze, "tools/jungle/upstart/puma.conf".freeze, "tools/trickletest.rb".freeze]
s.homepage = "https://gitlab.com/gitlab-org/gitlab-puma".freeze
s.licenses = ["BSD-3-Clause".freeze]
s.required_ruby_version = Gem::Requirement.new(">= 2.2".freeze)