Skip to content

Commit 4ff4142

Browse files
author
julien
committed
Added docker example
1 parent 4daf90e commit 4ff4142

File tree

7 files changed

+84
-8
lines changed

7 files changed

+84
-8
lines changed

.github/workflows/early-access.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
2323
sonatype-username: ${{ secrets.SONATYPE_USERNAME }}
2424
sonatype-password: ${{ secrets.SONATYPE_PASSWORD }}
25-
github-token: ${{ secrets.GITHUB_TOKEN }}
25+
github-token: ${{ secrets.GIT_ACCESS_TOKEN }}
2626
slack-webhook: ${{ secrets.JRELEASER_SLACK_WEBHOOK }}
2727
codecov-token: ${{ secrets.CODECOV_TOKEN }}
2828

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
2929
sonatype-username: ${{ secrets.SONATYPE_USERNAME }}
3030
sonatype-password: ${{ secrets.SONATYPE_PASSWORD }}
31-
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
github-token: ${{ secrets.GIT_ACCESS_TOKEN }}
3232
slack-webhook: ${{ secrets.JRELEASER_SLACK_WEBHOOK }}
3333
codecov-token: ${{ secrets.CODECOV_TOKEN }}
3434

README.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For macOS: `brew install trino`
2626

2727
2. Unzip the release without any directory structure under `<trino>/plugin/redisearch`:
2828
+
29-
[source,bash,subs="verbatim,attributes"]
29+
[source,console,subs="verbatim,attributes"]
3030
----
3131
unzip -j trino-redisearch-{project-version}.zip -d /opt/trino/plugin/redisearch
3232
----
@@ -44,19 +44,19 @@ redisearch.uri=redis://localhost:6379
4444

4545
1. Start Trino server:
4646
+
47-
[source,bash]
47+
[source,console]
4848
----
4949
`trino-server start`
5050
----
5151
2. Connect to Trino using the CLI:
5252
+
53-
[source,bash]
53+
[source,console]
5454
----
5555
`trino --catalog redisearch --schema default`
5656
----
5757
3. Run a SQL query:
5858
+
59-
[source,bash]
59+
[source,console]
6060
----
6161
trino:default> select count(*) from myIdx;
6262
_col0
@@ -77,7 +77,7 @@ Follow these steps to connect Tableau: https://help.tableau.com/current/pro/desk
7777

7878
Run these commands to build the Trino connector for RediSearch from source:
7979

80-
[source,bash]
80+
[source,console]
8181
----
8282
git clone https://github.com/redis-field-engineering/sql-redis.git
8383
cd sql-redis

docker/docker-compose.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: '3.6'
2+
services:
3+
trino:
4+
image: trinodb/trino
5+
hostname: trino
6+
container_name: trino
7+
ports:
8+
- "8080:8080"
9+
networks:
10+
- localnet
11+
volumes:
12+
- ../subprojects/trino-redisearch/build/distributions/trino-redisearch:/usr/lib/trino/plugin/redisearch
13+
- ./redisearch.properties:/etc/trino/catalog/redisearch.properties
14+
15+
# Redis Modules
16+
redismod:
17+
image: "redislabs/redismod"
18+
hostname: redismod
19+
container_name: redismod
20+
networks:
21+
- localnet
22+
ports:
23+
- "6379:6379"
24+
restart: always
25+
26+
networks:
27+
localnet:
28+
attachable: true

docker/redisearch.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
connector.name=redisearch
2+
redisearch.uri=redis://redismod:6379

docker/run.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
set -e
4+
(
5+
if lsof -Pi :6379 -sTCP:LISTEN -t >/dev/null ; then
6+
echo "Please terminate the local redis-server on 6379"
7+
exit 1
8+
fi
9+
if lsof -Pi :8080 -sTCP:LISTEN -t >/dev/null ; then
10+
echo "Please terminate the local server on 8080"
11+
exit 1
12+
fi
13+
)
14+
15+
echo "Building the Trino connector for RediSearch"
16+
(
17+
cd ..
18+
./gradlew clean build -x test
19+
unzip -j ./subprojects/trino-redisearch/build/distributions/trino-redisearch-*.zip -d ./subprojects/trino-redisearch/build/distributions/trino-redisearch
20+
)
21+
22+
echo "Starting docker ."
23+
docker-compose up -d
24+
25+
function clean_up {
26+
echo -e "\n\nSHUTTING DOWN\n\n"
27+
docker-compose down
28+
if [ -z "$1" ]
29+
then
30+
echo -e "Bye!\n"
31+
else
32+
echo -e "$1"
33+
fi
34+
}
35+
36+
sleep 5
37+
38+
trap clean_up EXIT
39+
40+
sleep 1
41+
42+
redis-cli FT.CREATE beers ON HASH PREFIX 1 beer: SCHEMA id TAG SORTABLE brewery_id TAG SORTABLE name TEXT SORTABLE abv NUMERIC SORTABLE descript TEXT style_name TAG SORTABLE cat_name TAG SORTABLE
43+
44+
riot-file import http://developer.redis.com/riot/beers.json hset --keyspace beer --keys id
45+
46+
docker exec -it trino trino --catalog redisearch --schema default

jreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ release:
2121
formatted: ALWAYS
2222
format: '- {{commitShortHash}} {{commitTitle}}'
2323
contributors:
24-
format: '- {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}'
24+
enabled: false
2525
labelers:
2626
- label: 'merge_pull'
2727
title: 'Merge pull'

0 commit comments

Comments
 (0)