Skip to content

Commit

Permalink
Add heap_size setting env for engine image (#582)
Browse files Browse the repository at this point in the history
* add heap_size setting env for engine

* rename to min_heap_size
  • Loading branch information
goldmedal authored May 29, 2024
1 parent dfd6d7a commit 33b3b98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ RUN pip3 install -r ./wren-sqlglot-server/requirements.txt
COPY entrypoint.sh ./
RUN chmod +x ./entrypoint.sh

CMD ./entrypoint.sh ${WREN_JAR}
CMD ./entrypoint.sh ${WREN_JAR} ${MAX_HEAP_SIZE} ${MIN_HEAP_SIZE}
5 changes: 4 additions & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
export ENV_MAX_HEAP_SIZE=$2
export ENV_MIN_HEAP_SIZE=$3
python3 wren-sqlglot-server/main.py &

# Required add-opens=java.nio=ALL-UNNAMED for Apache arrow in the Snowflake
java -Dconfig=etc/config.properties \
java -Xmx${ENV_MAX_HEAP_SIZE:-"512m"} -Xms${ENV_MIN_HEAP_SIZE:-"64m"} -Dconfig=etc/config.properties \
--add-opens=java.base/java.nio=ALL-UNNAMED \
-jar $1

0 comments on commit 33b3b98

Please sign in to comment.