Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Postgres 11 -> 15 #283

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ FROM python:3.10-slim-bullseye as base
# postgresql-client -- for running database commands
# We need to recreate the /usr/share/man/man{1..8} directories first because
# they were clobbered by a parent image.
ENV POSTGRESQL_CLIENT_VERSION="15"
RUN set -ex \
&& RUN_DEPS=" \
libpcre3 \
mime-support \
postgresql-client-12 \
postgresql-client-${POSTGRESQL_CLIENT_VERSION} \
vim \
" \
&& seq 1 8 | xargs -I{} mkdir -p /usr/share/man/man{} \
Expand Down Expand Up @@ -123,6 +124,7 @@ RUN groupadd --gid $USER_GID $USERNAME \
# vim -- enhanced vi editor for commits
ENV KUBE_CLIENT_VERSION="v1.29.3"
ENV HELM_VERSION="3.14.4"
ENV POSTGRESQL_CLIENT_VERSION="15"
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
--mount=type=cache,mode=0755,target=/root/.cache/pip \
set -ex \
Expand All @@ -142,7 +144,7 @@ RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/
mime-support \
nodejs \
openssh-client \
postgresql-client-14 \
postgresql-client-${POSTGRESQL_CLIENT_VERSION} \
sudo \
vim \
zlib1g-dev \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To begin you should have the following applications installed on your local deve
- [pip](http://www.pip-installer.org/) >= 20
- [virtualenv](http://www.virtualenv.org/) >= 1.10
- [virtualenvwrapper](http://pypi.python.org/pypi/virtualenvwrapper) >= 3.0
- Postgres >= 11
- Postgres >= 15
- git >= 2.26


Expand Down
11 changes: 9 additions & 2 deletions deploy/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ admin_database_password: !vault |
# caktus.aws-web-stacks: Ansible role to automate AWS CloudFormation stack
# provisioning with aws-web-stacks.
# ----------------------------------------------------------------------------
# Parameters
cloudformation_stack_database_engine_version: "15.4"
cloudformation_stack_database_parameter_group_family: postgres15

cloudformation_stack:
profile: "{{ aws_profile }}"
Expand All @@ -62,8 +65,8 @@ cloudformation_stack:
AssetsBucketAccessControl: Private
AssetsUseCloudFront: "false"
DatabaseClass: db.t3.small
DatabaseEngineVersion: "11"
DatabaseParameterGroupFamily: postgres11
DatabaseEngineVersion: "{{ cloudformation_stack_database_engine_version }}"
DatabaseParameterGroupFamily: "{{ cloudformation_stack_database_parameter_group_family }}"
DatabaseName: "{{ app_name }}"
DatabaseUser: "{{ app_name }}_admin"
DatabasePassword: "{{ admin_database_password }}"
Expand Down Expand Up @@ -220,3 +223,7 @@ k8s_descheduler_release_values:
# During upgrades or reboots, don't pre-emptively drain a node.
RemovePodsViolatingNodeTaints:
enabled: false


# Must be PostgreSQL v15 for DB restore
k8s_hosting_services_image_tag: 0.5.0-postgres15
1 change: 1 addition & 0 deletions deploy/host_vars/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ k8s_hosting_services_project_name: "{{ app_name }}"
k8s_hosting_services_healthcheck_url: https://hc-ping.com/7d334762-8f35-453e-85b7-55e0b3147723
k8s_hosting_services_database_url: "{{ env_database_url }}"
k8s_hosting_services_backup_base_bucket: hip-production-philly-backups
k8s_hosting_services_image_tag: "{{ k8s_hosting_services_image_tag }}"
k8s_hosting_services_aws_region: us-east-1
k8s_hosting_services_aws_access_key: AKIAQ4VHAAV5UM2FBDUB
k8s_hosting_services_aws_secret_access_key: !vault |
Expand Down
4 changes: 4 additions & 0 deletions deploy/stack/eks-no-nat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,9 @@ Parameters:
- postgres10
- postgres11
- postgres12
- postgres13
- postgres14
- postgres15
- sqlserver-ee-11.0
- sqlserver-ee-12.0
- sqlserver-ee-13.0
Expand Down Expand Up @@ -1085,6 +1088,7 @@ Resources:
DeletionPolicy: Retain
Properties:
AccessControl: !Ref 'AssetsBucketAccessControl'
AllowMajorVersionUpgrade: 'true'
BucketEncryption: !If
- UseAES256EncryptionCond
- ServerSideEncryptionConfiguration:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
environment:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: hip
image: postgres:12-alpine
image: postgres:15-alpine
ports:
- "5433:5432"
volumes:
Expand Down
2 changes: 1 addition & 1 deletion requirements/base/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pdfid
social-auth-app-django

# Postgres
psycopg2-binary
psycopg2-binary==2.9.9


# Wagtail
Expand Down
2 changes: 1 addition & 1 deletion requirements/base/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ phonenumberslite==8.12.18
# via -r requirements/base/base.in
pillow==9.3.0
# via wagtail
psycopg2-binary==2.8.6
psycopg2-binary==2.9.9
# via -r requirements/base/base.in
pycparser==2.20
# via cffi
Expand Down
14 changes: 5 additions & 9 deletions requirements/dev/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ anyascii==0.1.7
anyio==3.7.1
# via jupyter-server
appnope==0.1.4
# via -r requirements/dev/dev.in
# via
# -r requirements/dev/dev.in
# ipykernel
argon2-cffi==23.1.0
# via
# jupyter-server
Expand Down Expand Up @@ -186,7 +188,6 @@ idna==2.10
# via
# -c requirements/dev/../base/base.txt
# anyio
# httpx
# requests
importlib-metadata==7.1.0
# via -r requirements/dev/dev.in
Expand All @@ -202,7 +203,6 @@ invoke-kubesae==0.1.0
# via -r requirements/dev/dev.in
ipykernel==6.29.4
# via
# jupyterlab
# nbclassic
# notebook
ipython==8.24.0
Expand Down Expand Up @@ -328,9 +328,7 @@ nodeenv==1.8.0
notebook==6.5.7
# via jupyterlab
notebook-shim==0.2.4
# via
# jupyterlab
# nbclassic
# via nbclassic
oauthlib==3.1.0
# via
# -c requirements/dev/../base/base.txt
Expand Down Expand Up @@ -505,9 +503,7 @@ six==1.15.0
# openshift
# python-dateutil
sniffio==1.3.1
# via
# anyio
# httpx
# via anyio
soupsieve==2.2
# via
# -c requirements/dev/../base/base.txt
Expand Down
Loading