Skip to content

Commit

Permalink
Merge pull request #151 from ropable/master
Browse files Browse the repository at this point in the history
Update gunicorn, add Kustomize HPA resources
  • Loading branch information
ropable authored Apr 24, 2024
2 parents 47fa5bf + 54cb99b commit 8bb5ccc
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 79 deletions.
2 changes: 1 addition & 1 deletion ibms_project/middleware.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.db import connections
from django.http import HttpResponse, HttpResponseServerError
import logging

Expand Down Expand Up @@ -29,7 +30,6 @@ def readiness(self, request):
being present.
"""
try:
from django.db import connections
cursor = connections["default"].cursor()
cursor.execute("SELECT 1;")
row = cursor.fetchone()
Expand Down
1 change: 0 additions & 1 deletion kustomize/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ kind: Deployment
metadata:
name: ibms-deployment
spec:
replicas: 2
strategy:
type: RollingUpdate
template:
Expand Down
17 changes: 17 additions & 0 deletions kustomize/base/deployment_hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: ibms-deployment-hpa
spec:
minReplicas: 1
maxReplicas: 3
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
metrics:
- resource:
name: cpu
target:
type: Utilization
averageUtilization: 250
type: Resource
3 changes: 3 additions & 0 deletions kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- deployment_hpa.yaml
- service.yaml
7 changes: 7 additions & 0 deletions kustomize/overlays/prod/deployment_hpa_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: ibms-deployment-hpa
spec:
scaleTargetRef:
name: ibms-deployment-prod
7 changes: 4 additions & 3 deletions kustomize/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ labels:
- includeSelectors: true
pairs:
variant: prod
images:
- name: ghcr.io/dbca-wa/ibms
newTag: 2.8.4
patches:
- path: deployment_patch.yaml
- path: deployment_hpa_patch.yaml
- path: service_patch.yaml
images:
- name: ghcr.io/dbca-wa/ibms
newTag: 2.8.5
7 changes: 7 additions & 0 deletions kustomize/overlays/uat/deployment_hpa_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: ibms-deployment-hpa
spec:
scaleTargetRef:
name: ibms-deployment-uat
1 change: 1 addition & 0 deletions kustomize/overlays/uat/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ labels:
variant: uat
patches:
- path: deployment_patch.yaml
- path: deployment_hpa_patch.yaml
- path: service_patch.yaml
138 changes: 71 additions & 67 deletions poetry.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[tool.poetry]
name = "ibms"
version = "2.8.4"
version = "2.8.5"
description = "Integrated Business Management System corporate application"
authors = ["Ashley Felton <[email protected]>"]
license = "Apache-2.0"

[tool.poetry.dependencies]
python = ">=3.11"
django = "4.2.10"
django = "4.2.11"
psycopg2 = "2.9.9"
dbca-utils = "2.0.1"
dbca-utils = "2.0.2"
django-extensions = "3.2.3"
python-dotenv = "1.0.1"
dj-database-url = "2.1.0"
gunicorn = "21.2.0"
gunicorn = "22.0.0"
django-crispy-forms = "2.1"
crispy-bootstrap5 = "2024.2"
xlrd = "2.0.1" # TODO: deprecate
Expand All @@ -23,12 +23,12 @@ openpyxl = "3.1.2"
webtemplate-dbca = "1.7.0"
whitenoise = {version = "6.6.0", extras = ["brotli"]}
mixer = "7.2.2"
sentry-sdk = {version = "1.40.5", extras = ["django"]}
sentry-sdk = {version = "1.45.0", extras = ["django"]}

[tool.poetry.group.dev.dependencies]
ipython = "^8.22.1"
ipython = "^8.23.0"
ipdb = "^0.13.13"
pre-commit = "^3.6.2"
pre-commit = "^3.7.0"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit 8bb5ccc

Please sign in to comment.