Skip to content

Commit

Permalink
Merge pull request #1480 from samply/release/v0.24.1
Browse files Browse the repository at this point in the history
Release v0.24.1
  • Loading branch information
alexanderkiel committed Feb 7, 2024
2 parents 13db1e2 + 9964956 commit 8b75c67
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 48 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ jobs:
run: make uberjar

- name: Upload Blaze Uberjar
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
with:
name: blaze-uberjar
path: target/blaze-*-standalone.jar
Expand All @@ -206,7 +206,7 @@ jobs:
outputs: type=docker,dest=/tmp/blaze.tar

- name: Upload Blaze Image
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
with:
name: blaze-image
path: /tmp/blaze.tar
Expand Down Expand Up @@ -1527,4 +1527,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@87c3283f01cd6fe19a0ab93a23b2f6fcba5a8e42 # v4
uses: actions/deploy-pages@decdde0ac072f6dcbe43649d82d9c635fff5b4e4 # v4
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## v0.24.1

### Notes

Please update from v0.24.0 if you use variable length logical id's.

### Bugfixes

* Fix Error While Reading Non-Existent Resource ([#1475](https://github.com/samply/blaze/issues/1475))

The full changelog can be found [here](https://github.com/samply/blaze/milestone/84?closed=1).

## v0.24.0

### Notes
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update && apt-get upgrade -y && \
rm -rf /var/lib/apt/lists/

RUN mkdir -p /app/data && chown 1001:1001 /app/data
COPY target/blaze-0.24.0-standalone.jar /app/
COPY target/blaze-0.24.1-standalone.jar /app/

WORKDIR /app
USER 1001
Expand All @@ -19,4 +19,4 @@ ENV INDEX_DB_DIR="/app/data/index"
ENV TRANSACTION_DB_DIR="/app/data/transaction"
ENV RESOURCE_DB_DIR="/app/data/resource"

CMD ["java", "-jar", "blaze-0.24.0-standalone.jar"]
CMD ["java", "-jar", "blaze-0.24.1-standalone.jar"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The goal of this project is to provide a FHIR® Store with an internal CQL Evalu

Blaze passes all [Touchstone FHIR 4.0.1 Basic Tests][12] and almost all [CQL Tests][3]. Please refer to the [Conformance](docs/conformance.md) section and report any issues you encounter during evaluation.

Latest release: [v0.24.0][5]
Latest release: [v0.24.1][5]

## Quick Start

Expand Down Expand Up @@ -74,7 +74,7 @@ Unless required by applicable law or agreed to in writing, software distributed

[3]: <https://cql.hl7.org/tests.html>
[4]: <https://alexanderkiel.gitbook.io/blaze/deployment>
[5]: <https://github.com/samply/blaze/releases/tag/v0.24.0>
[5]: <https://github.com/samply/blaze/releases/tag/v0.24.1>
[6]: <https://www.yourkit.com/java/profiler/>
[7]: <https://www.yourkit.com/.net/profiler/>
[8]: <https://www.yourkit.com/youmonitor/>
Expand Down
2 changes: 1 addition & 1 deletion build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(:require [clojure.tools.build.api :as b]))

(def lib 'samply/blaze)
(def version "0.24.0")
(def version "0.24.1")
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def uber-file (format "target/%s-%s-standalone.jar" (name lib) version))
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default defineConfig({
nav: [
{text: 'Home', link: '/'},
{
text: "v0.24.0",
text: "v0.24.1",
items: [
{
text: 'Changelog',
Expand Down
4 changes: 2 additions & 2 deletions docs/deployment/docker-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Blaze should log something like this:
2023-06-09T08:30:30.126Z b45689460ff3 main INFO [blaze.core:67] - JVM version: 17.0.7
2023-06-09T08:30:30.126Z b45689460ff3 main INFO [blaze.core:68] - Maximum available memory: 1738 MiB
2023-06-09T08:30:30.126Z b45689460ff3 main INFO [blaze.core:69] - Number of available processors: 2
2023-06-09T08:30:30.126Z b45689460ff3 main INFO [blaze.core:70] - Successfully started 🔥 Blaze version 0.24.0 in 9.0 seconds
2023-06-09T08:30:30.126Z b45689460ff3 main INFO [blaze.core:70] - Successfully started 🔥 Blaze version 0.24.1 in 9.0 seconds
```

In order to test connectivity, query the health endpoint:
Expand All @@ -47,7 +47,7 @@ that should return:
```json
{
"name": "Blaze",
"version": "0.24.0"
"version": "0.24.1"
}
```

Expand Down
12 changes: 6 additions & 6 deletions docs/deployment/manual-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

The installation works under Windows, Linux and macOS. The only dependency is an installed OpenJDK 11 or 17 with 17 recommended. Blaze is tested with [Eclipse Temurin][1].

Blaze runs on the JVM and comes as single JAR file. Download the most recent version [here](https://github.com/samply/blaze/releases/tag/v0.24.0). Look for `blaze-0.24.0-standalone.jar`.
Blaze runs on the JVM and comes as single JAR file. Download the most recent version [here](https://github.com/samply/blaze/releases/tag/v0.24.1). Look for `blaze-0.24.1-standalone.jar`.

After the download, you can start blaze with the following command (Linux, macOS):

```sh
java -jar blaze-0.24.0-standalone.jar
java -jar blaze-0.24.1-standalone.jar
```

Blaze will run with an in-memory, volatile database for testing and demo purposes.
Expand All @@ -17,14 +17,14 @@ Blaze can be run with durable storage by setting the environment variables `STOR
Under Linux/macOS:

```sh
STORAGE=standalone java -jar blaze-0.24.0-standalone.jar
STORAGE=standalone java -jar blaze-0.24.1-standalone.jar
```

Under Windows, you need to set the Environment variables in the PowerShell before starting Blaze:

```powershell
$Env:STORAGE="standalone"
java -jar blaze-0.24.0-standalone.jar
java -jar blaze-0.24.1-standalone.jar
```

This will create three directories called `index`, `transaction` and `resource` inside the current working directory, one for each database part used.
Expand All @@ -42,7 +42,7 @@ The output should look like this:
2021-06-27T11:02:37.834Z ee086ef908c1 main INFO [blaze.core:64] - JVM version: 16.0.2
2021-06-27T11:02:37.834Z ee086ef908c1 main INFO [blaze.core:65] - Maximum available memory: 1738 MiB
2021-06-27T11:02:37.835Z ee086ef908c1 main INFO [blaze.core:66] - Number of available processors: 8
2021-06-27T11:02:37.836Z ee086ef908c1 main INFO [blaze.core:67] - Successfully started Blaze version 0.24.0 in 8.2 seconds
2021-06-27T11:02:37.836Z ee086ef908c1 main INFO [blaze.core:67] - Successfully started Blaze version 0.24.1 in 8.2 seconds
```

In order to test connectivity, query the health endpoint:
Expand All @@ -62,7 +62,7 @@ that should return:
```json
{
"name": "Blaze",
"version": "0.24.0"
"version": "0.24.1"
}
```

Expand Down
37 changes: 21 additions & 16 deletions modules/db/src/blaze/db/impl/index/resource_as_of.clj
Original file line number Diff line number Diff line change
Expand Up @@ -315,24 +315,29 @@
(bb/flip! target-buf)
(kv/seek-buffer! iter target-buf)
(when (kv/valid? iter)
;; it's important to clear key-buf before reading, because otherwise
;; the limit could be to small
(bb/clear! key-buf)
(kv/key! iter key-buf)
;; we have to check that we are still on target, because otherwise we
;; would find the next resource
;; focus target buffer on tid and id
(bb/rewind! target-buf)
(bb/set-limit! target-buf tid-id-size)
;; focus key buffer on tid and id
(bb/set-limit! key-buf tid-id-size)
(when (= target-buf key-buf)
;; focus key buffer on t
(bb/set-limit! key-buf key-size)
(let [value-buf (bb/allocate value-size)]
(kv/value! iter value-buf)
(rh/resource-handle!
tid
(codec/id-string id)
(codec/descending-long (bb/get-long! key-buf tid-id-size))
value-buf))))))
;; would find the next resource. First the length of the found key has
;; to equal our key size
(when (= key-size (bb/limit key-buf))
;; focus target buffer on tid and id
(bb/rewind! target-buf)
(bb/set-limit! target-buf tid-id-size)
;; focus key buffer on tid and id
(bb/set-limit! key-buf tid-id-size)
(when (= target-buf key-buf)
;; focus key buffer on t
(bb/set-limit! key-buf key-size)
(let [value-buf (bb/allocate value-size)]
(kv/value! iter value-buf)
(rh/resource-handle!
tid
(codec/id-string id)
(codec/descending-long (bb/get-long! key-buf tid-id-size))
value-buf)))))))

(defn resource-handle
"Returns the resource handle with `tid` and `id` at `t` in `snapshot` when
Expand Down
43 changes: 35 additions & 8 deletions modules/db/test/blaze/db/api_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
[blaze.log]
[blaze.module.test-util :refer [with-system]]
[blaze.test-util :as tu :refer [satisfies-prop]]
[clojure.spec.alpha :as s]
[clojure.spec.test.alpha :as st]
[clojure.test :as test :refer [are deftest is testing]]
[clojure.test.check.generators :as gen]
Expand Down Expand Up @@ -550,12 +551,12 @@
[:subject :reference] := "Patient/0"
[meta :blaze.db/op] := :create)))))

(testing "creating 100 transactions in parallel"
(testing "creating 1000 transactions in parallel"
(with-system [{:blaze.db/keys [node]} slow-resource-store-system]
(let [db-futures
(mapv
#(d/transact node [[:create {:fhir/type :fhir/Patient :id (str %)}]])
(range 100))]
(range 1000))]

(testing "wait for all transactions finishing"
@(ac/all-of db-futures))
Expand All @@ -568,7 +569,7 @@
true?
(map
#(= % (d/type-total (d/as-of db %) "Patient"))
(range 100))))))))))
(range 1000))))))))))

(testing "with failing resource storage"
(testing "on put"
Expand Down Expand Up @@ -631,6 +632,12 @@

(is (d/resource-handle? (d/resource-handle (d/db node) "Patient" "0")))))

(testing "doesn't find a resource handle mit prefix of it's id"
(with-system-data [{:blaze.db/keys [node]} config]
[[[:create {:fhir/type :fhir/Patient :id "00"}]]]

(is (nil? (d/resource-handle (d/db node) "Patient" "0")))))

(testing "a node contains a resource after a create transaction"
(with-system-data [{:blaze.db/keys [node]} config]
[[[:create {:fhir/type :fhir/Patient :id "0"}]]]
Expand Down Expand Up @@ -943,9 +950,21 @@
count := 1
[0 :fhir/type] := :fhir/Patient
[0 :id] := "0")
(is (= 1 (count-type-query node "Patient" [["active" "true"]]))))))
(is (= 1 (count-type-query node "Patient" [["active" "true"]])))))

(testing "works with variable length ids"
(with-system-data [{:blaze.db/keys [node]} config]
[[[:put {:fhir/type :fhir/Patient :id "1" :active true}]
[:put {:fhir/type :fhir/Patient :id "10" :active true}]]]

(testing "search by id"
(given (pull-type-query node "Patient" [["active" "true"]])
count := 2
[0 :fhir/type] := :fhir/Patient
[0 :id] := "1"
[1 :fhir/type] := :fhir/Patient
[1 :id] := "10"))))

(testing "search by _id"
(with-system-data [{:blaze.db/keys [node]} config]
[[[:put {:fhir/type :fhir/Patient :id "0" :active true}]
[:put {:fhir/type :fhir/Patient :id "1" :active false}]
Expand Down Expand Up @@ -999,8 +1018,8 @@

(testing "sorting by _id"
(with-system-data [{:blaze.db/keys [node]} config]
[[[:put {:fhir/type :fhir/Patient :id "0" :active true}]
[:put {:fhir/type :fhir/Patient :id "1" :active false}]]]
[[[:put {:fhir/type :fhir/Patient :id "0"}]
[:put {:fhir/type :fhir/Patient :id "1"}]]]

(testing "ascending"
(given (pull-type-query node "Patient" [[:sort "_id" :asc]])
Expand All @@ -1019,7 +1038,15 @@
(testing "descending"
(given (d/type-query (d/db node) "Patient" [[:sort "_id" :desc]])
::anom/category := ::anom/unsupported
::anom/message := "Unsupported sort direction `desc` for search param `_id`."))))
::anom/message := "Unsupported sort direction `desc` for search param `_id`.")))

(testing "random id's"
(satisfies-prop 100
(prop/for-all [ids (gen/set (s/gen :blaze.resource/id) {:min-elements 1})]
(with-system-data [{:blaze.db/keys [node]} config]
[(mapv #(vector :create {:fhir/type :fhir/Patient :id %}) ids)]

(= (sort ids) (mapv :id (pull-type-query node "Patient" [[:sort "_id" :asc]]))))))))

(testing "a node with two patients in two transactions"
(with-system-data [{:blaze.db/keys [node]} config]
Expand Down
4 changes: 2 additions & 2 deletions modules/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blaze-frontend",
"version": "0.24.0",
"version": "0.24.1",
"private": true,
"scripts": {
"dev": "vite dev",
Expand Down
4 changes: 2 additions & 2 deletions modules/kv/src/blaze/db/kv.clj
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
(defn key!
"Puts the key of current entry of `iter` in `buf`.
Uses the position of `buf` and sets the limit of `buf` according to the key
size.
Uses the position and limit of `buf` and sets the limit of `buf` according to
the key size. Note: doesn't read bytes over the limit!
Returns the size of the actual key. If the key is greater than the length of
`buf`, then it indicates that the size of the `buf` is insufficient and a
Expand Down
4 changes: 2 additions & 2 deletions src/blaze/system.clj
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@
(into {} (map (fn [[k v]] [k (resolvef k v)])) (ig/find-derived config key))))

(def ^:private root-config
{:blaze/version "0.24.0"
{:blaze/version "0.24.1"

:blaze/release-date "2024-02-06"
:blaze/release-date "2024-02-07"

:blaze/clock {}

Expand Down

0 comments on commit 8b75c67

Please sign in to comment.