Skip to content

Commit

Permalink
Merge pull request #89 from oramasearch/feat/fix-locks
Browse files Browse the repository at this point in the history
Move to tokio RwLock. Use tokio mpsc. Add metrics
  • Loading branch information
allevo authored Jan 27, 2025
2 parents fe5a3e9 + 2824c0c commit f2723b7
Show file tree
Hide file tree
Showing 41 changed files with 2,152 additions and 1,065 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ flamegraph.svg
.envrc

.env

log.log
13 changes: 13 additions & 0 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ quick-js = "0.4.1"

# Tracing
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
duration-string = "0.5.2"
deno_core = "0.330.0"
serde_v8 = "0.239.0"
Expand Down Expand Up @@ -120,9 +120,9 @@ path = "src/bin/oramacore.rs"
name = "embeddings"
path = "src/bin/embeddings/embeddings.rs"

[[bench]]
name = "phrase_match"
harness = false
# [[bench]]
# name = "phrase_match"
# harness = false

[features]
default = ["benchmarking"]
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ hurl --very-verbose --test --variables-file api-test.hurl.property embedding-api

NB: you need to have the server running before running the tests.

## Opentelemetry

OramaCore integrates Grafana and Prometheus for monitoring and collenting metrics.
Make sure your OramaCore configuration enables the prometheus exporter (`http.with_prometheus: true`).
Change the `otel/prometheus.yml` file to match your IP configuration and run the following command:
```
docker run --rm --name prometheus -d -p 9090:9090 -v $(pwd)/otel/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
docker run --rm --name grafana -d -p 3000:3000 grafana/grafana
```

We have a Grafana dashboard available at `otel/OramaCore Dashboard.json`. You can import it into your Grafana instance.

NB: the default username and password for Grafana are `admin` and `admin`.

## License

[AGPLv3](/LICENSE.md)
File renamed without changes.
11 changes: 9 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ http:
allow_cors: true
with_prometheus: true

log:
# Comment the following line to disable the logging
file_path: "./log.log"

writer_side:
output: in-memory
config:
Expand All @@ -17,13 +21,16 @@ writer_side:
# The default embedding model used to calculate the embeddings
# if not specified in the collection creation
default_embedding_model: MultilingualE5Small
# The maximum number of request to javascript runtime that can be stored in the queue
# NB: the elements are in memory, so be careful with this value
javascript_queue_limit: 50

reader_side:
input: in-memory
config:
data_dir: ./.data/reader
# The number of the write operation after the read side will commit the changes
insert_batch_commit_size: 300
insert_batch_commit_size: 3000

ai_server:
scheme: http
Expand All @@ -37,7 +44,7 @@ ai_server:
default_model_group: small
dynamically_load_models: false
execution_providers:
- CUDAExecutionProvider
# - CUDAExecutionProvider
- CPUExecutionProvider
total_threads: 8
LLMs:
Expand Down
Loading

0 comments on commit f2723b7

Please sign in to comment.