Skip to content

Commit ee7c2ee

Browse files
committed
HHH-15615 Add EDB PostgreSQL Advanced to test matrix and fix issues
1 parent 940f15b commit ee7c2ee

File tree

15 files changed

+431
-13
lines changed

15 files changed

+431
-13
lines changed

.github/workflows/contributor-build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
- rdbms: mariadb
4444
- rdbms: postgresql
4545
- rdbms: postgresql_14
46+
- rdbms: edb
4647
- rdbms: oracle
4748
- rdbms: db2
4849
- rdbms: mssql

Jenkinsfile

+2-6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ stage('Configure') {
3434
// new BuildEnvironment( dbName: 'mariadb' ),
3535
// new BuildEnvironment( dbName: 'postgresql' ),
3636
// new BuildEnvironment( dbName: 'postgresql_14' ),
37+
// new BuildEnvironment( dbName: 'edb' ),
3738
// new BuildEnvironment( dbName: 'oracle' ),
3839
// new BuildEnvironment( dbName: 'db2' ),
3940
// new BuildEnvironment( dbName: 'mssql' ),
@@ -194,12 +195,7 @@ stage('Build') {
194195
state[buildEnv.tag]['containerName'] = "sybase"
195196
break;
196197
case "edb":
197-
docker.withRegistry('https://containers.enterprisedb.com', 'hibernateci.containers.enterprisedb.com') {
198-
// withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'hibernateci.containers.enterprisedb.com',
199-
// usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
200-
// sh 'docker login -u "$USERNAME" -p "$PASSWORD" https://containers.enterprisedb.com'
201-
docker.image('containers.enterprisedb.com/edb/edb-as-lite:v11').pull()
202-
}
198+
docker.image('quay.io/enterprisedb/edb-postgres-advanced:10.22').pull()
203199
sh "./docker_db.sh edb"
204200
state[buildEnv.tag]['containerName'] = "edb"
205201
break;

ci/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if [ "$RDBMS" == "h2" ]; then
77
elif [ "$RDBMS" == "derby" ]; then
88
goal="-Pdb=derby"
99
elif [ "$RDBMS" == "edb" ]; then
10-
goal="-Pdb=edb_ci"
10+
goal="-Pdb=edb_ci -DdbHost=localhost:5444"
1111
elif [ "$RDBMS" == "hsqldb" ]; then
1212
goal="-Pdb=hsqldb"
1313
elif [ "$RDBMS" == "mysql8" ]; then

ci/database-start.sh

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ elif [ "$RDBMS" == 'postgresql' ]; then
1212
bash $DIR/../docker_db.sh postgresql
1313
elif [ "$RDBMS" == 'postgresql_14' ]; then
1414
bash $DIR/../docker_db.sh postgresql_14
15+
elif [ "$RDBMS" == 'edb' ]; then
16+
bash $DIR/../docker_db.sh edb
1517
elif [ "$RDBMS" == 'db2' ]; then
1618
bash $DIR/../docker_db.sh db2
1719
elif [ "$RDBMS" == 'oracle' ]; then

docker_db.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,15 @@ postgresql_14() {
115115
}
116116

117117
edb() {
118-
#$CONTAINER_CLI login containers.enterprisedb.com
118+
edb_10
119+
}
120+
121+
edb_10() {
119122
$CONTAINER_CLI rm -f edb || true
120-
$CONTAINER_CLI run --name edb -e ACCEPT_EULA=Yes -e DATABASE_USER=hibernate_orm_test -e DATABASE_USER_PASSWORD=hibernate_orm_test -e ENTERPRISEDB_PASSWORD=hibernate_orm_test -e DATABASE_NAME=hibernate_orm_test -e PGPORT=5433 -p 5433:5433 --mount type=tmpfs,destination=/edbvolume -d containers.enterprisedb.com/edb/edb-as-lite:v11
123+
# The version of the base image can be seen and updated in ./edb/Dockerfile
124+
# We need to build a derived image because the existing image is mainly made for use by a kubernetes operator
125+
(cd edb; $CONTAINER_CLI build -t edb-test:latest .)
126+
$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:latest
121127
}
122128

123129
db2() {

edb/Dockerfile

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

0 commit comments

Comments
 (0)