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

issue-1406 - changes for bulkdata web application split up to a separate deployable #4115

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
21 changes: 20 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
mvn -B org.apache.maven.plugins:maven-dependency-plugin:3.1.2:resolve-plugins -f fhir-parent -DexcludeReactor=true -Dmaven.wagon.http.retryHandler.count=3
mvn -B install --file fhir-parent -DskipTests -P include-fhir-igs,integration --no-transfer-progress -Dmaven.wagon.http.retryHandler.count=3
docker build fhir-install --build-arg VERBOSE=false -t linuxforhealth/fhir-server
echo "Building fhir-bulkdata-server image!"
docker build fhir-install-bulkdata --build-arg VERBOSE=false -t linuxforhealth/fhir-bulkdata-server
- name: free disk space
run: |
# create and remove a 200 MB file to make sure we have the room needed later
Expand All @@ -59,14 +61,31 @@ jobs:
rm -fr ${it_results} 2>/dev/null
mkdir -p ${it_results}/server-logs
mkdir -p ${it_results}/fhir-server-test
containerId=$(docker ps -a | grep fhir | cut -d ' ' -f 1)
containerId=$(docker ps -a | grep fhir-server | cut -d ' ' -f 1)
if [[ -z "${containerId}" ]]; then
echo "Warning: Could not find fhir container!!!"
else
echo "fhir container id: $containerId"

# Grab the container's console log
docker logs $containerId >& ${it_results}/docker-console.txt
echo "fhir container logs!!"
docker logs $containerId

echo "Gathering post-test server logs from docker container: $containerId"
docker cp -L $containerId:/logs ${it_results}/server-logs
fi

bulkDataContainerId=$(docker ps -a | grep fhir-bulkdata-server | cut -d ' ' -f 1)
if [[ -z "${bulkDataContainerId}" ]]; then
echo "Warning: Could not find bulkdata fhir container!!!"
else
echo "bulkdata fhir container id: $containerId"

# Grab the container's console log
docker logs $bulkDataContainerId >& ${it_results}/docker-console_bulkdata.txt
echo "bulkdata fhir container logs!!"
docker logs $bulkDataContainerId

echo "Gathering post-test server logs from docker container: $containerId"
docker cp -L $containerId:/logs ${it_results}/server-logs
Expand Down
6 changes: 6 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ Once the project is built, the LinuxForHealth FHIR Server container image can be
docker build fhir-install -t linuxforhealth/fhir-server
```

The LinuxForHealth FHIR Bulkdata Server container image can be built from the Dockerfile under fhir-install-bulkdata:
```sh
docker build fhir-install-bulkdata -t linuxforhealth/fhir-bulkdata-server
```

## Running the integration tests locally

Steps to install the server to the local filesystem at the root of the project and execute the tests.
Expand Down Expand Up @@ -61,6 +66,7 @@ The commands are expected to work on MacOS and/or Linux.

- [Docker](https://www.docker.com)
- `linuxforhealth/fhir-server:latest` (built from the fhir-install module as described above)
- - `linuxforhealth/fhir-bulkdata-server:latest` (built from the fhir-install-bulkdata module as described above)

### Run

Expand Down
88 changes: 75 additions & 13 deletions build/azurite/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@ volumes:
driver: local
blobdata:
driver: local
fhirconfig:
driver: local
driver_opts:
o: bind
type: none
device: ./fhir-server/config
fhirconfigoverrides:
driver: local
driver_opts:
o: bind
type: none
device: ./fhir-server/configDropins/overrides
fhiruserlib:
driver: local
driver_opts:
o: bind
type: none
device: ./fhir-server/userlib
fhirbulkdata:
driver: local
driver_opts:
o: bind
type: none
device: ./fhir-server/bulkdata

services:
postgres:
Expand Down Expand Up @@ -47,29 +71,24 @@ services:
image: linuxforhealth/fhir-server:latest
hostname: fhir
volumes:
- type: bind
source: ./fhir-server/config
- type: volume
source: fhirconfig
target: /opt/ol/wlp/usr/servers/defaultServer/config
read_only: true
- type: bind
source: ./fhir-server/configDropins/overrides
- type: volume
source: fhirconfigoverrides
target: /opt/ol/wlp/usr/servers/defaultServer/configDropins/overrides
read_only: true
- type: bind
source: ./fhir-server/userlib
- type: volume
source: fhiruserlib
target: /opt/ol/wlp/usr/servers/defaultServer/userlib
read_only: true
- type: bind
source: ./fhir-server/bulkdata
- type: volume
source: fhirbulkdata
target: /output/bulkdata
environment:
TRACE_SPEC: "org.linuxforhealth.fhir.*=INFO"
TRACE_FILE: "stdout"
BATCH_DB_HOSTNAME: postgres
BATCH_DB_USER: fhirbatch
BATCH_DB_PASS: change-password
BATCH_DB_SSL: "false"
BATCH_DB_NAME: fhirdb
command: bash -c "
java -jar /opt/fhir-server/tools/fhir-persistence-blob-app-*-cli.jar
--fhir-config-dir /opt/ol/wlp/usr/servers/defaultServer
Expand Down Expand Up @@ -111,6 +130,49 @@ services:
condition: service_healthy
networks:
- fhir
fhir-bulkdata-server:
image: linuxforhealth/fhir-bulkdata-server:latest
hostname: fhirbulkdata
volumes:
- type: volume
source: fhirconfig
target: /opt/ol/wlp/usr/servers/defaultServer/config
read_only: true
- type: bind
source: ./fhir-bulkdata-server/configDropins/overrides
target: /opt/ol/wlp/usr/servers/defaultServer/configDropins/overrides
read_only: true
- type: volume
source: fhiruserlib
target: /opt/ol/wlp/usr/servers/defaultServer/userlib
read_only: true
- type: volume
source: fhirbulkdata
target: /output/bulkdata
environment:
TRACE_SPEC: "org.linuxforhealth.fhir.*=INFO"
TRACE_FILE: "stdout"
BATCH_DB_HOSTNAME: postgres
BATCH_DB_USER: fhirbatch
BATCH_DB_PASS: change-password
BATCH_DB_SSL: "false"
BATCH_DB_NAME: fhirdb
command: bash -c "/opt/ol/wlp/bin/server run"
healthcheck:
start_period: 32s
interval: 20s
timeout: 5s
retries: 3
# https://docs.docker.com/compose/compose-file/#variable-substitution
test: curl --fail -k -u 'fhiruser:change-password' 'https://localhost:9445/fhir-bulkdata-server/api/v4/healthcheck'
ports:
- 9082:9082
- 9445:9445
depends_on:
postgres:
condition: service_healthy
networks:
- fhir

azurite:
image: mcr.microsoft.com/azure-storage/azurite
Expand Down
13 changes: 11 additions & 2 deletions build/common/copy-server-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,21 @@ cp ${CONFIG}/default/fhir-server-config-postgresql-minio.json ${CONFIG}/default/

echo "Replacing datasource content in server configDropins..."
OVERRIDES="fhir-server/configDropins/overrides"
BULKDATA_OVERRIDES="fhir-bulkdata-server/configDropins/overrides"
rm -rf ${OVERRIDES}/* 2> /dev/null
mkdir -p ${OVERRIDES}

echo "Create overrides directory for bulkdata db config..."
rm -rf ${BULKDATA_OVERRIDES}/* 2> /dev/null
mkdir -p ${BULKDATA_OVERRIDES}

# Copy over both the postgres (default_default) and derby (tenant1_*) datasource definitions
cp ${WORKSPACE}/fhir-server-webapp/src/main/liberty/config/configDropins/disabled/datasource-postgresql.xml ${OVERRIDES}/
cp ${WORKSPACE}/fhir-server-webapp/src/main/liberty/config/configDropins/disabled/postgres/bulkdata.xml ${OVERRIDES}/
cp ${WORKSPACE}/fhir-server-webapp/src/test/liberty/config/configDropins/overrides/datasource-derby.xml ${OVERRIDES}/
cp ${WORKSPACE}/fhir-server-webapp/src/main/liberty/config/configDropins/disabled/datasource-postgresql.xml ${OVERRIDES}/

echo "Copy over both the postgres (default_default) and derby (tenant1_*) datasource definitions to bulkdata_overrides..."
cp ${WORKSPACE}/fhir-server-webapp/src/main/liberty/bulkdata/disabled/postgres/datasource-bulkdata.xml ${BULKDATA_OVERRIDES}/
cp ${WORKSPACE}/fhir-server-webapp/src/test/liberty/config/configDropins/overrides/datasource-derby.xml ${BULKDATA_OVERRIDES}/
cp ${WORKSPACE}/fhir-server-webapp/src/main/liberty/config/configDropins/disabled/datasource-postgresql.xml ${BULKDATA_OVERRIDES}/

echo "Finished copying the server config."
89 changes: 76 additions & 13 deletions build/minio/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@ version: '3.8'
volumes:
pgdata:
driver: local
fhirconfig:
driver: local
driver_opts:
o: bind
type: none
device: ./fhir-server/config
fhirconfigoverrides:
driver: local
driver_opts:
o: bind
type: none
device: ./fhir-server/configDropins/overrides
fhiruserlib:
driver: local
driver_opts:
o: bind
type: none
device: ./fhir-server/userlib
fhirbulkdata:
driver: local
driver_opts:
o: bind
type: none
device: ./fhir-server/bulkdata


services:
postgres:
Expand Down Expand Up @@ -45,29 +70,24 @@ services:
image: linuxforhealth/fhir-server:latest
hostname: fhir
volumes:
- type: bind
source: ./fhir-server/config
- type: volume
source: fhirconfig
target: /opt/ol/wlp/usr/servers/defaultServer/config
read_only: true
- type: bind
source: ./fhir-server/configDropins/overrides
- type: volume
source: fhirconfigoverrides
target: /opt/ol/wlp/usr/servers/defaultServer/configDropins/overrides
read_only: true
- type: bind
source: ./fhir-server/userlib
- type: volume
source: fhiruserlib
target: /opt/ol/wlp/usr/servers/defaultServer/userlib
read_only: true
- type: bind
source: ./fhir-server/bulkdata
- type: volume
source: fhirbulkdata
target: /output/bulkdata
environment:
TRACE_SPEC: "org.linuxforhealth.fhir.*=INFO"
TRACE_FILE: "stdout"
BATCH_DB_HOSTNAME: postgres
BATCH_DB_USER: fhirbatch
BATCH_DB_PASS: change-password
BATCH_DB_SSL: "false"
BATCH_DB_NAME: fhirdb
command: bash -c "
java -jar /opt/fhir-server/tools/fhir-persistence-schema-*-cli.jar
--db-type postgresql --prop db.host=postgres --prop db.port=5432 --prop db.database=fhirdb --prop user=fhiradmin --prop password=change-password
Expand Down Expand Up @@ -106,6 +126,49 @@ services:
condition: service_healthy
networks:
- fhir
fhir-bulkdata-server:
image: linuxforhealth/fhir-bulkdata-server:latest
hostname: fhirbulkdata
volumes:
- type: volume
source: fhirconfig
target: /opt/ol/wlp/usr/servers/defaultServer/config
read_only: true
- type: bind
source: ./fhir-bulkdata-server/configDropins/overrides
target: /opt/ol/wlp/usr/servers/defaultServer/configDropins/overrides
read_only: true
- type: volume
source: fhiruserlib
target: /opt/ol/wlp/usr/servers/defaultServer/userlib
read_only: true
- type: volume
source: fhirbulkdata
target: /output/bulkdata
environment:
TRACE_SPEC: "org.linuxforhealth.fhir.*=INFO"
TRACE_FILE: "stdout"
BATCH_DB_HOSTNAME: postgres
BATCH_DB_USER: fhirbatch
BATCH_DB_PASS: change-password
BATCH_DB_SSL: "false"
BATCH_DB_NAME: fhirdb
command: bash -c "/opt/ol/wlp/bin/server run"
healthcheck:
start_period: 32s
interval: 30s
timeout: 5s
retries: 3
# https://docs.docker.com/compose/compose-file/#variable-substitution
test: curl --fail -k -u 'fhiruser:change-password' 'https://localhost:9445/fhir-bulkdata-server/api/v4/healthcheck'
ports:
- 9082:9082
- 9445:9445
depends_on:
postgres:
condition: service_healthy
networks:
- fhir

nats-node1:
image: nats-streaming:0.24
Expand Down
3 changes: 3 additions & 0 deletions build/pre-integration-test-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ echo "
Docker container status:"
docker ps -a

echo "docker image status:"
docker images

echo "Waiting for fhir-server to complete initialization..."
${WORKSPACE}/build/common/wait-for-it.sh

Expand Down
Loading