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

Updated passenger pools for test deploy and moved workers to statefulsets in production

This commit is contained in:
2022-08-15 23:26:44 +00:00
parent 9c5ac6c1aa
commit 05acebbf5b
3 changed files with 14 additions and 9 deletions

View File

@@ -42,6 +42,15 @@ To run a single test inside a file:
1. Get a shell with ruby and rails: `bash bin/rails-dev-run.sh wrestlingdev-development` 1. Get a shell with ruby and rails: `bash bin/rails-dev-run.sh wrestlingdev-development`
2. `rake test TEST=test/models/match_test.rb TESTOPTS="--name='/test_Match_should_not_be_valid_if_an_incorrect_win_type_is_given/'"` 2. `rake test TEST=test/models/match_test.rb TESTOPTS="--name='/test_Match_should_not_be_valid_if_an_incorrect_win_type_is_given/'"`
## Update gems
1. `bash bin/run-rails-dev.sh wrestlingdev-dev` to open a contianer with a rails shell available
2. `bundle config --delete without` to remove the bundle config that ignores production gems
3. `bundle update`
Note: If updating rails, do not change the version in `Gemfile` until after you run `bash bin/run-rails-dev.sh wrestlingdev-dev`. Creating the container will fail due to a mismatch in Gemfile and Gemfile.lock.
Then run `rails app:update` to update rails.
# Deployment # Deployment
The production version of this is currently deployed in Kubernetes. See [Deploying with Kubernetes](deploy/kubernetes/README.md) The production version of this is currently deployed in Kubernetes. See [Deploying with Kubernetes](deploy/kubernetes/README.md)

View File

@@ -4,8 +4,8 @@ RAM_KB=$(grep MemTotal /proc/meminfo | awk '{print $2}')
RAM_MB=$(expr $RAM_KB / 1024) RAM_MB=$(expr $RAM_KB / 1024)
RAM_GB=$(expr $RAM_MB / 1024) RAM_GB=$(expr $RAM_MB / 1024)
RAM_WITHOUT_OTHER_SERVICES=$(expr $RAM_MB - 1024) # other services use ~1024MB of RAM RAM_WITHOUT_OTHER_SERVICES=$(expr $RAM_MB - 1024) # other services use ~1024MB of RAM
PASSENGER_POOL_FACTOR=$(expr $RAM_WITHOUT_OTHER_SERVICES / 256) # 2 pool workers use ~256MB of RAM PASSENGER_POOL_FACTOR=$(expr $RAM_WITHOUT_OTHER_SERVICES / 256) # 1 pool worker uses ~256MB of RAM
export PASSENGER_POOL_SIZE=$(expr $PASSENGER_POOL_FACTOR '*' 2) export PASSENGER_POOL_SIZE=$(expr $PASSENGER_POOL_FACTOR '*' 1)
#docker build -t wrestlingdev:test -f ${project_dir}/deploy/rails-prod-Dockerfile ${project_dir} #docker build -t wrestlingdev:test -f ${project_dir}/deploy/rails-prod-Dockerfile ${project_dir}
docker-compose -f ${project_dir}/deploy/docker-compose-test.yml kill docker-compose -f ${project_dir}/deploy/docker-compose-test.yml kill

View File

@@ -134,9 +134,9 @@ spec:
# targetAverageValue: 100Mi # targetAverageValue: 100Mi
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: StatefulSet
metadata: metadata:
name: wrestlingdev-worker-deployment name: wrestlingdev-worker
labels: labels:
app: wrestlingdev app: wrestlingdev
spec: spec:
@@ -144,6 +144,7 @@ spec:
selector: selector:
matchLabels: matchLabels:
app: wrestlingdev app: wrestlingdev
serviceName: wrestlingdev-worker
template: template:
metadata: metadata:
labels: labels:
@@ -188,11 +189,6 @@ spec:
secretKeyRef: secretKeyRef:
name: wrestlingdev-secrets name: wrestlingdev-secrets
key: railssecretkey key: railssecretkey
- name: WRESTLINGDEV_SECRET_KEY_BASE
valueFrom:
secretKeyRef:
name: wrestlingdev-secrets
key: railssecretkey
- name: WRESTLINGDEV_EMAIL_PWD - name: WRESTLINGDEV_EMAIL_PWD
valueFrom: valueFrom:
secretKeyRef: secretKeyRef: