tpt-rails 1.4.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/generators/tpt/rails/configuration/configuration_generator.rb +1 -1
- data/lib/generators/tpt/rails/configuration/templates/config/puma.rb +52 -0
- data/lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/templates/deployment.yaml.tt +1 -1
- data/lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/templates/service.yaml.tt +1 -0
- data/lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/values.prod.yaml.tt +2 -0
- data/lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/values.staging.yaml.tt +2 -0
- data/lib/tpt/rails/internal/error_reporter.rb +1 -1
- data/lib/tpt/rails/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 186ac4371bdca9ada2a7d9b56af210cb801eb8be69f7f52ef61f88bc9c3456e2
|
4
|
+
data.tar.gz: ce8c4ad020f1fc1fc148f0b94ea1f0267f5578137f56207a863bcc1543bb5b03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e038cdd076adedf6e8fa84c18fae51e1640d8be70b00e507e03ce56503138c18c3ebaf583935fd418a23b1ce3c1dcd50d7978a54dd28fff78ba46af26b4d0d3
|
7
|
+
data.tar.gz: 17e293fcb6566795d5d220e68dcff771b5b69c4bcc6985514aeb523f3175e195350abb538121589435b50037f749efbe4149e3a95e800a0ec54c6c38d80a97a0
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# Puma can serve each request in a thread from an internal thread pool.
|
2
|
+
# The `threads` method setting takes two numbers: a minimum and maximum.
|
3
|
+
# Any libraries that use thread pools should be configured to match
|
4
|
+
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
5
|
+
# and maximum; this matches the default thread size of Active Record.
|
6
|
+
#
|
7
|
+
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
|
8
|
+
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
|
9
|
+
threads min_threads_count, max_threads_count
|
10
|
+
|
11
|
+
# Specifies the `worker_timeout` threshold that Puma will use to wait before
|
12
|
+
# terminating a worker in development environments.
|
13
|
+
#
|
14
|
+
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
|
15
|
+
|
16
|
+
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
17
|
+
#
|
18
|
+
port ENV.fetch("PORT") { 3000 }
|
19
|
+
|
20
|
+
# Specifies the `environment` that Puma will run in.
|
21
|
+
#
|
22
|
+
environment ENV.fetch("RAILS_ENV") { "development" }
|
23
|
+
|
24
|
+
# Specifies the `pidfile` that Puma will use.
|
25
|
+
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
|
26
|
+
|
27
|
+
before_fork do
|
28
|
+
Tpt::Rails::PumaStatsCollector.run(metrics_client: Tpt::Rails.statsd)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Specifies the number of `workers` to boot in clustered mode.
|
32
|
+
# Workers are forked web server processes. If using threads and workers together
|
33
|
+
# the concurrency of the application would be max `threads` * `workers`.
|
34
|
+
# Workers do not work on JRuby or Windows (both of which do not support
|
35
|
+
# processes).
|
36
|
+
|
37
|
+
workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
38
|
+
|
39
|
+
on_worker_boot do
|
40
|
+
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
|
41
|
+
ActiveRecord::Base.establish_connection
|
42
|
+
end
|
43
|
+
|
44
|
+
# Use the `preload_app!` method when specifying a `workers` number.
|
45
|
+
# This directive tells Puma to first boot the application and load code
|
46
|
+
# before forking the application. This takes advantage of Copy On Write
|
47
|
+
# process behavior so workers use less memory.
|
48
|
+
|
49
|
+
preload_app!
|
50
|
+
|
51
|
+
# Allow puma to be restarted by `rails restart` command.
|
52
|
+
plugin :tmp_restart
|
data/lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/templates/deployment.yaml.tt
CHANGED
@@ -39,7 +39,7 @@ spec:
|
|
39
39
|
tpt/creator: {{ .Values.annotations.creator | default "UNKNOWN" | quote }}
|
40
40
|
annotations:
|
41
41
|
buildID: "{{ .Values.buildID }}"
|
42
|
-
sidecar.istio.io/inject: "
|
42
|
+
sidecar.istio.io/inject: "false"
|
43
43
|
spec:
|
44
44
|
# Specifies where our Kube secrets are coming from
|
45
45
|
imagePullSecrets:
|
data/lib/generators/tpt/rails/kubernetes/templates/kubernetes/helm/templates/service.yaml.tt
CHANGED
@@ -36,6 +36,7 @@ metadata:
|
|
36
36
|
- request_label:
|
37
37
|
- frontend
|
38
38
|
{{- if eq .Values.service.type "LoadBalancer" }}
|
39
|
+
external-dns.alpha.kubernetes.io/hostname: {{ .Values.hostname }}
|
39
40
|
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "http"
|
40
41
|
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
|
41
42
|
service.beta.kubernetes.io/aws-load-balancer-internal: "0.0.0.0/0"
|
@@ -55,7 +55,7 @@ class Tpt::Rails::Internal::ErrorReporter # :nodoc:
|
|
55
55
|
|
56
56
|
def configure_rollbar
|
57
57
|
# Ensure that rollbar has been added to the app's Gemfile
|
58
|
-
gem 'rollbar', '>= 2.23.2', '<
|
58
|
+
gem 'rollbar', '>= 2.23.2', '< 4'
|
59
59
|
|
60
60
|
Rollbar.configure do |config|
|
61
61
|
config.access_token = @rollbar_access_token
|
data/lib/tpt/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tpt-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TpT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- config/routes.rb
|
94
94
|
- lib/generators/tpt/rails/configuration/configuration_generator.rb
|
95
95
|
- lib/generators/tpt/rails/configuration/templates/config/initializers/tpt_rails.rb
|
96
|
+
- lib/generators/tpt/rails/configuration/templates/config/puma.rb
|
96
97
|
- lib/generators/tpt/rails/continuous_integration/continuous_integration_generator.rb
|
97
98
|
- lib/generators/tpt/rails/continuous_integration/templates/ci/Dockerfile.tt
|
98
99
|
- lib/generators/tpt/rails/continuous_integration/templates/ci/docker-compose.yaml.tt
|