mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-08 22:21:23 +00:00
Add support for local clickhouse in docker (#48)
Caveats / Deficiencies This is not a perfect match for the server clickhouse config since we're using MergeTree() as the engine. It seemed like it was going to be much more complex to exactly match production, but I may have missed something obvious. The create tables sql only seems to be run on a completely fresh install.
This commit is contained in:
parent
723b753596
commit
6a65576136
2 changed files with 47 additions and 0 deletions
34
.docker/scripts/clickhouse/001-create-tables.sql
Normal file
34
.docker/scripts/clickhouse/001-create-tables.sql
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
CREATE TABLE IF NOT EXISTS default.events
|
||||
(
|
||||
-- Shared
|
||||
`id` UUID,
|
||||
`orgId` String,
|
||||
`userId` String,
|
||||
`timestamp` Int32,
|
||||
`type` String,
|
||||
|
||||
-- App
|
||||
`appVersion` String,
|
||||
`vscodeVersion` String,
|
||||
`platform` String,
|
||||
`editorName` String,
|
||||
`language` String,
|
||||
`mode` String,
|
||||
|
||||
-- Task
|
||||
`taskId` Nullable(String),
|
||||
`apiProvider` Nullable(String),
|
||||
`modelId` Nullable(String),
|
||||
`diffStrategy` Nullable(String),
|
||||
`isSubtask` Nullable(Bool),
|
||||
|
||||
-- Completion
|
||||
`inputTokens` Nullable(Int32),
|
||||
`outputTokens` Nullable(Int32),
|
||||
`cacheReadTokens` Nullable(Int32),
|
||||
`cacheWriteTokens` Nullable(Int32),
|
||||
`cost` Nullable(Float32)
|
||||
)
|
||||
ENGINE = MergeTree()
|
||||
ORDER BY (id, type, timestamp)
|
||||
SETTINGS index_granularity = 8192;
|
||||
|
|
@ -11,3 +11,16 @@ services:
|
|||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DATABASES=roo_code_development,roo_code_test
|
||||
clickhouse:
|
||||
image: clickhouse/clickhouse-server
|
||||
ports:
|
||||
- "8123:8123"
|
||||
- "9000:9000"
|
||||
volumes:
|
||||
- ./.docker/clickhouse:/var/lib/clickhouse/
|
||||
- ./.docker/clickhouse-logs:/var/log/clickhouse-server/
|
||||
- ./.docker/scripts/clickhouse:/docker-entrypoint-initdb.d
|
||||
environment:
|
||||
- CLICKHOUSE_DB=default
|
||||
- CLICKHOUSE_USER=default
|
||||
- CLICKHOUSE_PASSWORD=password
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue