1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

3 Commits

8 changed files with 262 additions and 84 deletions

View File

@@ -2,7 +2,7 @@ source 'https://rubygems.org'
ruby '3.0.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '6.1.2'
gem 'rails', '6.1.3.1'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3', '~> 1.3', '< 1.4', :group => :development
gem 'sqlite3', :group => :development
@@ -38,7 +38,6 @@ gem 'spring', :group => :development
# Use debugger
# gem 'debugger', group: [:development, :test]
#Installed by me
group :production do
gem 'rails_12factor'
@@ -48,6 +47,7 @@ group :production do
gem 'dalli'
end
gem 'influxdb-rails'
gem 'devise'
gem 'cancancan'
gem 'round_robin_tournament'

View File

@@ -1,60 +1,60 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.2)
actionpack (= 6.1.2)
activesupport (= 6.1.2)
actioncable (6.1.3.1)
actionpack (= 6.1.3.1)
activesupport (= 6.1.3.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.2)
actionpack (= 6.1.2)
activejob (= 6.1.2)
activerecord (= 6.1.2)
activestorage (= 6.1.2)
activesupport (= 6.1.2)
actionmailbox (6.1.3.1)
actionpack (= 6.1.3.1)
activejob (= 6.1.3.1)
activerecord (= 6.1.3.1)
activestorage (= 6.1.3.1)
activesupport (= 6.1.3.1)
mail (>= 2.7.1)
actionmailer (6.1.2)
actionpack (= 6.1.2)
actionview (= 6.1.2)
activejob (= 6.1.2)
activesupport (= 6.1.2)
actionmailer (6.1.3.1)
actionpack (= 6.1.3.1)
actionview (= 6.1.3.1)
activejob (= 6.1.3.1)
activesupport (= 6.1.3.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.2)
actionview (= 6.1.2)
activesupport (= 6.1.2)
actionpack (6.1.3.1)
actionview (= 6.1.3.1)
activesupport (= 6.1.3.1)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.2)
actionpack (= 6.1.2)
activerecord (= 6.1.2)
activestorage (= 6.1.2)
activesupport (= 6.1.2)
actiontext (6.1.3.1)
actionpack (= 6.1.3.1)
activerecord (= 6.1.3.1)
activestorage (= 6.1.3.1)
activesupport (= 6.1.3.1)
nokogiri (>= 1.8.5)
actionview (6.1.2)
activesupport (= 6.1.2)
actionview (6.1.3.1)
activesupport (= 6.1.3.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.2)
activesupport (= 6.1.2)
activejob (6.1.3.1)
activesupport (= 6.1.3.1)
globalid (>= 0.3.6)
activemodel (6.1.2)
activesupport (= 6.1.2)
activerecord (6.1.2)
activemodel (= 6.1.2)
activesupport (= 6.1.2)
activestorage (6.1.2)
actionpack (= 6.1.2)
activejob (= 6.1.2)
activerecord (= 6.1.2)
activesupport (= 6.1.2)
marcel (~> 0.3.1)
mimemagic (~> 0.3.2)
activesupport (6.1.2)
activemodel (6.1.3.1)
activesupport (= 6.1.3.1)
activerecord (6.1.3.1)
activemodel (= 6.1.3.1)
activesupport (= 6.1.3.1)
activestorage (6.1.3.1)
actionpack (= 6.1.3.1)
activejob (= 6.1.3.1)
activerecord (= 6.1.3.1)
activesupport (= 6.1.3.1)
marcel (~> 1.0.0)
mini_mime (~> 1.0.2)
activesupport (6.1.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@@ -62,11 +62,11 @@ GEM
zeitwerk (~> 2.3)
addressable (2.4.0)
ast (2.4.2)
backports (3.20.2)
backports (3.21.0)
bcrypt (3.1.16)
brakeman (5.0.0)
builder (3.2.4)
bullet (6.1.3)
bullet (6.1.4)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
cancancan (3.2.1)
@@ -85,10 +85,10 @@ GEM
dalli (2.7.11)
delayed_job (4.1.9)
activesupport (>= 3.0, < 6.2)
delayed_job_active_record (4.1.5)
delayed_job_active_record (4.1.6)
activerecord (>= 3.0, < 6.2)
delayed_job (>= 3.0, < 5)
delayed_job_web (1.4.3)
delayed_job_web (1.4.4)
activerecord (> 3.0.0)
delayed_job (> 2.0.3)
rack-protection (>= 1.5.5)
@@ -109,7 +109,7 @@ GEM
multipart-post (>= 1.2, < 3)
faraday_middleware (0.14.0)
faraday (>= 0.7.4, < 1.0)
ffi (1.14.2)
ffi (1.15.0)
gh (0.15.1)
addressable (~> 2.4.0)
backports
@@ -132,8 +132,12 @@ GEM
http-accept (1.7.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
i18n (1.8.8)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
influxdb (0.8.1)
influxdb-rails (1.0.1)
influxdb (~> 0.6, >= 0.6.4)
railties (>= 5.0)
jbuilder (2.11.2)
activesupport (>= 5.0.0)
jquery-rails (4.4.0)
@@ -149,16 +153,14 @@ GEM
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
marcel (1.0.0)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.1104)
mimemagic (0.3.5)
mini_mime (1.0.2)
mime-types-data (3.2021.0225)
mini_mime (1.0.3)
mini_portile2 (2.5.0)
minitest (5.14.3)
minitest (5.14.4)
multi_json (1.15.0)
multipart-post (2.1.1)
mustermann (1.1.1)
@@ -168,18 +170,18 @@ GEM
net-http-pipeline (1.0.1)
netrc (0.11.0)
newrelic_rpm (6.15.0)
nio4r (2.5.5)
nokogiri (1.11.1)
nio4r (2.5.7)
nokogiri (1.11.2)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
orm_adapter (0.5.0)
parallel (1.20.1)
parser (3.0.0.0)
ast (~> 2.4.1)
passenger (6.0.7)
passenger (6.0.8)
rack
rake (>= 0.8.1)
puma (5.2.1)
puma (5.2.2)
nio4r (~> 2.0)
pusher-client (0.6.2)
json
@@ -190,20 +192,20 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.1.2)
actioncable (= 6.1.2)
actionmailbox (= 6.1.2)
actionmailer (= 6.1.2)
actionpack (= 6.1.2)
actiontext (= 6.1.2)
actionview (= 6.1.2)
activejob (= 6.1.2)
activemodel (= 6.1.2)
activerecord (= 6.1.2)
activestorage (= 6.1.2)
activesupport (= 6.1.2)
rails (6.1.3.1)
actioncable (= 6.1.3.1)
actionmailbox (= 6.1.3.1)
actionmailer (= 6.1.3.1)
actionpack (= 6.1.3.1)
actiontext (= 6.1.3.1)
actionview (= 6.1.3.1)
activejob (= 6.1.3.1)
activemodel (= 6.1.3.1)
activerecord (= 6.1.3.1)
activestorage (= 6.1.3.1)
activesupport (= 6.1.3.1)
bundler (>= 1.15.0)
railties (= 6.1.2)
railties (= 6.1.3.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
@@ -215,9 +217,9 @@ GEM
rails_stdout_logging
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (6.1.2)
actionpack (= 6.1.2)
activesupport (= 6.1.2)
railties (6.1.3.1)
actionpack (= 6.1.3.1)
activesupport (= 6.1.3.1)
method_source
rake (>= 0.8.7)
thor (~> 1.0)
@@ -226,7 +228,7 @@ GEM
rb-readline (0.5.5)
rdoc (6.3.0)
ref (2.0.0)
regexp_parser (2.0.3)
regexp_parser (2.1.1)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
@@ -237,7 +239,7 @@ GEM
netrc (~> 0.8)
rexml (3.2.4)
round_robin_tournament (0.1.1)
rubocop (1.9.1)
rubocop (1.12.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
@@ -250,7 +252,7 @@ GEM
parser (>= 2.7.1.5)
ruby-progressbar (1.11.0)
ruby2_keywords (0.0.4)
sdoc (2.0.3)
sdoc (2.1.0)
rdoc (>= 5.0)
sinatra (2.1.0)
mustermann (~> 1.0)
@@ -266,8 +268,7 @@ GEM
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
terminal-table (3.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
terminal-table (1.6.0)
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
@@ -296,8 +297,8 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
uniform_notifier (1.13.2)
unicode-display_width (2.0.0)
uniform_notifier (1.14.2)
warden (1.2.9)
rack (>= 2.0.9)
websocket (1.2.9)
@@ -320,13 +321,14 @@ DEPENDENCIES
delayed_job_web
devise
hakiri
influxdb-rails
jbuilder
jquery-rails
mysql2
newrelic_rpm
passenger
puma
rails (= 6.1.2)
rails (= 6.1.3.1)
rails_12factor
rb-readline
round_robin_tournament

View File

@@ -54,3 +54,8 @@ The production version of this is currently deployed in Kubernetes. See [Deployi
* `MEMCACHIER_SERVERS=memcachier_hostname:memcachier_port` needed for caching
* `MEMCACHIER_USERNAME=memcachier_username` needed for caching
* `WRESTLINGDEV_NEW_RELIC_LICENSE_KEY=new_relic_license_key` this is only needed to use new relic
* `WRESTLINGDEV_INFLUXDB_DATABASE=influx_db_name` to send metrics to influxdb this is required
* `WRESTLINGDEV_INFLUXDB_HOST=influx_db_ip_or_hostname` to send metrics to influxdb this is required
* `WRESTLINGDEV_INFLUXDB_PORT=influx_db_port` to send metrics to influxdb this is required
* `WRESTLINGDEV_INFLUXDB_USERNAME=influx_db_username` to send metrics to influxdb this is optional
* `WRESTLINGDEV_INFLUXDB_PASSWORD=influx_db_password` to send metrics to influxdb this is optional

View File

@@ -0,0 +1,45 @@
InfluxDB::Rails.configure do |config|
## The only setting you actually need to update is the name of the
## database within the InfluxDB server instance. Don't forget to
## create this database as well.
config.client.database = "#{ENV['WRESTLINGDEV_INFLUXDB_DATABASE']}"
config.client.hosts = ["#{ENV['WRESTLINGDEV_INFLUXDB_HOST']}"]
config.client.port = ENV['WRESTLINGDEV_INFLUXDB_PORT']
## If you've setup user authentication (and activated it in the server
## config), you need to configure the credentials here.
config.client.username = "#{ENV['WRESTLINGDEV_INFLUXDB_USERNAME']}"
config.client.password = "#{ENV['WRESTLINGDEV_INFLUXDB_PASSWORD']}"
## If your InfluxDB service requires an HTTPS connection then you can
## enable it here.
# config.client.use_ssl = true
## Various other client and connection options. These are used to create
## an `InfluxDB::Client` instance (i.e. `InfluxDB::Rails.client`).
##
## See docs for the influxdb gem for the canonical list of options:
## https://github.com/influxdata/influxdb-ruby#list-of-configuration-options
##
## These defaults for the influxdb-rails gem deviate from the default
## for the influxdb gem:
# config.client.async = true # false
# config.client.read_timeout = 30 # 300
# config.client.max_delay = 300 # 30
# config.client.time_precision = "ms" # "s"
## Prior to 1.0.0, this gem has written all data points in different
## measurements (the config options were named `series_name_for_*`).
## Since 1.0.0.beta3, we're now using a single measurements
# config.measurement_name = "rails"
## Disable rails framework hooks.
# config.ignored_hooks = ['sql.active_record', 'render_template.action_view']
# Modify tags on the fly.
# config.tags_middleware = ->(tags) { tags }
## Set the application name to something meaningful, by default we
## infer the app name from the Rails.application class name.
# config.application_name = Rails.application.class.parent_name
end

View File

@@ -2,6 +2,7 @@ version: "2.2"
networks:
database:
caching:
metrics:
volumes:
mysql:
@@ -23,9 +24,13 @@ services:
- MEMCACHIER_PASSWORD=
- WRESTLINGDEV_DEVISE_SECRET_KEY=2f29d49db6704377ba263f7cb9db085b386bcb301c0cd501126a674686ab1a109754071165b08cd72af03cec4642a4dd04361c994462254dd5d85e9594e8b9aa
- WRESTLINGDEV_SECRET_KEY_BASE=077cdbef5c2ccf22543fb17a67339f234306b7fa2e1e4463d851c444c10a5611829a2290b253da78339427f131571fac9a42c83d960b2d25ecc10a4a0a7ce1a2
- WRESTLINGDEV_INFLUXDB_DATABASE=wrestlingdev
- WRESTLINGDEV_INFLUXDB_HOST=influxdb
- WRESTLINGDEV_INFLUXDB_PORT=8086
networks:
database:
caching:
metrics:
restart: always
ports:
- "80:80"
@@ -58,16 +63,30 @@ services:
- MEMCACHIER_PASSWORD=
- WRESTLINGDEV_DEVISE_SECRET_KEY=2f29d49db6704377ba263f7cb9db085b386bcb301c0cd501126a674686ab1a109754071165b08cd72af03cec4642a4dd04361c994462254dd5d85e9594e8b9aa
- WRESTLINGDEV_SECRET_KEY_BASE=077cdbef5c2ccf22543fb17a67339f234306b7fa2e1e4463d851c444c10a5611829a2290b253da78339427f131571fac9a42c83d960b2d25ecc10a4a0a7ce1a2
- WRESTLINGDEV_INFLUXDB_DATABASE=wrestlingdev
- WRESTLINGDEV_INFLUXDB_HOST=influxdb
- WRESTLINGDEV_INFLUXDB_PORT=8086
networks:
database:
caching:
metrics:
restart: always
command: bundle exec bin/delayed_job -n 1 run
influxdb:
image: influxdb:1.8-alpine
environment:
- INFLUXDB_DB=wrestlingdev
ports:
- "8086:8086"
networks:
metrics:
volumes:
- influxdb:/var/lib/influxdb
memcached:
image: memcached:1.5
mem_limit: 64000000
restart: always
networks:
caching:
caching:

View File

@@ -0,0 +1,74 @@
---
apiVersion: v1
kind: Service
metadata:
name: wrestlingdev-influxdb
labels:
app: wrestlingdev
tier: metrics
spec:
ports:
- port: 8086
selector:
app: wrestlingdev
tier: metrics
clusterIP: None
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wrestlingdev-influxdb
labels:
app: wrestlingdev
tier: metrics
spec:
replicas: 1
selector:
matchLabels:
app: wrestlingdev
template:
metadata:
labels:
app: wrestlingdev
tier: metrics
spec:
containers:
- name: wrestlingdev-influxdb
image: influxdb:1.8-alpine
ports:
- containerPort: 8086
env:
- name: INFLUXDB_DB
valueFrom:
secretKeyRef:
name: wrestlingdev-secrets
key: influxdb_database
volumeMounts:
- name: wrestlingdev-influxdb-persistent-storage
mountPath: /var/lib/influxdb
resources:
limits:
cpu: "0.7"
memory: "512Mi"
requests:
memory: "128Mi"
cpu: "0.5"
volumes:
- name: wrestlingdev-influxdb-persistent-storage
persistentVolumeClaim:
claimName: wrestlingdev-influxdb-pv-claim
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wrestlingdev-influxdb-pv-claim
labels:
app: wrestlingdev
tier: metrics
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi

View File

@@ -81,6 +81,21 @@ spec:
secretKeyRef:
name: wrestlingdev-secrets
key: gmailemail
- name: WRESTLINGDEV_INFLUXDB_DATABASE
valueFrom:
secretKeyRef:
name: wrestlingdev-secrets
key: influxdb_database
- name: WRESTLINGDEV_INFLUXDB_HOST
valueFrom:
secretKeyRef:
name: wrestlingdev-secrets
key: influxdb_hostname
- name: WRESTLINGDEV_INFLUXDB_PORT
valueFrom:
secretKeyRef:
name: wrestlingdev-secrets
key: influxdb_port
resources:
limits:
cpu: "0.5"
@@ -187,6 +202,21 @@ spec:
secretKeyRef:
name: wrestlingdev-secrets
key: gmailemail
- name: WRESTLINGDEV_INFLUXDB_DATABASE
valueFrom:
secretKeyRef:
name: wrestlingdev-secrets
key: influxdb_database
- name: WRESTLINGDEV_INFLUXDB_HOST
valueFrom:
secretKeyRef:
name: wrestlingdev-secrets
key: influxdb_hostname
- name: WRESTLINGDEV_INFLUXDB_PORT
valueFrom:
secretKeyRef:
name: wrestlingdev-secrets
key: influxdb_port
command: ["bundle"]
args: ["exec", "bin/delayed_job", "-n", "1", "run"]
resources:

View File

@@ -11,4 +11,7 @@ stringData:
devisesecretkey: PUT_SECRET_HERE get from running rails secret
railssecretkey: PUT_SECRET_HERE get from running rails secret
emailpassword: PUT_EMAIL_PASSWORD_HERE
gmailemail: PUT EMAIL ADDRESS HERE
gmailemail: PUT EMAIL ADDRESS HERE
influxdb_database: PUT INFLUXDB DATABASE NAME HERE
influxdb_hostname: PUT INFLUXDB HOSTNAME OR IP HERE
influxdb_port: PUT INFLUXDB PORT HERE