Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .github/distributed-test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ services:
DB_CASSANDRA_REQUEST_TIMEOUT: "60000"
DB_CASSANDRA_MAX_CONCURRENT_REQUESTS: "128"
DB_BLOCK_CACHE_SIZE: "128"
DB_RESOURCE_CACHE_SIZE: "100000"
DB_RESOURCE_INDEXER_THREADS: "8"
ALLOW_MULTIPLE_DELETE: "true"
ENABLE_INTERACTION_DELETE_HISTORY: "true"
Expand Down Expand Up @@ -156,7 +155,6 @@ services:
DB_CASSANDRA_REQUEST_TIMEOUT: "60000"
DB_CASSANDRA_MAX_CONCURRENT_REQUESTS: "128"
DB_BLOCK_CACHE_SIZE: "128"
DB_RESOURCE_CACHE_SIZE: "100000"
DB_RESOURCE_INDEXER_THREADS: "8"
ALLOW_MULTIPLE_DELETE: "true"
ENABLE_INTERACTION_DELETE_HISTORY: "true"
Expand Down
57 changes: 57 additions & 0 deletions .github/scripts/age-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash -e

#
# This script test that the complex data type Age works as expected
#

script_dir="$(dirname "$(readlink -f "$0")")"
. "$script_dir/util.sh"

base="http://localhost:8080/fhir"

echo "ℹ️ Age as polymorph data element in Condition"

condition() {
cat <<END
{
"resourceType": "Condition",
"onsetAge": {
"value": 42,
"unit": "year",
"system": "http://unitsofmeasure.org",
"code": "a"
}
}
END
}

response="$(condition | create "$base/Condition")"

test "age value" "$(echo "$response" | jq -r .onsetAge.value)" "42"
test "age unit" "$(echo "$response" | jq -r .onsetAge.unit)" "year"

echo "ℹ️ Age as extension value"

patient() {
cat <<END
{
"resourceType": "Patient",
"extension": [
{
"url": "foo",
"valueAge": {
"value": 42,
"unit": "year",
"system": "http://unitsofmeasure.org",
"code": "a"
}
}
]
}
END
}

response="$(patient | create "$base/Patient")"

test "age value" "$(echo "$response" | jq -r .extension[0].valueAge.value)" "42"
test "age unit" "$(echo "$response" | jq -r .extension[0].valueAge.unit)" "year"
35 changes: 35 additions & 0 deletions .github/scripts/count-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash -e

#
# This script test that the complex data type Count works as expected
#

script_dir="$(dirname "$(readlink -f "$0")")"
. "$script_dir/util.sh"

base="http://localhost:8080/fhir"

echo "ℹ️ Count as extension value"

patient() {
cat <<END
{
"resourceType": "Patient",
"extension": [
{
"url": "foo",
"valueCount": {
"value": 23,
"system": "http://unitsofmeasure.org",
"code": "1"
}
}
]
}
END
}

response="$(patient | create "$base/Patient")"

test "count value" "$(echo "$response" | jq -r .extension[0].valueCount.value)" "23"
test "count code" "$(echo "$response" | jq -r .extension[0].valueCount.code)" "1"
36 changes: 36 additions & 0 deletions .github/scripts/distance-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash -e

#
# This script test that the complex data type Distance works as expected
#

script_dir="$(dirname "$(readlink -f "$0")")"
. "$script_dir/util.sh"

base="http://localhost:8080/fhir"

echo "ℹ️ Distance as extension value"

patient() {
cat <<END
{
"resourceType": "Patient",
"extension": [
{
"url": "foo",
"valueDistance": {
"value": 23,
"unit": "km",
"system": "http://unitsofmeasure.org",
"code": "km"
}
}
]
}
END
}

response="$(patient | create "$base/Patient")"

test "distance value" "$(echo "$response" | jq -r .extension[0].valueDistance.value)" "23"
test "distance unit" "$(echo "$response" | jq -r .extension[0].valueDistance.unit)" "km"
57 changes: 57 additions & 0 deletions .github/scripts/duration-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash -e

#
# This script test that the complex data type Duration works as expected
#

script_dir="$(dirname "$(readlink -f "$0")")"
. "$script_dir/util.sh"

base="http://localhost:8080/fhir"

echo "ℹ️ Duration as polymorph data element in ActivityDefinition"

activity_definition() {
cat <<END
{
"resourceType": "ActivityDefinition",
"timingDuration": {
"value": 23,
"unit": "second",
"system": "http://unitsofmeasure.org",
"code": "s"
}
}
END
}

response="$(activity_definition | create "$base/ActivityDefinition")"

test "duration value" "$(echo "$response" | jq -r .timingDuration.value)" "23"
test "duration unit" "$(echo "$response" | jq -r .timingDuration.unit)" "second"

echo "ℹ️ Duration as extension value"

patient() {
cat <<END
{
"resourceType": "Patient",
"extension": [
{
"url": "foo",
"valueDuration": {
"value": 23,
"unit": "second",
"system": "http://unitsofmeasure.org",
"code": "s"
}
}
]
}
END
}

response="$(patient | create "$base/Patient")"

test "duration value" "$(echo "$response" | jq -r .extension[0].valueDuration.value)" "23"
test "duration unit" "$(echo "$response" | jq -r .extension[0].valueDuration.unit)" "second"
52 changes: 49 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,39 @@ jobs:
- name: Test
run: make -C modules/${{ matrix.module }} test-slow

test-mem-size:
runs-on: ubuntu-24.04

steps:
- name: Setup Java
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
with:
distribution: 'temurin'
java-version: '25'

- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@3fe9b3ae632c6758d0b7757b0838606ef4287b08 # 13.4
with:
cli: '1.12.3.1577'

- name: Check out Git repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5

- name: Cache Local Maven Repo
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-temurin-25-maven-fhir-structure-${{ hashFiles('modules/fhir-structure/deps.edn') }}

- name: Cache Clojure GitLibs
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ~/.gitlibs
key: ${{ runner.os }}-gitlibs-fhir-structure-${{ hashFiles('modules/fhir-structure/deps.edn') }}

- name: Test
run: make -C modules/fhir-structure test-mem-size

# Special treatment, because it runs much longer as the other modules.
test-coverage-db:
strategy:
Expand Down Expand Up @@ -656,7 +689,7 @@ jobs:
run: .github/scripts/evaluate-measure.sh q36-parameter 86

- name: Check Bloom Filter
run: .github/scripts/check-bloom-filter.sh fbb79d85457069c8e1926c949690deecd60d751942d5b0cd0b61c08e6029224c 86
run: .github/scripts/check-bloom-filter.sh 017a0f079c2a76a731db3cdf68637afc8e4fac34409b032b5ac93958923e0501 86

- name: Evaluate CQL Query 36 - Subject List
run: .github/scripts/evaluate-measure-subject-list.sh q36-parameter 86
Expand All @@ -668,7 +701,7 @@ jobs:
run: .github/scripts/evaluate-measure.sh q37-overlaps 24

- name: Check Bloom Filter
run: .github/scripts/check-bloom-filter.sh 9fe779d821d7647831331b490939aa0cdf314d76c9b2a9518ffaf559353db043 24
run: .github/scripts/check-bloom-filter.sh e7d79fd90bce0a8c5abad06027e3b6d57b448076ff41fa36827e5e3b65ca10c2 24

- name: Evaluate CQL Query 37 - Blazectl
run: .github/scripts/evaluate-measure-blazectl.sh q37-overlaps 24
Expand Down Expand Up @@ -1321,6 +1354,18 @@ jobs:
- name: Search for Location using near Search Param
run: .github/scripts/search-location-near.sh

- name: Age Test
run: .github/scripts/age-test.sh

- name: Count Test
run: .github/scripts/count-test.sh

- name: Distance Test
run: .github/scripts/distance-test.sh

- name: Duration Test
run: .github/scripts/duration-test.sh

- name: Prometheus Metrics
run: .github/scripts/test-metrics.sh
if: ${{ matrix.variant == 'standalone' }}
Expand Down Expand Up @@ -2442,7 +2487,7 @@ jobs:
run: docker load --input /tmp/blaze.tar

- name: Run Blaze
run: docker run --name blaze -d -e JAVA_TOOL_OPTIONS=-Xmx2g -e DB_RESOURCE_CACHE_SIZE=0 -p 8080:8080 --read-only --tmpfs /tmp:exec -v blaze-data:/app/data blaze:latest
run: docker run --name blaze -d -e JAVA_TOOL_OPTIONS=-Xmx2g -p 8080:8080 --read-only --tmpfs /tmp:exec -v blaze-data:/app/data blaze:latest

- name: Wait for Blaze
run: .github/scripts/wait-for-url.sh http://localhost:8080/health
Expand Down Expand Up @@ -2738,6 +2783,7 @@ jobs:
- lint
- test
- test-slow
- test-mem-size
- test-root
- image-scan
- cql-expr-cache-test
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:21.0.9_10-jre-noble@sha256:67fc762eabacb56e5444b367889e04ce8c839b8f4b3d8ef3e459c5579fbefd8a
FROM eclipse-temurin:25-jre-noble

ENV DEBIAN_FRONTEND=noninteractive

Expand All @@ -15,11 +15,12 @@ WORKDIR /app
USER 1001

ENV LD_PRELOAD="libjemalloc.so.2"
ENV BASE_JAVA_TOOL_OPTIONS="-XX:+UseCompactObjectHeaders --enable-native-access=ALL-UNNAMED --sun-misc-unsafe-memory-access=allow"
ENV STORAGE="standalone"
ENV INDEX_DB_DIR="/app/data/index"
ENV TRANSACTION_DB_DIR="/app/data/transaction"
ENV RESOURCE_DB_DIR="/app/data/resource"
ENV ADMIN_INDEX_DB_DIR="/app/data/admin-index"
ENV ADMIN_TRANSACTION_DB_DIR="/app/data/admin-transaction"

CMD ["java", "-jar", "blaze-1.4.1-standalone.jar"]
CMD ["sh", "-c", "JAVA_TOOL_OPTIONS=\"${BASE_JAVA_TOOL_OPTIONS} ${JAVA_TOOL_OPTIONS}\" exec java -jar blaze-1.4.1-standalone.jar"]
1 change: 1 addition & 0 deletions cljfmt.edn
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
reg-collector [[:block 1]]
deftests [[:block 1]]
satisfies-prop [[:block 1]]
mem-size-test [[:block 1]]
clojure.test.check.properties/for-all [[:block 1]]
blaze.metrics.core/collector [[:block 0]]
reify-expr [[:inner 0] [:inner 1]]
Expand Down
1 change: 0 additions & 1 deletion docs/deployment/distributed-backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ blaze-1:
DB_CASSANDRA_CONTACT_POINTS: "cassandra-1:9042,cassandra-2:9042"
DB_CASSANDRA_REQUEST_TIMEOUT: "60000"
DB_CASSANDRA_MAX_CONCURRENT_REQUESTS: "128"
DB_RESOURCE_CACHE_SIZE: "100000"
ENABLE_ADMIN_API: "true"
LOG_LEVEL: "debug"
ports:
Expand Down
2 changes: 0 additions & 2 deletions docs/deployment/distributed/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ services:
DB_CASSANDRA_CONTACT_POINTS: "cassandra-1:9042,cassandra-2:9042"
DB_CASSANDRA_REQUEST_TIMEOUT: "60000"
DB_CASSANDRA_MAX_CONCURRENT_REQUESTS: "128"
DB_RESOURCE_CACHE_SIZE: "100000"
ENABLE_ADMIN_API: "true"
LOG_LEVEL: "debug"
ports:
Expand Down Expand Up @@ -151,7 +150,6 @@ services:
DB_CASSANDRA_CONTACT_POINTS: "cassandra-1:9042,cassandra-2:9042"
DB_CASSANDRA_REQUEST_TIMEOUT: "60000"
DB_CASSANDRA_MAX_CONCURRENT_REQUESTS: "128"
DB_RESOURCE_CACHE_SIZE: "100000"
ENABLE_ADMIN_API: "true"
LOG_LEVEL: "debug"
ports:
Expand Down
20 changes: 16 additions & 4 deletions docs/deployment/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,18 @@ The size of the [block cache][2] of the DB in MiB. This cache is outside of the

**Default:** 128

#### `DB_RESOURCE_CACHE_SIZE` <Badge type="warning" text="Since 0.8"/>
#### `DB_RESOURCE_CACHE_SIZE` <Badge type="warning" text="Since 0.8"/> <Badge type="danger" text="unreleased"/>

The size of the resource cache of the DB in number of resources.
The size of the resource cache of the DB in number of resources. (Deprecated)

**Default:** 100000

#### `DB_RESOURCE_CACHE_SIZE_RATIO` <Badge type="warning" text="unreleased"/>

The ratio of JVM heap size that is allocated to the resource cache. A value of 0 disables the resource cache and a value of 0.8 is the maximum.

**Default:** 0.25

#### `DB_SCALE_FACTOR` <Badge type="warning" text="Since 1.4"/>

Scales sizes of DB in-memory buffers and SST files. See also: [Production Configuration](../production-configuration.md#db-scale-factor).
Expand Down Expand Up @@ -166,12 +172,18 @@ The size of the [block cache][2] of the DB in MiB. This cache is outside of the

**Default:** 128

#### `DB_RESOURCE_CACHE_SIZE` <Badge type="warning" text="Since 0.8"/>
#### `DB_RESOURCE_CACHE_SIZE` <Badge type="warning" text="Since 0.8"/> <Badge type="danger" text="unreleased"/>

The size of the resource cache of the DB in number of resources.
The size of the resource cache of the DB in number of resources. (Deprecated)

**Default:** 100000

#### `DB_RESOURCE_CACHE_SIZE_RATIO` <Badge type="warning" text="unreleased"/>

The ratio of JVM heap size that is allocated to the resource cache. A value of 0 disables the resource cache and a value of 0.8 is the maximum.

**Default:** 0.25

#### `DB_MAX_BACKGROUND_JOBS` <Badge type="warning" text="Since 0.8"/>

The maximum number of the [background jobs][3] used for DB compactions.
Expand Down
Loading