Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
presto: add docker-compose setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sirupsen committed May 27, 2022
1 parent d4543bc commit 46452cd
Show file tree
Hide file tree
Showing 13 changed files with 797 additions and 715 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apt-get update && apt-get install -y \
RUN pip install --no-cache-dir poetry==1.1.13
COPY . /app
WORKDIR /app
# For now while we are in heavy development we install the latest with Poetry
# For now while we are in heavy development we install the latest with Poetry
# and execute directly with Poetry. Later, we'll move to the released Pip package.
RUN poetry install -E preql -E mysql -E pgsql -E snowflake
RUN poetry install
ENTRYPOINT ["poetry", "run", "python3", "-m", "data_diff"]
25 changes: 25 additions & 0 deletions dev/Dockerfile.prestosql.340
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM openjdk:11-jdk-slim-buster

ENV PRESTO_VERSION=340
ENV PRESTO_SERVER_URL=https://repo1.maven.org/maven2/io/prestosql/presto-server/${PRESTO_VERSION}/presto-server-${PRESTO_VERSION}.tar.gz
ENV PRESTO_CLI_URL=https://repo1.maven.org/maven2/io/prestosql/presto-cli/${PRESTO_VERSION}/presto-cli-${PRESTO_VERSION}-executable.jar
ENV PRESTO_HOME=/opt/presto
ENV PATH=${PRESTO_HOME}/bin:${PATH}

WORKDIR $PRESTO_HOME

RUN set -xe \
&& apt-get update \
&& apt-get install -y curl less python \
&& curl -sSL $PRESTO_SERVER_URL | tar xz --strip 1 \
&& curl -sSL $PRESTO_CLI_URL > ./bin/presto \
&& chmod +x ./bin/presto \
&& apt-get remove -y curl \
&& rm -rf /var/lib/apt/lists/*

VOLUME /data

EXPOSE 8080

ENTRYPOINT ["launcher"]
CMD ["run"]
1 change: 1 addition & 0 deletions dev/presto-conf/standalone/catalog/jmx.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
connector.name=jmx
1 change: 1 addition & 0 deletions dev/presto-conf/standalone/catalog/memory.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
connector.name=memory
1 change: 1 addition & 0 deletions dev/presto-conf/standalone/catalog/tpcds.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
connector.name=tpcds
1 change: 1 addition & 0 deletions dev/presto-conf/standalone/catalog/tpch.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
connector.name=tpch
8 changes: 8 additions & 0 deletions dev/presto-conf/standalone/config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
query.max-memory=5GB
query.max-memory-per-node=1GB
query.max-total-memory-per-node=2GB
discovery-server.enabled=true
discovery.uri=http://127.0.0.1:8080
9 changes: 9 additions & 0 deletions dev/presto-conf/standalone/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-server
-Xmx16G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
-XX:OnOutOfMemoryError=kill -9 %p
1 change: 1 addition & 0 deletions dev/presto-conf/standalone/log.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.facebook.presto=INFO
3 changes: 3 additions & 0 deletions dev/presto-conf/standalone/node.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node.environment=production
node.data-dir=/data
node.id=standalone
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ services:
networks:
- local

# prestodb.dbapi.connect(host="127.0.0.1", user="presto").cursor().execute('SELECT * FROM system.runtime.nodes')
presto:
build:
context: ./dev
dockerfile: ./Dockerfile.prestosql.340
volumes:
- ./dev/presto-conf/standalone:/opt/presto/etc:ro
ports:
- '8080:8080'
tty: true
networks:
- local

volumes:
postgresql-data:
mysql-data:
Expand Down
Loading

0 comments on commit 46452cd

Please sign in to comment.