Skip to content

Implemented Durable Graph Database Providers ( golem:graph WIT interfaces) #40

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

Open
wants to merge 18 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
107 changes: 107 additions & 0 deletions Cargo.lock

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

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ members = [
"llm/ollama",
"llm/openai",
"llm/openrouter",
"graph/graph",
"graph/arangodb",
"graph/janusgraph",
"graph/neo4j"
]

[profile.release]
Expand All @@ -19,10 +23,11 @@ opt-level = 's'
golem-rust = "1.6.0"
log = "0.4.27"
golem-llm = { path = "llm/llm", version = "0.0.0", default-features = false }
golem-graph = { path = "graph/graph", version = "0.0.0", default-features = false }
reqwest = { git = "https://github.com/golemcloud/reqwest", branch = "update-may-2025", features = [
"json",
] }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0" }
wit-bindgen-rt = { version = "0.40.0", features = ["bitflags"] }
base64 = { version = "0.22.1" }
base64 = { version = "0.22.1" }
18 changes: 9 additions & 9 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ args = ["test"]
[tasks.build]
script_runner = "@duckscript"
script = '''
domains = array llm
domains = array llm graph

# if there is no domain passed run for every domain
if is_empty ${1}
Expand All @@ -28,7 +28,7 @@ end
[tasks.release-build]
script_runner = "@duckscript"
script = '''
domains = array llm
domains = array llm graph

# if there is no domain passed run for every domain
if is_empty ${1}
Expand All @@ -44,7 +44,7 @@ end
script_runner = "@duckscript"
script = '''
#!/bin/bash
domains = array llm
domains = array llm graph

# if there is no domain passed run for every domain
if is_empty ${1}
Expand All @@ -60,7 +60,7 @@ end
script_runner = "@duckscript"
script = '''
#!/bin/bash
domains = array llm
domains = array llm graph

# if there is no domain passed run for every domain
if is_empty ${1}
Expand All @@ -75,7 +75,7 @@ end
[tasks.wit]
script_runner = "@duckscript"
script = '''
domains = array llm
domains = array llm graph

# if there is no domain passed run for every domain
if is_empty ${1}
Expand All @@ -91,7 +91,7 @@ end
description = "Builds all test components with golem-cli"
script_runner = "@duckscript"
script = '''
domains = array llm
domains = array llm graph

# if there is no domain passed run for every domain
if is_empty ${1}
Expand Down Expand Up @@ -137,7 +137,7 @@ script = '''

is_portable = eq ${1} "--portable"

targets = array llm_openai llm_anthropic llm_grok llm_openrouter llm_ollama
targets = array llm_openai llm_anthropic llm_grok llm_openrouter llm_ollama graph_arangodb graph_janusgraph graph_neo4j
for target in ${targets}
if is_portable
cp target/wasm32-wasip1/debug/golem_${target}.wasm components/debug/golem_${target}-portable.wasm
Expand All @@ -153,7 +153,7 @@ script = '''

is_portable = eq ${1} "--portable"

targets = array llm_openai llm_anthropic llm_grok llm_openrouter llm_ollama
targets = array llm_openai llm_anthropic llm_grok llm_openrouter llm_ollama graph_arangodb graph_janusgraph graph_neo4j
for target in ${targets}
if is_portable
cp target/wasm32-wasip1/release/golem_${target}.wasm components/release/golem_${target}-portable.wasm
Expand Down Expand Up @@ -229,4 +229,4 @@ foreach ($file in $cargoFiles)
Foreach-Object { $_ -replace "0.0.0", $Env:VERSION } |
Set-Content $file.PSPath
}
'''
'''
154 changes: 154 additions & 0 deletions graph/Makefile.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
[config]
default_to_workspace = false
skip_core_tasks = true

[tasks.build]
run_task = { name = [
"build-arangodb",
"build-janusgraph",
"build-neo4j",
] }

[tasks.build-portable]
run_task = { name = [
"build-arangodb-portable",
"build-janusgraph-portable",
"build-neo4j-portable",
] }

[tasks.release-build]
run_task = { name = [
"release-build-arangodb",
"release-build-janusgraph",
"release-build-neo4j",
] }

[tasks.release-build-portable]
run_task = { name = [
"release-build-arangodb-portable",
"release-build-janusgraph-portable",
"release-build-neo4j-portable",
] }

[tasks.build-arangodb]
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
command = "cargo-component"
args = ["build", "-p", "golem-graph-arangodb"]

[tasks.build-arangodb-portable]
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
command = "cargo-component"
args = ["build", "-p", "golem-graph-arangodb", "--no-default-features"]


[tasks.build-janusgraph]
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
command = "cargo-component"
args = ["build", "-p", "golem-graph-janusgraph"]

[tasks.build-janusgraph-portable]
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
command = "cargo-component"
args = ["build", "-p", "golem-graph-janusgraph", "--no-default-features"]


[tasks.build-neo4j]
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
command = "cargo-component"
args = ["build", "-p", "golem-graph-neo4j"]

[tasks.build-neo4j-portable]
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
command = "cargo-component"
args = ["build", "-p", "golem-graph-neo4j", "--no-default-features"]


[tasks.release-build-arangodb]
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
command = "cargo-component"
args = ["build", "-p", "golem-graph-arangodb", "--release"]

[tasks.release-build-arangodb-portable]
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
command = "cargo-component"
args = ["build", "-p", "golem-graph-arangodb", "--release", "--no-default-features"]


[tasks.release-build-janusgraph]
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
command = "cargo-component"
args = ["build", "-p", "golem-graph-janusgraph", "--release"]

[tasks.release-build-janusgraph-portable]
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
command = "cargo-component"
args = [
"build",
"-p",
"golem-graph-janusgraph",
"--release",
"--no-default-features",
]


[tasks.release-build-neo4j]
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
command = "cargo-component"
args = ["build", "-p", "golem-graph-neo4j", "--release"]

[tasks.release-build-neo4j-portable]
install_crate = { crate_name = "cargo-component", version = "0.20.0" }
command = "cargo-component"
args = ["build", "-p", "golem-graph-neo4j", "--release", "--no-default-features"]

[tasks.wit-update]
install_crate = { crate_name = "wit-deps-cli" }
command = "wit-deps"
args = ["update"]

[tasks.wit]
dependencies = ["wit-update"]

script_runner = "@duckscript"
script = """
modules = array graph arangodb janusgraph neo4j

for module in ${modules}
rm -r ${module}/wit/deps
mkdir ${module}/wit/deps/golem-graph
cp wit/golem-graph.wit ${module}/wit/deps/golem-graph/golem-graph.wit
cp wit/deps/wasi:io ${module}/wit/deps

echo "Copied WIT for module graph::${module}"
end

# Copy WIT files for integration tests for graph
rm -r ../test-graph/wit
mkdir ../test-graph/wit/deps/golem-graph
mkdir ../test-graph/wit/deps/io
cp wit/golem-graph.wit ../test-graph/wit/deps/golem-graph/golem-graph.wit
cp wit/deps/wasi:io/error.wit ../test-graph/wit/deps/io/error.wit
cp wit/deps/wasi:io/poll.wit ../test-graph/wit/deps/io/poll.wit
cp wit/deps/wasi:io/streams.wit ../test-graph/wit/deps/io/streams.wit
cp wit/deps/wasi:io/world.wit ../test-graph/wit/deps/io/world.wit

echo "Copied WIT for module test-graph"
"""

[tasks.build-test-components]
dependencies = ["build"]
install_crate = "cargo-binstall"
description = "Builds graph test components with golem-cli"
script = '''
cargo-binstall golem-cli@1.2.2-dev.11 --locked --no-confirm
cargo-binstall wac-cli --locked --no-confirm
cd ../test-graph

golem-cli --version
golem-cli app clean
golem-cli app build -b arangodb-debug
golem-cli app clean
golem-cli app build -b janusgraph-debug
golem-cli app clean
golem-cli app build -b neo4j-debug
'''
Loading