Merge branch '490-enable-puma-by-default-in-GDK' into 'master'

Enable puma by default in GDK

Closes gitlab-development-kit#490

See merge request gitlab-org/gitlab-ce!30285
parents 04bcbaa5 b7ea4bd8
Pipeline #70510878 passed with stages
in 62 minutes and 49 seconds
#!/bin/sh
set -e
cd $(dirname $0)/..
app_root=$(pwd)
# Switch to experimental PUMA configuration
if [ -n "${EXPERIMENTAL_PUMA}" ]; then
case "$USE_WEB_SERVER" in
puma|"") # and the "" defines default
exec bin/web_puma "$@"
fi
unicorn_pidfile="$app_root/tmp/pids/unicorn.pid"
unicorn_config="$app_root/config/unicorn.rb"
unicorn_cmd="bundle exec unicorn_rails -c $unicorn_config -E $RAILS_ENV"
get_unicorn_pid()
{
local pid=$(cat $unicorn_pidfile)
if [ -z "$pid" ] ; then
echo "Could not find a PID in $unicorn_pidfile"
exit 1
fi
unicorn_pid=$pid
}
start()
{
exec $unicorn_cmd -D
}
start_foreground()
{
exec $unicorn_cmd
}
stop()
{
get_unicorn_pid
kill -QUIT $unicorn_pid
}
reload()
{
get_unicorn_pid
kill -USR2 $unicorn_pid
}
case "$1" in
start)
start
;;
start_foreground)
start_foreground
;;
stop)
stop
;;
reload)
reload
unicorn)
exec bin/web_unicorn "$@"
;;
*)
echo "Usage: RAILS_ENV=your_env $0 {start|stop|reload}"
echo "Unkown web server used by USE_WEB_SERVER: $USE_WEB_SERVER."
exit 1
;;
esac
#!/bin/sh
cd $(dirname $0)/..
app_root=$(pwd)
unicorn_pidfile="$app_root/tmp/pids/unicorn.pid"
unicorn_config="$app_root/config/unicorn.rb"
unicorn_cmd="bundle exec unicorn_rails -c $unicorn_config -E $RAILS_ENV"
get_unicorn_pid()
{
local pid=$(cat $unicorn_pidfile)
if [ -z "$pid" ] ; then
echo "Could not find a PID in $unicorn_pidfile"
exit 1
fi
unicorn_pid=$pid
}
start()
{
exec $unicorn_cmd -D
}
start_foreground()
{
exec $unicorn_cmd
}
stop()
{
get_unicorn_pid
kill -QUIT $unicorn_pid
}
reload()
{
get_unicorn_pid
kill -USR2 $unicorn_pid
}
case "$1" in
start)
start
;;
start_foreground)
start_foreground
;;
stop)
stop
;;
reload)
reload
;;
*)
echo "Usage: RAILS_ENV=your_env $0 {start|stop|reload}"
;;
esac
......@@ -14,8 +14,8 @@ if defined?(::Puma) && !Rails.env.test?
Gitlab::Application.configure do |config|
config.middleware.insert_before(Rack::Runtime, Rack::Timeout,
service_timeout: 60,
wait_timeout: 90)
service_timeout: ENV.fetch('GITLAB_RAILS_RACK_TIMEOUT', 60).to_i,
wait_timeout: ENV.fetch('GITLAB_RAILS_WAIT_TIMEOUT', 90).to_i)
end
observer = Gitlab::Cluster::RackTimeoutObserver.new
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment