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

Merged
merged 9 commits into from
Jan 21, 2025
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
DJANGO_SETTINGS_MODULE: hip.settings.dev
services:
postgres:
image: postgres
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: hip_ci
Expand All @@ -27,7 +27,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '20'
- name: Cache node modules
uses: actions/cache@v3
env:
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ FROM python:3.11-slim-bookworm 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 @@ -143,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 @@ -46,6 +46,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.5"
cloudformation_stack_database_parameter_group_family: postgres15

cloudformation_stack:
profile: "{{ aws_profile }}"
Expand Down Expand Up @@ -74,8 +77,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 @@ -234,3 +237,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.6.0-postgres15
1 change: 1 addition & 0 deletions deploy/stack/eks-nat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,7 @@ Resources:
DeletionPolicy: Snapshot
Properties:
AllocatedStorage: !Ref 'DatabaseAllocatedStorage'
AllowMajorVersionUpgrade: 'true'
BackupRetentionPeriod: !Ref 'DatabaseBackupRetentionDays'
DBInstanceClass: !Ref 'DatabaseClass'
DBName: !Ref 'DatabaseName'
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.4"

volumes:
dev_hip_data: {}
dev_media: {}
Expand All @@ -12,7 +10,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