Skip to content

Commit 7770b76

Browse files
author
julien
committed
Added docker build and push action
1 parent 4ff4142 commit 7770b76

26 files changed

+196
-125
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,13 @@ jobs:
3939
name: test-reports
4040
path: |
4141
build/reports/aggregate-tests/
42+
43+
- name: Login to DockerHub
44+
uses: docker/login-action@v1
45+
with:
46+
username: ${{ secrets.DOCKER_USERNAME }}
47+
password: ${{ secrets.DOCKER_PASSWORD }}
48+
49+
- name: Build/Push Docker image
50+
run: |
51+
./gradlew dockerPush -x test -S

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id 'com.palantir.docker' apply false
3+
}
4+
15
config {
26
info {
37
description = 'SQL interface for RediSearch'

docker/docker-compose.yml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
version: '3.6'
22
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
143

15-
# Redis Modules
164
redismod:
17-
image: "redislabs/redismod"
5+
image: redislabs/redismod
186
hostname: redismod
197
container_name: redismod
208
networks:
@@ -23,6 +11,27 @@ services:
2311
- "6379:6379"
2412
restart: always
2513

14+
trino:
15+
image: jruaux/trino-redisearch
16+
hostname: trino
17+
container_name: trino
18+
ports:
19+
- "8080:8080"
20+
networks:
21+
- localnet
22+
depends_on:
23+
- redismod
24+
environment:
25+
REDISEARCH_URI: 'redis://redismod:6379'
26+
27+
riot-file:
28+
image: jruaux/riot-file
29+
networks:
30+
- localnet
31+
command: -h redismod import http://developer.redis.com/riot/beers.json hset --keyspace beer --keys id
32+
depends_on:
33+
- redismod
34+
2635
networks:
2736
localnet:
2837
attachable: true

docker/redisearch.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.

docker/run.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ if lsof -Pi :8080 -sTCP:LISTEN -t >/dev/null ; then
1212
fi
1313
)
1414

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-
2215
echo "Starting docker ."
2316
docker-compose up -d
2417

@@ -39,8 +32,6 @@ trap clean_up EXIT
3932

4033
sleep 1
4134

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
35+
docker-compose exec redismod /usr/local/bin/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
4536

4637
docker exec -it trino trino --catalog redisearch --schema default

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ group=com.redis
22

33
bootPluginVersion=2.6.1
44
dependencyPluginVersion=1.0.11.RELEASE
5+
dockerPluginVersion=0.32.0
56
kordampBuildVersion=2.6.0
67
kordampPluginVersion=0.47.0
78

89
lettucemodVersion=1.8.1
910
testcontainersRedisVersion=1.4.6
1011
jredisearchVersion=2.2.0
11-
trinoVersion=367
12+
trinoVersion=370
1213
ulidVersion=4.1.2

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ buildscript {
99
classpath "org.kordamp.gradle:java-project-gradle-plugin:$kordampPluginVersion"
1010
classpath "org.springframework.boot:spring-boot-gradle-plugin:$bootPluginVersion"
1111
classpath "io.spring.gradle:dependency-management-plugin:$dependencyPluginVersion"
12+
classpath "com.palantir.gradle.docker:gradle-docker:$dockerPluginVersion"
1213
}
1314
}
1415

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ARG TRINO_VERSION
2+
3+
FROM trinodb/trino:${TRINO_VERSION}
4+
5+
ARG BUILD_VERSION
6+
7+
COPY setup/trino-redisearch-${BUILD_VERSION}.tar /tmp/trino-redisearch.tar
8+
9+
USER root:root
10+
RUN \
11+
yum -y -q install gettext && \
12+
tar xvf /tmp/trino-redisearch.tar -C /tmp && \
13+
mkdir /usr/lib/trino/plugin/redisearch && \
14+
find /tmp/trino-redisearch-* -type f -exec mv -i {} /usr/lib/trino/plugin/redisearch \; && \
15+
chown -R trino:trino /usr/lib/trino/plugin/redisearch
16+
17+
COPY --chown=trino:trino setup/etc /etc/trino
18+
COPY setup/template setup/setup.sh /tmp/
19+
20+
RUN chmod 0777 /tmp/setup.sh
21+
22+
USER trino:trino
23+
24+
CMD ["/tmp/setup.sh"]
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://docker.for.mac.host.internal:6379
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#single node install config
2+
coordinator=true
3+
node-scheduler.include-coordinator=true
4+
http-server.http.port=8080
5+
discovery.uri=http://localhost:8080

0 commit comments

Comments
 (0)