Skip to content

Commit c84d47b

Browse files
committed
HHH-18886 Upgrade PostgreSQL and EDB testing to version 17
1 parent 6141168 commit c84d47b

File tree

2 files changed

+64
-2
lines changed

2 files changed

+64
-2
lines changed

docker_db.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ mariadb_verylatest() {
151151
}
152152

153153
postgresql() {
154-
postgresql_16
154+
postgresql_17
155155
}
156156

157157
postgresql_12() {
@@ -186,8 +186,15 @@ postgresql_16() {
186186
$CONTAINER_CLI exec postgres bash -c '/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && apt install -y postgresql-16-pgvector && psql -U hibernate_orm_test -d hibernate_orm_test -c "create extension vector;"'
187187
}
188188

189+
postgresql_17() {
190+
$CONTAINER_CLI rm -f postgres || true
191+
$CONTAINER_CLI run --name postgres -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p5432:5432 --tmpfs /pgtmpfs:size=131072k -d ${DB_IMAGE_POSTGRESQL_17:-docker.io/postgis/postgis:17-3.5} \
192+
-c fsync=off -c synchronous_commit=off -c full_page_writes=off -c shared_buffers=256MB -c maintenance_work_mem=256MB -c max_wal_size=1GB -c checkpoint_timeout=1d
193+
$CONTAINER_CLI exec postgres bash -c '/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && apt install -y postgresql-17-pgvector && psql -U hibernate_orm_test -d hibernate_orm_test -c "create extension vector;"'
194+
}
195+
189196
edb() {
190-
edb_16
197+
edb_17
191198
}
192199

193200
edb_12() {
@@ -218,6 +225,13 @@ edb_16() {
218225
$CONTAINER_CLI run --name edb -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p 5444:5444 -d edb-test:16
219226
}
220227

228+
edb_17() {
229+
$CONTAINER_CLI rm -f edb || true
230+
# We need to build a derived image because the existing image is mainly made for use by a kubernetes operator
231+
(cd edb; $CONTAINER_CLI build -t edb-test:17 -f edb17.Dockerfile .)
232+
$CONTAINER_CLI run --name edb -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -p 5444:5444 -d edb-test:17
233+
}
234+
221235
db2() {
222236
db2_11_5
223237
}

edb/edb17.Dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM quay.io/enterprisedb/edb-postgres-advanced:17.4-3.5-postgis
2+
USER root
3+
# this 777 will be replaced by 700 at runtime (allows semi-arbitrary "--user" values)
4+
RUN chown -R postgres:postgres /var/lib/edb && chmod 777 /var/lib/edb && rm /docker-entrypoint-initdb.d/10_postgis.sh
5+
6+
USER postgres
7+
ENV LANG en_US.utf8
8+
ENV PG_MAJOR 17
9+
ENV PG_VERSION 17
10+
ENV PGPORT 5444
11+
ENV PGDATA /var/lib/edb/as$PG_MAJOR/data/
12+
VOLUME /var/lib/edb/as$PG_MAJOR/data/
13+
14+
COPY docker-entrypoint.sh /usr/local/bin/
15+
ENTRYPOINT ["docker-entrypoint.sh"]
16+
17+
# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL
18+
# calls "Fast Shutdown mode" wherein new connections are disallowed and any
19+
# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and
20+
# flush tables to disk, which is the best compromise available to avoid data
21+
# corruption.
22+
#
23+
# Users who know their applications do not keep open long-lived idle connections
24+
# may way to use a value of SIGTERM instead, which corresponds to "Smart
25+
# Shutdown mode" in which any existing sessions are allowed to finish and the
26+
# server stops when all sessions are terminated.
27+
#
28+
# See https://www.postgresql.org/docs/12/server-shutdown.html for more details
29+
# about available PostgreSQL server shutdown signals.
30+
#
31+
# See also https://www.postgresql.org/docs/12/server-start.html for further
32+
# justification of this as the default value, namely that the example (and
33+
# shipped) systemd service files use the "Fast Shutdown mode" for service
34+
# termination.
35+
#
36+
STOPSIGNAL SIGINT
37+
#
38+
# An additional setting that is recommended for all users regardless of this
39+
# value is the runtime "--stop-timeout" (or your orchestrator/runtime's
40+
# equivalent) for controlling how long to wait between sending the defined
41+
# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption).
42+
#
43+
# The default in most runtimes (such as Docker) is 10 seconds, and the
44+
# documentation at https://www.postgresql.org/docs/12/server-start.html notes
45+
# that even 90 seconds may not be long enough in many instances.
46+
47+
EXPOSE 5444
48+
CMD ["postgres"]

0 commit comments

Comments
 (0)