Skip to content
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 sample Docker file #21

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions contrib/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# From https://prestodb.io/docs/current/installation/deployment.html#an-example-deployment-with-docker

FROM openjdk:8-jre

# Presto version will be passed in at build time
ARG PRESTO_VERSION

# Set the URL to download
ARG PRESTO_BIN=https://repo1.maven.org/maven2/com/facebook/presto/presto-server/${PRESTO_VERSION}/presto-server-${PRESTO_VERSION}.tar.gz

# Update the base image OS and install wget and python
RUN apt-get update
RUN apt-get install -y wget python less

# Download Presto and unpack it to /opt/presto
RUN wget --quiet ${PRESTO_BIN}
RUN mkdir -p /opt
RUN tar -xf presto-server-${PRESTO_VERSION}.tar.gz -C /opt
RUN rm presto-server-${PRESTO_VERSION}.tar.gz
RUN ln -s /opt/presto-server-${PRESTO_VERSION} /opt/presto

# Download the Presto CLI and put it in the image
RUN wget --quiet https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/${PRESTO_VERSION}/presto-cli-${PRESTO_VERSION}-executable.jar
RUN mv presto-cli-${PRESTO_VERSION}-executable.jar /usr/local/bin/presto
RUN chmod +x /usr/local/bin/presto

# Copy configuration files on the host into the image
COPY plugin /opt/presto/plugin
COPY etc /opt/presto/etc

# Specify the entrypoint to start
ENTRYPOINT ./opt/presto/bin/launcher run
30 changes: 30 additions & 0 deletions contrib/docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Sample Docker File

It can be difficult to test h3-presto if you don't have a Presto server running already. These instructions help you get a Presto node with h3-presto running for development. (These instructions are based on the [Presto Docker deployment](https://prestodb.io/docs/current/installation/deployment.html#an-example-deployment-with-docker) instructions.)

To build, starting from the root of the repository:

```sh
mvn clean package -DskipTests
cd contrib/docker
cp ../../target/h3-presto-4.0.0.jar plugin/h3/h3-presto-4.0.0.jar
docker build -f Dockerfile -t presto --build-arg PRESTO_VERSION=0.286 .
```

To run:

```sh
docker run -p 8080:8080 --rm -it presto
```

And then in another terminal, run the [Presto command line interface](https://prestodb.io/docs/current/installation/cli.html):

```sh
./presto
```

And try a sample query:

```sql
select h3_latlng_to_cell(0,0,0);
```
8 changes: 8 additions & 0 deletions contrib/docker/etc/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=2GB
query.max-memory-per-node=1GB
discovery-server.enabled=false
#discovery.uri=http://example.net:8080

8 changes: 8 additions & 0 deletions contrib/docker/etc/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-server
-Xmx8G
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+UseGCOverheadLimit
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
3 changes: 3 additions & 0 deletions contrib/docker/etc/node.properties
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=/data
Empty file.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<presto.version>0.277</presto.version>
<presto.version>0.286</presto.version>
<junit-jupiter.version>5.8.2</junit-jupiter.version>
<maven-shade-plugin.version>3.2.4</maven-shade-plugin.version>
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
Expand Down
Loading