You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,7 @@
1
1
# CHANGELOG
2
+
# 0.3.2
3
+
## Bug Fixes
4
+
* Fixed an issue when deploying in Docker. Jemalloc crashes when deploying in Docker Compose on Apple Silicon due to differences in OS page sizes - Added documentation to README
Copy file name to clipboardExpand all lines: README.md
+86-56Lines changed: 86 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,37 +1,57 @@
1
-
cozodb
2
-
=====
1
+
# cozodb
2
+
3
+
Erlang/BEAM NIF bindings for [CozoDB](https://github.com/cozodb/cozo) using Rustler.
4
+
5
+
CozoDB is a FOSS embeddable, transactional, relational-graph-vector database, with a Datalog query engine and time travelling capability, perfect as the long-term memory for LLMs and AI.
Erlang/BEAM NIF bindings for CozoDB using Rustler.
30
+
```erlang
31
+
%% Open an in-memory database
32
+
{ok, Db} =cozodb:open(mem).
5
33
6
-
CozoDB is a FOSS embeddable, transactional, relational-graph-vector database, wiht a Datalog query engine and time travelling capability, perfect as the long-term memory for LLMs and AI.
@@ -42,44 +62,34 @@ Add the following to your `rebar.config` file.
42
62
```
43
63
44
64
### Elixir
45
-
Add the following to your `mix.exs` file.
65
+
66
+
Add the following to your `mix.exs` file:
46
67
47
68
```elixir
48
-
defpdepsdo
49
-
[
50
-
{:cozodb,
51
-
git:"https://github.com/leapsight/cozodb.git",
52
-
branch:"master"
53
-
}
54
-
]
69
+
defpdepsdo
70
+
[
71
+
{:cozodb,
72
+
git:"https://github.com/leapsight/cozodb.git",
73
+
branch:"master"
74
+
}
75
+
]
76
+
end
55
77
```
56
78
57
-
### Using newrocksdb Backend as a Consumer
58
-
59
-
By default, cozodb compiles with the `rocksdb` (cozorocks) backend. If you need the `newrocksdb` backend with environment variable configuration, you have two options:
60
-
61
-
#### Option A: Fork and Modify (Recommended)
79
+
## Basic Usage
62
80
63
-
1. Fork the cozodb repository
64
-
2. Modify `native/cozodb/Cargo.toml` to use `new-rocksdb-default` as the default features
|`COZODB_JEMALLOC_NARENAS`| u32 | auto | Number of arenas (optional) |
284
294
295
+
### Docker
296
+
#### Build the Rust NIF with C++20 support (required by newer RocksDB headers)
297
+
```Dockerfile
298
+
ENV CXXFLAGS="-std=c++20"
299
+
```
300
+
#### CRITICAL jemalloc Config
301
+
* Set page size for jemalloc to match Linux x86_64 (4KB = 2^12) -- This prevents "page size mismatch" errors when running in Docker containers. Different from macOS Apple Silicon which uses 16KB (LG_PAGE=14) or 64KB pages.
302
+
303
+
Add the following to your Dockerfile:
304
+
305
+
```Dockerfile
306
+
ENV JEMALLOC_SYS_WITH_LG_PAGE=12
307
+
```
308
+
309
+
Also for container compatibility set `JEMALLOC_SYS_WITH_MALLOC_CONF`. This bakes safe defaults directly into the binary - no runtime MALLOC_CONF needed
0 commit comments