From c813478141dd649d1867779cde53a7abe7c50f36 Mon Sep 17 00:00:00 2001 From: Yalz Date: Wed, 22 May 2024 17:16:19 +0200 Subject: [PATCH] migrate server to postgres --- cypress/support/services/mongo-rest-api.ts | 13 ------ cypress/support/services/postgres-rest-api.ts | 15 ++---- .../config/ldes-server.config.yml | 12 +++-- .../docker-compose.yml | 44 ++++++++++++------ .../config/ldes-server.config.yml | 12 +++-- .../docker-compose.yml | 46 ++++++++++++------- .../config/ldes-server.config.yml | 13 ++++-- .../docker-compose.yml | 41 +++++++++++------ .../config/ldes-server.config.yml | 13 ++++-- .../docker-compose.yml | 44 ++++++++++++------ .../config/ldes-server.config.yml | 12 +++-- .../docker-compose.yml | 20 ++++++-- .../config/ldes-server.config.yml | 13 ++++-- .../docker-compose.yml | 44 ++++++++++++------ .../config/ldes-server.config.yml | 13 ++++-- .../docker-compose.yml | 44 ++++++++++++------ .../config/ldes-server.config.yml | 12 +++-- .../docker-compose.yml | 36 ++++++++++++--- .../config/ldes-server.config.yml | 13 ++++-- .../docker-compose.yml | 36 ++++++++++++--- .../config/ldes-server.config.yml | 13 ++++-- .../docker-compose.yml | 38 ++++++++++----- tests/035.relative-urls/docker-compose.yml | 20 +++++++- .../035.relative-urls/ldes-server.config.yml | 13 ++++-- .../config/ldes-server.config.yml | 13 ++++-- .../docker-compose.yml | 38 ++++++++++----- tests/039.default-bucket/docker-compose.yml | 35 +++++++++++++- .../039.default-bucket/ldes-server.config.yml | 13 ++++-- 28 files changed, 455 insertions(+), 224 deletions(-) diff --git a/cypress/support/services/mongo-rest-api.ts b/cypress/support/services/mongo-rest-api.ts index 6d34a8b3..dcedd540 100644 --- a/cypress/support/services/mongo-rest-api.ts +++ b/cypress/support/services/mongo-rest-api.ts @@ -37,17 +37,4 @@ export class MongoRestApi { .then(response => response.body) .then((result: CountResult) => result.count); } - - private documentIds(database: string, document: string) { - return cy.request(`${this.baseUrl}/${database}/${document}?includeIds=true`) - .then(response => response.body && (response.body.ids as string[])); - } - - fragmentIds(database: string) { - return this.documentIds(database, 'fragmentation_fragment'); - } - - snapshotIds(database: string) { - return this.documentIds(database, 'snapshot'); - } } diff --git a/cypress/support/services/postgres-rest-api.ts b/cypress/support/services/postgres-rest-api.ts index 84d7a139..f83d6616 100644 --- a/cypress/support/services/postgres-rest-api.ts +++ b/cypress/support/services/postgres-rest-api.ts @@ -2,13 +2,11 @@ import { timeouts } from "../common"; -type CountResult = { count: number, ids: string[] }; - type FragmentInfo = { _id: string, nrOfMembersAdded: number } type DocumentResult = { count: number, documents: FragmentInfo[] }; export class PostgresRestApi { - + constructor(public baseUrl: string) { } checkCount(collection: string, count: number, checkFn: (actual: number, expected: number) => boolean = (x, y) => x === y) { @@ -28,18 +26,11 @@ export class PostgresRestApi { private hasCount(collection: string, count: number, checkFn: (actual: number, expected: number) => boolean) { return cy.request(`${this.baseUrl}/${collection}`) - .then(response => response.body) - .then((result: CountResult) => cy.log('Actual count: ' + result.count).then(() => checkFn(result.count , count))); + .then((response => cy.log('Actual count: ' + response.body.length).then(() => checkFn(response.body.length , count)))); } count(collection: string) { return cy.request(`${this.baseUrl}/${collection}`) - .then(response => response.body) - .then((result: CountResult) => result.count); - } - - private documentIds(document: string) { - return cy.request(`${this.baseUrl}/${document}?includeIds=true`) - .then(response => response.body && (response.body.ids as string[])); + .then(response => response.body.length); } } diff --git a/tests/014.workbench-ngsi-v2-to-ngsi-ld/config/ldes-server.config.yml b/tests/014.workbench-ngsi-v2-to-ngsi-ld/config/ldes-server.config.yml index 9275e738..11b32ff6 100644 --- a/tests/014.workbench-ngsi-v2-to-ngsi-ld/config/ldes-server.config.yml +++ b/tests/014.workbench-ngsi-v2-to-ngsi-ld/config/ldes-server.config.yml @@ -9,8 +9,10 @@ management: ldes-server: host-name: http://localhost:8080 spring: - data: - mongodb: - database: iow - host: ldes-mongodb - port: 27017 + datasource: + url: jdbc:postgresql://ldes-postgres:5432/test + username: admin + password: admin + jpa: + hibernate: + ddl-auto: update \ No newline at end of file diff --git a/tests/014.workbench-ngsi-v2-to-ngsi-ld/docker-compose.yml b/tests/014.workbench-ngsi-v2-to-ngsi-ld/docker-compose.yml index 3a5b77e4..484918b4 100644 --- a/tests/014.workbench-ngsi-v2-to-ngsi-ld/docker-compose.yml +++ b/tests/014.workbench-ngsi-v2-to-ngsi-ld/docker-compose.yml @@ -49,14 +49,6 @@ services: profiles: - delay-started - ldes-mongodb: - container_name: ${USECASE_NAME:-iow-context}_ldes-mongodb - image: mongo:${MONGODB_TAG:-latest} - ports: - - ${MONGODB_PORT:-27017}:27017 - networks: - - ldes - ldes-server: container_name: ${USECASE_NAME:-iow-context}_ldes-server image: ${LDES_SERVER:-ghcr.io/informatievlaanderen/ldes-server}:${LDES_SERVER_TAG:-latest} @@ -70,16 +62,38 @@ services: networks: - ldes depends_on: - - ldes-mongodb + - ldes-postgres - mongodb-rest-api: - container_name: ${USECASE_NAME:-iow-context}_mongodb-rest-api - image: ghcr.io/informatievlaanderen/mongodb-rest-api:${MONGODB_REST_API_TAG:-latest} + ldes-postgres: + container_name: ldes-postgres + image: postgres:14-alpine + ports: + - "5432:5432" environment: - - SILENT=false - - CONNECTION_URI=mongodb://ldes-mongodb:27017 + - POSTGRES_PASSWORD=admin + - POSTGRES_USER=admin + - POSTGRES_DB=test + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U admin -d test" ] + interval: 5s + timeout: 5s + retries: 5 + restart: always + networks: + - ldes + + postgrest: + container_name: postgres-rest-api + image: postgrest/postgrest:latest ports: - - ${MONGODB_REST_API_PORT:-9019}:80 + - "9018:3000" + environment: + - PGRST_DB_URI=postgres://admin:admin@ldes-postgres:5432/test + - PGRST_DB_ANON_ROLE=admin + - PGRST_OPENAPI_SERVER_PROXY_URI=http://localhost:9018 + + depends_on: + - ldes-postgres networks: - ldes diff --git a/tests/015.nifi-workbench-ngsi-v2-to-oslo/config/ldes-server.config.yml b/tests/015.nifi-workbench-ngsi-v2-to-oslo/config/ldes-server.config.yml index 9275e738..a5336532 100644 --- a/tests/015.nifi-workbench-ngsi-v2-to-oslo/config/ldes-server.config.yml +++ b/tests/015.nifi-workbench-ngsi-v2-to-oslo/config/ldes-server.config.yml @@ -9,8 +9,10 @@ management: ldes-server: host-name: http://localhost:8080 spring: - data: - mongodb: - database: iow - host: ldes-mongodb - port: 27017 + datasource: + url: jdbc:postgresql://ldes-postgres:5432/test + username: admin + password: admin + jpa: + hibernate: + ddl-auto: update diff --git a/tests/015.nifi-workbench-ngsi-v2-to-oslo/docker-compose.yml b/tests/015.nifi-workbench-ngsi-v2-to-oslo/docker-compose.yml index ce4d8356..683ce9a9 100644 --- a/tests/015.nifi-workbench-ngsi-v2-to-oslo/docker-compose.yml +++ b/tests/015.nifi-workbench-ngsi-v2-to-oslo/docker-compose.yml @@ -32,14 +32,6 @@ services: networks: - ldes - ldes-mongodb: - container_name: ${USECASE_NAME:-iow-oslo-compliancy}_ldes-mongodb - image: mongo:${MONGODB_TAG:-latest} - ports: - - ${MONGODB_PORT:-27017}:27017 - networks: - - ldes - ldes-server: container_name: ${USECASE_NAME:-iow-oslo-compliancy}_ldes-server image: ${LDES_SERVER:-ghcr.io/informatievlaanderen/ldes-server}:${LDES_SERVER_TAG:-latest} @@ -53,18 +45,40 @@ services: networks: - ldes depends_on: - - ldes-mongodb + - ldes-postgres - mongodb-rest-api: - container_name: ${USECASE_NAME:-iow-oslo-compliancy}_mongodb-rest-api - image: ghcr.io/informatievlaanderen/mongodb-rest-api:${MONGODB_REST_API_TAG:-latest} + ldes-postgres: + container_name: ldes-postgres + image: postgres:14-alpine + ports: + - "5432:5432" environment: - - SILENT=false - - CONNECTION_URI=mongodb://ldes-mongodb:27017 + - POSTGRES_PASSWORD=admin + - POSTGRES_USER=admin + - POSTGRES_DB=test + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U admin -d test" ] + interval: 5s + timeout: 5s + retries: 5 + restart: always + networks: + - ldes + + postgrest: + container_name: postgres-rest-api + image: postgrest/postgrest:latest ports: - - ${MONGODB_REST_API_PORT:-9019}:80 + - "9018:3000" + environment: + - PGRST_DB_URI=postgres://admin:admin@ldes-postgres:5432/test + - PGRST_DB_ANON_ROLE=admin + - PGRST_OPENAPI_SERVER_PROXY_URI=http://localhost:9018 + + depends_on: + - ldes-postgres networks: - - ldes + - ldes networks: ldes: diff --git a/tests/016.mixed-workbench-ngsi-v2-to-oslo/config/ldes-server.config.yml b/tests/016.mixed-workbench-ngsi-v2-to-oslo/config/ldes-server.config.yml index 9275e738..115ab050 100644 --- a/tests/016.mixed-workbench-ngsi-v2-to-oslo/config/ldes-server.config.yml +++ b/tests/016.mixed-workbench-ngsi-v2-to-oslo/config/ldes-server.config.yml @@ -9,8 +9,11 @@ management: ldes-server: host-name: http://localhost:8080 spring: - data: - mongodb: - database: iow - host: ldes-mongodb - port: 27017 + datasource: + url: jdbc:postgresql://ldes-postgres:5432/test + username: admin + password: admin + jpa: + hibernate: + ddl-auto: update + diff --git a/tests/016.mixed-workbench-ngsi-v2-to-oslo/docker-compose.yml b/tests/016.mixed-workbench-ngsi-v2-to-oslo/docker-compose.yml index 695d4fe1..45aa9365 100644 --- a/tests/016.mixed-workbench-ngsi-v2-to-oslo/docker-compose.yml +++ b/tests/016.mixed-workbench-ngsi-v2-to-oslo/docker-compose.yml @@ -32,14 +32,6 @@ services: networks: - ldes - ldes-mongodb: - container_name: ${USECASE_NAME:-iow-use-ldio}_ldes-mongodb - image: mongo:${MONGODB_TAG:-latest} - ports: - - ${MONGODB_PORT:-27017}:27017 - networks: - - ldes - ldes-server: container_name: ${USECASE_NAME:-iow-use-ldio}_ldes-server image: ${LDES_SERVER:-ghcr.io/informatievlaanderen/ldes-server}:${LDES_SERVER_TAG:-latest} @@ -64,14 +56,35 @@ services: networks: - ldes - mongodb-rest-api: - container_name: ${USECASE_NAME:-iow-use-ldio}_mongodb-rest-api - image: ghcr.io/informatievlaanderen/mongodb-rest-api:${MONGODB_REST_API_TAG:-latest} + ldes-postgres: + container_name: ldes-postgres + image: postgres:14-alpine + ports: + - "5432:5432" environment: - - SILENT=false - - CONNECTION_URI=mongodb://ldes-mongodb:27017 + - POSTGRES_PASSWORD=admin + - POSTGRES_USER=admin + - POSTGRES_DB=test + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U admin -d test" ] + interval: 5s + timeout: 5s + retries: 5 + restart: always + networks: + - ldes + + postgrest: + container_name: postgres-rest-api + image: postgrest/postgrest:latest ports: - - ${MONGODB_REST_API_PORT:-9019}:80 + - "9018:3000" + environment: + - PGRST_DB_URI=postgres://admin:admin@ldes-postgres:5432/test + - PGRST_DB_ANON_ROLE=admin + - PGRST_OPENAPI_SERVER_PROXY_URI=http://localhost:9018 + depends_on: + - ldes-postgres networks: - ldes diff --git a/tests/017.ldio-workbench-ngsi-v2-to-oslo/config/ldes-server.config.yml b/tests/017.ldio-workbench-ngsi-v2-to-oslo/config/ldes-server.config.yml index 36f717ad..77c76a68 100644 --- a/tests/017.ldio-workbench-ngsi-v2-to-oslo/config/ldes-server.config.yml +++ b/tests/017.ldio-workbench-ngsi-v2-to-oslo/config/ldes-server.config.yml @@ -9,9 +9,12 @@ management: ldes-server: host-name: http://localhost:8080 spring: - data: - mongodb: - database: iow - host: ldes-mongodb - port: 27017 + datasource: + url: jdbc:postgresql://ldes-postgres:5432/test + username: admin + password: admin + jpa: + hibernate: + ddl-auto: update + diff --git a/tests/017.ldio-workbench-ngsi-v2-to-oslo/docker-compose.yml b/tests/017.ldio-workbench-ngsi-v2-to-oslo/docker-compose.yml index 53a83ac1..2b972e1d 100644 --- a/tests/017.ldio-workbench-ngsi-v2-to-oslo/docker-compose.yml +++ b/tests/017.ldio-workbench-ngsi-v2-to-oslo/docker-compose.yml @@ -19,14 +19,6 @@ services: depends_on: - ldio-workbench - ldes-mongodb: - container_name: ${USECASE_NAME:-nifi-less-approach}_ldes-mongodb - image: mongo:${MONGODB_TAG:-latest} - ports: - - ${MONGODB_PORT:-27017}:27017 - networks: - - ldes - ldes-server: container_name: ${USECASE_NAME:-nifi-less-approach}_ldes-server image: ${LDES_SERVER:-ghcr.io/informatievlaanderen/ldes-server}:${LDES_SERVER_TAG:-latest} @@ -40,7 +32,7 @@ services: networks: - ldes depends_on: - - ldes-mongodb + - ldes-postgres ldio-workbench: container_name: ${USECASE_NAME:-nifi-less-approach}_ldio-workbench @@ -53,14 +45,36 @@ services: networks: - ldes - mongodb-rest-api: - container_name: ${USECASE_NAME:-nifi-less-approach}_mongodb-rest-api - image: ghcr.io/informatievlaanderen/mongodb-rest-api:${MONGODB_REST_API_TAG:-latest} + ldes-postgres: + container_name: ldes-postgres + image: postgres:14-alpine + ports: + - "5432:5432" environment: - - SILENT=false - - CONNECTION_URI=mongodb://ldes-mongodb:27017 + - POSTGRES_PASSWORD=admin + - POSTGRES_USER=admin + - POSTGRES_DB=test + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U admin -d test" ] + interval: 5s + timeout: 5s + retries: 5 + restart: always + networks: + - ldes + + postgrest: + container_name: postgres-rest-api + image: postgrest/postgrest:latest ports: - - ${MONGODB_REST_API_PORT:-9019}:80 + - "9018:3000" + environment: + - PGRST_DB_URI=postgres://admin:admin@ldes-postgres:5432/test + - PGRST_DB_ANON_ROLE=admin + - PGRST_OPENAPI_SERVER_PROXY_URI=http://localhost:9018 + + depends_on: + - ldes-postgres networks: - ldes diff --git a/tests/019.server-supports-cacheability/config/ldes-server.config.yml b/tests/019.server-supports-cacheability/config/ldes-server.config.yml index 529561e0..b54752db 100644 --- a/tests/019.server-supports-cacheability/config/ldes-server.config.yml +++ b/tests/019.server-supports-cacheability/config/ldes-server.config.yml @@ -9,11 +9,13 @@ management: ldes-server: host-name: http://localhost:8080 spring: - data: - mongodb: - database: Gent - host: ldes-mongodb - port: 27017 + datasource: + url: jdbc:postgresql://ldes-postgres:5432/test + username: admin + password: admin + jpa: + hibernate: + ddl-auto: update rest: maxage: 10 maxage-immutable: 604800 diff --git a/tests/019.server-supports-cacheability/docker-compose.yml b/tests/019.server-supports-cacheability/docker-compose.yml index 5c35961c..280b5b5f 100644 --- a/tests/019.server-supports-cacheability/docker-compose.yml +++ b/tests/019.server-supports-cacheability/docker-compose.yml @@ -12,13 +12,23 @@ services: networks: - ldes depends_on: - - ldes-mongodb + - ldes-postgres - ldes-mongodb: - container_name: ${USECASE_NAME:-setup-caching}_ldes-mongodb - image: mongo:${MONGODB_TAG:-latest} + ldes-postgres: + container_name: ldes-postgres + image: postgres:14-alpine ports: - - ${MONGODB_PORT:-27017}:27017 + - "5432:5432" + environment: + - POSTGRES_PASSWORD=admin + - POSTGRES_USER=admin + - POSTGRES_DB=test + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U admin -d test" ] + interval: 5s + timeout: 5s + retries: 5 + restart: always networks: - ldes diff --git a/tests/023.nifi-workbench-upgrade/config/ldes-server.config.yml b/tests/023.nifi-workbench-upgrade/config/ldes-server.config.yml index 15f862ac..115ab050 100644 --- a/tests/023.nifi-workbench-upgrade/config/ldes-server.config.yml +++ b/tests/023.nifi-workbench-upgrade/config/ldes-server.config.yml @@ -9,8 +9,11 @@ management: ldes-server: host-name: http://localhost:8080 spring: - data: - mongodb: - database: iow_devices - host: ldes-mongodb - port: 27017 + datasource: + url: jdbc:postgresql://ldes-postgres:5432/test + username: admin + password: admin + jpa: + hibernate: + ddl-auto: update + diff --git a/tests/023.nifi-workbench-upgrade/docker-compose.yml b/tests/023.nifi-workbench-upgrade/docker-compose.yml index 06fa333a..d2b18ef2 100644 --- a/tests/023.nifi-workbench-upgrade/docker-compose.yml +++ b/tests/023.nifi-workbench-upgrade/docker-compose.yml @@ -43,14 +43,6 @@ services: - ldes profiles: - delay-started - - ldes-mongodb: - container_name: ${USECASE_NAME:-upgrade-nifi-workbench}_ldes-mongodb - image: mongo:${MONGODB_TAG:-latest} - ports: - - ${MONGODB_PORT:-27017}:27017 - networks: - - ldes ldes-server: container_name: ${USECASE_NAME:-upgrade-nifi-workbench}_ldes-server @@ -65,16 +57,38 @@ services: networks: - ldes depends_on: - - ldes-mongodb + - ldes-postgres - mongodb-rest-api: - container_name: ${USECASE_NAME:-upgrade-nifi-workbench}_mongodb-rest-api - image: ghcr.io/informatievlaanderen/mongodb-rest-api:${MONGODB_REST_API_TAG:-latest} + ldes-postgres: + container_name: ldes-postgres + image: postgres:14-alpine + ports: + - "5432:5432" environment: - - SILENT=false - - CONNECTION_URI=mongodb://ldes-mongodb:27017 + - POSTGRES_PASSWORD=admin + - POSTGRES_USER=admin + - POSTGRES_DB=test + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U admin -d test" ] + interval: 5s + timeout: 5s + retries: 5 + restart: always + networks: + - ldes + + postgrest: + container_name: postgres-rest-api + image: postgrest/postgrest:latest ports: - - ${MONGODB_REST_API_PORT:-9019}:80 + - "9018:3000" + environment: + - PGRST_DB_URI=postgres://admin:admin@ldes-postgres:5432/test + - PGRST_DB_ANON_ROLE=admin + - PGRST_OPENAPI_SERVER_PROXY_URI=http://localhost:9018 + + depends_on: + - ldes-postgres networks: - ldes diff --git a/tests/026.ldio-workbench-upgrade/config/ldes-server.config.yml b/tests/026.ldio-workbench-upgrade/config/ldes-server.config.yml index 15f862ac..115ab050 100644 --- a/tests/026.ldio-workbench-upgrade/config/ldes-server.config.yml +++ b/tests/026.ldio-workbench-upgrade/config/ldes-server.config.yml @@ -9,8 +9,11 @@ management: ldes-server: host-name: http://localhost:8080 spring: - data: - mongodb: - database: iow_devices - host: ldes-mongodb - port: 27017 + datasource: + url: jdbc:postgresql://ldes-postgres:5432/test + username: admin + password: admin + jpa: + hibernate: + ddl-auto: update + diff --git a/tests/026.ldio-workbench-upgrade/docker-compose.yml b/tests/026.ldio-workbench-upgrade/docker-compose.yml index 868af25c..04878659 100644 --- a/tests/026.ldio-workbench-upgrade/docker-compose.yml +++ b/tests/026.ldio-workbench-upgrade/docker-compose.yml @@ -45,14 +45,6 @@ services: - 8082:8080 profiles: - delay-started - - ldes-mongodb: - container_name: ${USECASE_NAME:-upgrade-ldio-workbench}_ldes-mongodb - image: mongo:${MONGODB_TAG:-latest} - ports: - - ${MONGODB_PORT:-27017}:27017 - networks: - - ldes ldes-server: container_name: ${USECASE_NAME:-upgrade-ldio-workbench}_ldes-server @@ -67,16 +59,38 @@ services: networks: - ldes depends_on: - - ldes-mongodb + - ldes-postgres - mongodb-rest-api: - container_name: ${USECASE_NAME:-upgrade-ldio-workbench}_mongodb-rest-api - image: ghcr.io/informatievlaanderen/mongodb-rest-api:${MONGODB_REST_API_TAG:-latest} + ldes-postgres: + container_name: ldes-postgres + image: postgres:14-alpine + ports: + - "5432:5432" environment: - - SILENT=false - - CONNECTION_URI=mongodb://ldes-mongodb:27017 + - POSTGRES_PASSWORD=admin + - POSTGRES_USER=admin + - POSTGRES_DB=test + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U admin -d test" ] + interval: 5s + timeout: 5s + retries: 5 + restart: always + networks: + - ldes + + postgrest: + container_name: postgres-rest-api + image: postgrest/postgrest:latest ports: - - ${MONGODB_REST_API_PORT:-9019}:80 + - "9018:3000" + environment: + - PGRST_DB_URI=postgres://admin:admin@ldes-postgres:5432/test + - PGRST_DB_ANON_ROLE=admin + - PGRST_OPENAPI_SERVER_PROXY_URI=http://localhost:9018 + + depends_on: + - ldes-postgres networks: - ldes diff --git a/tests/031.nifi-workbench-components/config/ldes-server.config.yml b/tests/031.nifi-workbench-components/config/ldes-server.config.yml index dac34832..1c96b65d 100644 --- a/tests/031.nifi-workbench-components/config/ldes-server.config.yml +++ b/tests/031.nifi-workbench-components/config/ldes-server.config.yml @@ -13,7 +13,11 @@ ldes-server: host-name: http://${LDES_SERVER}:8080 spring: - data: - mongodb: - uri: mongodb://ldes-mongodb:27017/ldes - auto-index-creation: true + datasource: + url: jdbc:postgresql://ldes-postgres:5432/test + username: admin + password: admin + jpa: + hibernate: + ddl-auto: update + diff --git a/tests/031.nifi-workbench-components/docker-compose.yml b/tests/031.nifi-workbench-components/docker-compose.yml index e5c9e6f2..3159a13c 100644 --- a/tests/031.nifi-workbench-components/docker-compose.yml +++ b/tests/031.nifi-workbench-components/docker-compose.yml @@ -56,16 +56,38 @@ services: networks: - ldes depends_on: - - ldes-mongodb + - ldes-postgres - mongodb-rest-api: - container_name: ${USECASE_NAME:-nifi-components}_mongodb-rest-api - image: ghcr.io/informatievlaanderen/mongodb-rest-api:${MONGODB_REST_API_TAG:-latest} + ldes-postgres: + container_name: ldes-postgres + image: postgres:14-alpine + ports: + - "5432:5432" environment: - - SILENT=false - - CONNECTION_URI=mongodb://ldes-mongodb:27017 + - POSTGRES_PASSWORD=admin + - POSTGRES_USER=admin + - POSTGRES_DB=test + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U admin -d test" ] + interval: 5s + timeout: 5s + retries: 5 + restart: always + networks: + - ldes + + postgrest: + container_name: postgres-rest-api + image: postgrest/postgrest:latest ports: - - ${MONGODB_REST_API_PORT:-9019}:80 + - "9018:3000" + environment: + - PGRST_DB_URI=postgres://admin:admin@ldes-postgres:5432/test + - PGRST_DB_ANON_ROLE=admin + - PGRST_OPENAPI_SERVER_PROXY_URI=http://localhost:9018 + + depends_on: + - ldes-postgres networks: - ldes diff --git a/tests/032.ldes-client-to-oauth-server/config/ldes-server.config.yml b/tests/032.ldes-client-to-oauth-server/config/ldes-server.config.yml index 36f717ad..77c76a68 100644 --- a/tests/032.ldes-client-to-oauth-server/config/ldes-server.config.yml +++ b/tests/032.ldes-client-to-oauth-server/config/ldes-server.config.yml @@ -9,9 +9,12 @@ management: ldes-server: host-name: http://localhost:8080 spring: - data: - mongodb: - database: iow - host: ldes-mongodb - port: 27017 + datasource: + url: jdbc:postgresql://ldes-postgres:5432/test + username: admin + password: admin + jpa: + hibernate: + ddl-auto: update + diff --git a/tests/032.ldes-client-to-oauth-server/docker-compose.yml b/tests/032.ldes-client-to-oauth-server/docker-compose.yml index 605bf644..d82a861e 100644 --- a/tests/032.ldes-client-to-oauth-server/docker-compose.yml +++ b/tests/032.ldes-client-to-oauth-server/docker-compose.yml @@ -39,7 +39,7 @@ services: ports: - 8081:8080 # needed for admin API depends_on: - - ldes-mongodb + - ldes-postgres ldes-mongodb: container_name: ${USECASE_NAME:-ldes-oauth-client}_ldes-mongodb @@ -49,14 +49,36 @@ services: networks: - ldes - mongodb-rest-api: - container_name: ${USECASE_NAME:-ldes-oauth-client}_mongodb-rest-api - image: ghcr.io/informatievlaanderen/mongodb-rest-api:${MONGODB_REST_API_TAG:-latest} + ldes-postgres: + container_name: ldes-postgres + image: postgres:14-alpine + ports: + - "5432:5432" environment: - - SILENT=false - - CONNECTION_URI=mongodb://ldes-mongodb:27017 + - POSTGRES_PASSWORD=admin + - POSTGRES_USER=admin + - POSTGRES_DB=test + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U admin -d test" ] + interval: 5s + timeout: 5s + retries: 5 + restart: always + networks: + - ldes + + postgrest: + container_name: postgres-rest-api + image: postgrest/postgrest:latest ports: - - ${MONGODB_REST_API_PORT:-9019}:80 + - "9018:3000" + environment: + - PGRST_DB_URI=postgres://admin:admin@ldes-postgres:5432/test + - PGRST_DB_ANON_ROLE=admin + - PGRST_OPENAPI_SERVER_PROXY_URI=http://localhost:9018 + + depends_on: + - ldes-postgres networks: - ldes diff --git a/tests/034.dataspace-connector-consumer-and-provider/config/ldes-server.config.yml b/tests/034.dataspace-connector-consumer-and-provider/config/ldes-server.config.yml index 2bee3489..3abc5ca8 100644 --- a/tests/034.dataspace-connector-consumer-and-provider/config/ldes-server.config.yml +++ b/tests/034.dataspace-connector-consumer-and-provider/config/ldes-server.config.yml @@ -9,11 +9,14 @@ management: ldes-server: host-name: http://localhost:8081 spring: - data: - mongodb: - database: iow - host: ldes-mongodb - port: 27017 + datasource: + url: jdbc:postgresql://ldes-postgres:5432/test + username: admin + password: admin + jpa: + hibernate: + ddl-auto: update + server: port: 8081 diff --git a/tests/034.dataspace-connector-consumer-and-provider/docker-compose.yml b/tests/034.dataspace-connector-consumer-and-provider/docker-compose.yml index 1ea807ab..2bc6cc89 100644 --- a/tests/034.dataspace-connector-consumer-and-provider/docker-compose.yml +++ b/tests/034.dataspace-connector-consumer-and-provider/docker-compose.yml @@ -80,24 +80,38 @@ services: ports: - 8081:8081 # needed for admin API depends_on: - - ldes-mongodb + - ldes-postgres - ldes-mongodb: - container_name: connector_ldes-mongodb - image: mongo:latest + ldes-postgres: + container_name: ldes-postgres + image: postgres:14-alpine ports: - - 27017:27017 + - "5432:5432" + environment: + - POSTGRES_PASSWORD=admin + - POSTGRES_USER=admin + - POSTGRES_DB=test + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U admin -d test" ] + interval: 5s + timeout: 5s + retries: 5 + restart: always networks: - ldes - mongodb-rest-api: - container_name: ${USECASE_NAME:-connector}_mongodb-rest-api - image: ghcr.io/informatievlaanderen/mongodb-rest-api:${MONGODB_REST_API_TAG:-latest} - environment: - - SILENT=false - - CONNECTION_URI=mongodb://ldes-mongodb:27017 + postgrest: + container_name: postgres-rest-api + image: postgrest/postgrest:latest ports: - - ${MONGODB_REST_API_PORT:-9019}:80 + - "9018:3000" + environment: + - PGRST_DB_URI=postgres://admin:admin@ldes-postgres:5432/test + - PGRST_DB_ANON_ROLE=admin + - PGRST_OPENAPI_SERVER_PROXY_URI=http://localhost:9018 + + depends_on: + - ldes-postgres networks: - ldes diff --git a/tests/035.relative-urls/docker-compose.yml b/tests/035.relative-urls/docker-compose.yml index 88f28142..3a105b15 100644 --- a/tests/035.relative-urls/docker-compose.yml +++ b/tests/035.relative-urls/docker-compose.yml @@ -11,7 +11,7 @@ services: ports: - ${LDES_SERVER_PORT:-8080}:8080 depends_on: - - ldes-mongodb + - ldes-postgres networks: - ldes @@ -48,6 +48,24 @@ services: networks: - ldes + ldes-postgres: + container_name: ldes-postgres + image: postgres:14-alpine + ports: + - "5432:5432" + environment: + - POSTGRES_PASSWORD=admin + - POSTGRES_USER=admin + - POSTGRES_DB=test + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U admin -d test" ] + interval: 5s + timeout: 5s + retries: 5 + restart: always + networks: + - ldes + networks: ldes: name: ${USECASE_NAME:-relative-url}_network diff --git a/tests/035.relative-urls/ldes-server.config.yml b/tests/035.relative-urls/ldes-server.config.yml index 6ae4b7a8..dc95ba36 100644 --- a/tests/035.relative-urls/ldes-server.config.yml +++ b/tests/035.relative-urls/ldes-server.config.yml @@ -10,8 +10,11 @@ ldes-server: host-name: http://localhost:8080 use-relative-url: true spring: - data: - mongodb: - database: bustang - host: ldes-mongodb - port: 27017 + datasource: + url: jdbc:postgresql://ldes-postgres:5432/test + username: admin + password: admin + jpa: + hibernate: + ddl-auto: update + diff --git a/tests/037.dataspace-connector-http-code-and-headers/config/ldes-server.config.yml b/tests/037.dataspace-connector-http-code-and-headers/config/ldes-server.config.yml index 2bee3489..3abc5ca8 100644 --- a/tests/037.dataspace-connector-http-code-and-headers/config/ldes-server.config.yml +++ b/tests/037.dataspace-connector-http-code-and-headers/config/ldes-server.config.yml @@ -9,11 +9,14 @@ management: ldes-server: host-name: http://localhost:8081 spring: - data: - mongodb: - database: iow - host: ldes-mongodb - port: 27017 + datasource: + url: jdbc:postgresql://ldes-postgres:5432/test + username: admin + password: admin + jpa: + hibernate: + ddl-auto: update + server: port: 8081 diff --git a/tests/037.dataspace-connector-http-code-and-headers/docker-compose.yml b/tests/037.dataspace-connector-http-code-and-headers/docker-compose.yml index 7aca354b..4e5e8510 100644 --- a/tests/037.dataspace-connector-http-code-and-headers/docker-compose.yml +++ b/tests/037.dataspace-connector-http-code-and-headers/docker-compose.yml @@ -82,24 +82,38 @@ services: ports: - 8081:8081 # needed for admin API depends_on: - - ldes-mongodb + - ldes-postgres - ldes-mongodb: - container_name: connector_ldes-mongodb - image: mongo:latest + ldes-postgres: + container_name: ldes-postgres + image: postgres:14-alpine ports: - - 27017:27017 + - "5432:5432" + environment: + - POSTGRES_PASSWORD=admin + - POSTGRES_USER=admin + - POSTGRES_DB=test + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U admin -d test" ] + interval: 5s + timeout: 5s + retries: 5 + restart: always networks: - ldes - mongodb-rest-api: - container_name: ${USECASE_NAME:-connector}_mongodb-rest-api - image: ghcr.io/informatievlaanderen/mongodb-rest-api:${MONGODB_REST_API_TAG:-latest} - environment: - - SILENT=false - - CONNECTION_URI=mongodb://ldes-mongodb:27017 + postgrest: + container_name: postgres-rest-api + image: postgrest/postgrest:latest ports: - - ${MONGODB_REST_API_PORT:-9019}:80 + - "9018:3000" + environment: + - PGRST_DB_URI=postgres://admin:admin@ldes-postgres:5432/test + - PGRST_DB_ANON_ROLE=admin + - PGRST_OPENAPI_SERVER_PROXY_URI=http://localhost:9018 + + depends_on: + - ldes-postgres networks: - ldes diff --git a/tests/039.default-bucket/docker-compose.yml b/tests/039.default-bucket/docker-compose.yml index d7c31146..e5ce8afd 100644 --- a/tests/039.default-bucket/docker-compose.yml +++ b/tests/039.default-bucket/docker-compose.yml @@ -11,7 +11,7 @@ services: ports: - ${LDES_SERVER_PORT:-8080}:8080 depends_on: - - ldes-mongodb + - ldes-postgres networks: - ldes @@ -48,6 +48,39 @@ services: networks: - ldes + ldes-postgres: + container_name: ldes-postgres + image: postgres:14-alpine + ports: + - "5432:5432" + environment: + - POSTGRES_PASSWORD=admin + - POSTGRES_USER=admin + - POSTGRES_DB=test + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U admin -d test" ] + interval: 5s + timeout: 5s + retries: 5 + restart: always + networks: + - ldes + + postgrest: + container_name: postgres-rest-api + image: postgrest/postgrest:latest + ports: + - "9018:3000" + environment: + - PGRST_DB_URI=postgres://admin:admin@ldes-postgres:5432/test + - PGRST_DB_ANON_ROLE=admin + - PGRST_OPENAPI_SERVER_PROXY_URI=http://localhost:9018 + + depends_on: + - ldes-postgres + networks: + - ldes + networks: ldes: name: ${USECASE_NAME:-default-bucket}_network diff --git a/tests/039.default-bucket/ldes-server.config.yml b/tests/039.default-bucket/ldes-server.config.yml index a8699888..95815f2e 100644 --- a/tests/039.default-bucket/ldes-server.config.yml +++ b/tests/039.default-bucket/ldes-server.config.yml @@ -10,8 +10,11 @@ ldes-server: host-name: http://ldes-server:8080 use-relative-url: false spring: - data: - mongodb: - database: bustang - host: ldes-mongodb - port: 27017 + datasource: + url: jdbc:postgresql://ldes-postgres:5432/test + username: admin + password: admin + jpa: + hibernate: + ddl-auto: update +