Upgrade to postgres:15 (#14230)

* Upgrade to postgres:15
* Changed postgres:15 to quay.io/sclorg/postgresql-15-c9s
This commit is contained in:
John Westcott IV 2024-03-07 16:27:03 -05:00 committed by GitHub
parent 3f2f7b75a6
commit ee9eac15dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 15 additions and 17 deletions

View File

@ -629,9 +629,6 @@ clean-elk:
docker rm tools_elasticsearch_1
docker rm tools_kibana_1
psql-container:
docker run -it --net tools_default --rm postgres:12 sh -c 'exec psql -h "postgres" -p "5432" -U postgres'
VERSION:
@echo "awx: $(VERSION)"

View File

@ -154,10 +154,12 @@ def manage():
from django.conf import settings
from django.core.management import execute_from_command_line
# enforce the postgres version is equal to 12. if not, then terminate program with exit code of 1
# enforce the postgres version is a minimum of 12 (we need this for partitioning); if not, then terminate program with exit code of 1
# In the future if we require a feature of a version of postgres > 12 this should be updated to reflect that.
# The return of connection.pg_version is something like 12013
if not os.getenv('SKIP_PG_VERSION_CHECK', False) and not MODE == 'development':
if (connection.pg_version // 10000) < 12:
sys.stderr.write("Postgres version 12 is required\n")
sys.stderr.write("At a minimum, postgres version 12 is required\n")
sys.exit(1)
if len(sys.argv) >= 2 and sys.argv[1] in ('version', '--version'): # pragma: no cover

View File

@ -419,7 +419,7 @@ def _events_table(since, full_path, until, tbl, where_column, project_job_create
resolved_action,
resolved_role,
-- '-' operator listed here:
-- https://www.postgresql.org/docs/12/functions-json.html
-- https://www.postgresql.org/docs/15/functions-json.html
-- note that operator is only supported by jsonb objects
-- https://www.postgresql.org/docs/current/datatype-json.html
(CASE WHEN event = 'playbook_on_stats' THEN {event_data} - 'artifact_data' END) as playbook_on_stats,

View File

@ -249,7 +249,7 @@ RUN for dir in \
/var/lib/awx/.local/share/containers/storage \
/var/run/awx-rsyslog \
/var/log/nginx \
/var/lib/postgresql \
/var/lib/pgsql \
/var/run/supervisor \
/var/run/awx-receptor \
/var/lib/nginx ; \
@ -300,7 +300,6 @@ RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
{% endif %}
ENV HOME="/var/lib/awx"
ENV PATH="/usr/pgsql-12/bin:${PATH}"
{% if build_dev|bool %}
ENV PATH="/var/lib/awx/venv/awx/bin/:${PATH}"

View File

@ -207,17 +207,16 @@ services:
# context: ../../docker-compose
# dockerfile: Dockerfile-logstash
postgres:
image: postgres:12
image: quay.io/sclorg/postgresql-15-c9s
container_name: tools_postgres_1
# additional logging settings for postgres can be found https://www.postgresql.org/docs/current/runtime-config-logging.html
command: postgres -c log_destination=stderr -c log_min_messages=info -c log_min_duration_statement={{ pg_log_min_duration_statement|default(1000) }} -c max_connections={{ pg_max_connections|default(1024) }}
command: run-postgresql -c log_destination=stderr -c log_min_messages=info -c log_min_duration_statement={{ pg_log_min_duration_statement|default(1000) }} -c max_connections={{ pg_max_connections|default(1024) }}
environment:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_USER: {{ pg_username }}
POSTGRES_DB: {{ pg_database }}
POSTGRES_PASSWORD: {{ pg_password }}
POSTGRESQL_USER: {{ pg_username }}
POSTGRESQL_DATABASE: {{ pg_database }}
POSTGRESQL_PASSWORD: {{ pg_password }}
volumes:
- "awx_db:/var/lib/postgresql/data"
- "awx_db_15:/var/lib/pgsql/data"
networks:
- awx
ports:
@ -305,8 +304,9 @@ services:
{% endif %}
volumes:
awx_db:
name: tools_awx_db
{# For the postgres 15 db upgrade we changed the mount name because 15 can't load a 12 DB #}
awx_db_15:
name: tools_awx_db_15
{% for i in range(control_plane_node_count|int) -%}
{% set container_postfix = loop.index %}
redis_socket_{{ container_postfix }}: