-
Notifications
You must be signed in to change notification settings - Fork 7
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
add doc to setup trino+redis in docker #228
Open
Glebbs
wants to merge
2
commits into
ydb-platform:main
Choose a base branch
from
Glebbs:redis-trino-docker-doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
docs/dockerized_trino_setup_redis_valkey/docker-compose.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3.8' | ||
|
||
services: | ||
trino: | ||
image: trinodb/trino:latest | ||
container_name: trino | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- ./etc:/etc/trino | ||
- ./data:/var/trino/data | ||
depends_on: | ||
- valkey | ||
|
||
valkey: | ||
image: valkey/valkey:8.0.1 | ||
container_name: valkey | ||
ports: | ||
- "6379:6379" |
5 changes: 5 additions & 0 deletions
5
docs/dockerized_trino_setup_redis_valkey/etc/catalog/redis.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
connector.name=redis | ||
redis.table-names=example_table | ||
redis.nodes=valkey:6379 | ||
redis.default-schema=default | ||
redis.table-description-dir=/etc/trino/table-descriptions |
4 changes: 4 additions & 0 deletions
4
docs/dockerized_trino_setup_redis_valkey/etc/config.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
coordinator=true | ||
node-scheduler.include-coordinator=true | ||
http-server.http.port=8080 | ||
discovery.uri=http://localhost:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-server | ||
-Xmx16G | ||
-XX:InitialRAMPercentage=80 | ||
-XX:MaxRAMPercentage=80 | ||
-XX:G1HeapRegionSize=32M | ||
-XX:+ExplicitGCInvokesConcurrent | ||
-XX:+ExitOnOutOfMemoryError | ||
-XX:+HeapDumpOnOutOfMemoryError | ||
-XX:-OmitStackTraceInFastThrow | ||
-XX:ReservedCodeCacheSize=512M | ||
-XX:PerMethodRecompilationCutoff=10000 | ||
-XX:PerBytecodeRecompilationCutoff=10000 | ||
-Djdk.attach.allowAttachSelf=true | ||
-Djdk.nio.maxCachedBufferSize=2000000 | ||
-Dfile.encoding=UTF-8 | ||
# Allow loading dynamic agent used by JOL | ||
-XX:+EnableDynamicAgentLoading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
io.trino=INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node.environment=production | ||
node.id=ffffffff-ffff-ffff-ffff-ffffffffffff | ||
node.data-dir=/var/trino/data |
33 changes: 33 additions & 0 deletions
33
docs/dockerized_trino_setup_redis_valkey/etc/table-descriptions/example_table.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"tableName": "example_table", | ||
"schemaName": "default", | ||
"key": { | ||
"dataFormat": "raw", | ||
"fields": [ | ||
{ | ||
"name": "id", | ||
"type": "varchar" | ||
} | ||
] | ||
}, | ||
"value": { | ||
"dataFormat": "hash", | ||
"fields": [ | ||
{ | ||
"name": "field1", | ||
"type": "varchar", | ||
"mapping": "field1" | ||
}, | ||
{ | ||
"name": "field2", | ||
"type": "varchar", | ||
"mapping": "field2" | ||
}, | ||
{ | ||
"name": "field3", | ||
"type": "varchar", | ||
"mapping": "field3" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Docker compose setup for Trino + Redis/Valkey | ||
|
||
## Official Docs: | ||
- [Trino](https://trino.io/docs/current/connector/redis.html) | ||
- [Valkey (open-source Redis)](https://valkey.io/download/) | ||
|
||
## Project Structure | ||
|
||
``` | ||
./ | ||
├──── data/ | ||
│ └── ... # empty folder for redis usage | ||
├──── etc/ | ||
│ └── catalog/ | ||
│ └── redis.properties | ||
│ └── table-descriptions/ | ||
│ └── example-table.json | ||
│ └── config.properties | ||
│ └── log.properties | ||
│ └── node.properties | ||
│ └── jvm.config | ||
├── docker-compose.yml | ||
└── readme.md | ||
``` | ||
|
||
## Instructions | ||
|
||
### Steps to Run | ||
|
||
1. Pull containers: | ||
|
||
```sh | ||
docker pull trinodb/trino | ||
docker pull valkey/valkey | ||
``` | ||
|
||
2. Start the services: | ||
|
||
```sh | ||
docker-compose up -d | ||
``` | ||
|
||
### Example Usage | ||
|
||
1. Connect to Valkey: | ||
|
||
```sh | ||
docker exec -it valkey redis-cli | ||
``` | ||
|
||
2. Insert some data: | ||
|
||
```r | ||
HSET example_table:1 field1 "Alice" field2 "Wonderland" field3 "25"; | ||
``` | ||
|
||
3. Connect to Trino: | ||
|
||
```sh | ||
docker exec -it trino trino | ||
``` | ||
|
||
4. Run a sample query: | ||
|
||
```sql | ||
SELECT * FROM redis.default.example_table; | ||
``` | ||
|
||
You should see this: | ||
|
||
``` | ||
id | field1 | field2 | field3 | ||
-----------------+--------+-------------+-------- | ||
example_table:2 | Bob | Builderland | 30 | ||
example_table:1 | Alice | Wonderland | 25 | ||
(2 rows) | ||
|
||
Query 20250105_174102_00000_nf6v2, FINISHED, 1 node | ||
Splits: 1 total, 1 done (100.00%) | ||
0.40 [2 rows, 0B] [5 rows/s, 0B/s] | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Заведи, пожалуйста, папку "redis" по пути https://github.com/ydb-platform/fq-connector-go/tree/main/app/server/datasource и сложи всё эти файлы туда. Так мне будет легче найти, если что. И там будет всё твоё хозяйство.
Также, на будущее, понадобится добавить эти файлы частично или полностью в окружение для интеграционных тестов. Там docker-compose файл общий: https://github.com/ydb-platform/fq-connector-go/blob/main/tests/infra/datasource/docker-compose.yaml