Skip to content

Commit

Permalink
Issue 307 - Adding xms and xmx for Cantaloupe heap (#310)
Browse files Browse the repository at this point in the history
* Issue 307 - Adding xms and xmx for Cantaloupe heap

* Added with-contenv but still no joy

* with-contenv added

* Add missing libjpeg-turbo library

* libjpeg-turbo library location

---------

Co-authored-by: Noah W. Smith <[email protected]>
  • Loading branch information
Gavin Morris and noahwsmith authored Nov 30, 2023
1 parent dec5144 commit 13ae1df
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions cantaloupe/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ RUN --mount=type=cache,id=cantaloupe-apk-${TARGETARCH},sharing=locked,target=/va
apk add \
ffmpeg \
openjpeg-tools \
libjpeg-turbo \
&& \
mkdir -p /opt/libjpeg-turbo/lib && \
ln -s /usr/lib/libturbojpeg.so.0 /opt/libjpeg-turbo/lib/libturbojpeg.so && \
create-service-user.sh --name cantaloupe --group jwt /data /opt/cantaloupe/logs && \
cleanup.sh

Expand Down Expand Up @@ -97,6 +100,8 @@ ENV \
CANTALOUPE_FILESYSTEMSOURCE_BASICLOOKUPSTRATEGY_PATH_SUFFIX= \
CANTALOUPE_FILESYSTEMSOURCE_LOOKUP_STRATEGY="BasicLookupStrategy" \
CANTALOUPE_GROKPROCESSOR_PATH_TO_BINARIES= \
CANTALOUPE_HEAP_MIN="3G" \
CANTALOUPE_HEAP_MAX="5G" \
CANTALOUPE_HEAPCACHE_PERSIST_FILESYSTEM_PATHNAME="/data/heap.cache" \
CANTALOUPE_HEAPCACHE_PERSIST="false" \
CANTALOUPE_HEAPCACHE_TARGET_SIZE="2G" \
Expand Down
2 changes: 2 additions & 0 deletions cantaloupe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ additional settings, volumes, ports, etc.
| CANTALOUPE_FILESYSTEMSOURCE_BASICLOOKUPSTRATEGY_PATH_SUFFIX | |
| CANTALOUPE_FILESYSTEMSOURCE_LOOKUP_STRATEGY | "BasicLookupStrategy" |
| CANTALOUPE_GROKPROCESSOR_PATH_TO_BINARIES | |
| CANTALOUPE_HEAP_MIN | "3G" |
| CANTALOUPE_HEAP_MAX | "5G" |
| CANTALOUPE_HEAPCACHE_PERSIST_FILESYSTEM_PATHNAME | "/data/heap.cache" |
| CANTALOUPE_HEAPCACHE_PERSIST | "false" |
| CANTALOUPE_HEAPCACHE_TARGET_SIZE | "2G" |
Expand Down
5 changes: 3 additions & 2 deletions cantaloupe/rootfs/etc/s6-overlay/s6-rc.d/cantaloupe/run
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash
#!/command/with-contenv bash
# shellcheck shell=bash
set -e

# When bind mounting we need to ensure that we
# actually can write to the folder.
chown cantaloupe:cantaloupe /data

exec s6-setuidgid cantaloupe java -Dcantaloupe.config=/opt/cantaloupe/cantaloupe.properties -jar /opt/cantaloupe/cantaloupe.jar
exec with-contenv s6-setuidgid cantaloupe java -Dcantaloupe.config=/opt/cantaloupe/cantaloupe.properties -Xms"${CANTALOUPE_HEAP_MIN}" -Xmx"${CANTALOUPE_HEAP_MAX}" -jar /opt/cantaloupe/cantaloupe.jar

0 comments on commit 13ae1df

Please sign in to comment.