Author SHA1 Message Date
Tobias Schöneberg afdc48d2d7 41-docker - Allow us to obtain java heap-dumps in case of an OutOfMemoryError
* add MaxRAMFraction so java uses the docker image's memory completely (and not just 1/4)

https://github.com/metasfresh/metasfresh-docker/issues/41
2019-01-23 10:44:48 +01:00
Tobias Schöneberg b8af7dd9e8 41-docker - Allow us to obtain java heap-dumps in case of an OutOfMemoryError
* add dedicated volumes for app and webapi
* bonus: derive memory settings from docker instead of setting them statically

https://github.com/metasfresh/metasfresh-docker/issues/41
2019-01-22 13:17:13 +01:00
35 changed files with 196 additions and 5892 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
FROM metasfresh/metasfresh-app:5.92
FROM metasfresh/metasfresh-app:5.87
COPY sources/configs/* /opt/metasfresh/
COPY sources/start_app.sh /opt/metasfresh/
+1 -2
View File
@@ -55,8 +55,7 @@ run_metasfresh()
cd /opt/metasfresh/ && java \
-Dsun.misc.URLClassPath.disableJarChecking=true \
-Xmx1024M -XX:MaxPermSize=512M \
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/metasfresh/heapdump \
-Xmx1024M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError \
-DPropertyFile=/opt/metasfresh/metasfresh.properties \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8788 \
-Dcom.sun.net.ssl.enableECC=false \
+1 -1
View File
@@ -1,4 +1,4 @@
FROM metasfresh/metasfresh-db:5.92
FROM metasfresh/metasfresh-db:5.87
RUN localedef -i de_DE -c -f UTF-8 -A /usr/share/locale/locale.alias de_DE.UTF-8
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
-2
View File
@@ -25,7 +25,6 @@ app:
restart: always
volumes:
- ./volumes/app/log:/opt/metasfresh/log:rw
- ./volumes/app/heapdump:/opt/metasfresh/heapdump:rw
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
environment:
@@ -47,7 +46,6 @@ webapi:
restart: always
volumes:
- ./volumes/webapi/log:/opt/metasfresh-webui-api/log:rw
- ./volumes/webapi/heapdump:/opt/metasfresh-webui-api/heapdump:rw
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
webui:
+1 -14
View File
@@ -1,9 +1,5 @@
FROM ubuntu:16.04
# to make sure that the cache is only used during one day, run docker build --build-arg CACHEBUST=$(date "+%Y-%m-%d")
# that way we should get the latest updates since the release of our base image
# thx to https://github.com/moby/moby/issues/1996#issuecomment-185872769
ARG CACHEBUST=1
RUN apt update && apt -y full-upgrade
RUN apt autoclean && apt update
@@ -16,17 +12,8 @@ RUN apt -y install netcat \
&& apt -y autoclean
RUN mkdir -p /opt/metasfresh
RUN curl https://repo.metasfresh.com/content/repositories/mvn-release-releases/de/metas/dist/metasfresh-dist-dist/5.92.2-912+release/metasfresh-dist-dist-5.92.2-912+release-dist.tar.gz \
RUN curl https://repo.metasfresh.com/content/repositories/mvn-release-releases/de/metas/dist/metasfresh-dist-dist/5.87.2-890+release/metasfresh-dist-dist-5.87.2-890+release-dist.tar.gz \
| tar -xzC /opt/metasfresh/
RUN mkdir -p /opt/metasfresh/heapdump
# Explode the uber jar to make it easier to work with the docker image;
# e.g. with the exploded uber jar, we can later copy or overwrite config files into the docker image that change the applications behavior.
# Note that the skript start_materialdispo_docker.sh is adapted to the exploded jar.
# Note2 that we need unzip; jar doesn't work, thx to https://stackoverflow.com/a/39653862/1012103
RUN cd /opt/metasfresh \
&& (unzip -q /opt/metasfresh/metasfresh_server.jar || echo "Ignore exit code $? because spring boot's uber jar starts with a shell script") \
&& rm /opt/metasfresh/metasfresh_server.jar
COPY sources/configs/* /opt/metasfresh/
COPY sources/configs/local_settings.properties /root/
@@ -1,8 +0,0 @@
# When the docker image is build, then this file overrides the default file which is present within the container.
#
# see https://www.mchange.com/projects/c3p0/index.html
c3p0.initialPoolSize=5
c3p0.minPoolSize=5
c3p0.maxPoolSize=25
c3p0.checkoutTimeout=0
+8 -5
View File
@@ -6,6 +6,7 @@ set -u
DB_HOST=db
APP_HOST=app
set_properties()
{
local prop_file="$1"
@@ -53,17 +54,19 @@ run_metasfresh()
# info: https://docs.oracle.com/cd/E26362_01/E40761/html/known-bugs-issues.html
# https://stackoverflow.com/a/19379760
#2019-01-29 jb: added '-XX:HeapDumpPath=/opt/metasfresh/heapdump' to java opts
# gh issue: https://github.com/metasfresh/metasfresh-docker/issues/41
# thx to
# https://blog.csanchez.org/2017/05/31/running-a-jvm-in-a-container-without-getting-killed/
MEMORY_PARAMS="-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1"
cd /opt/metasfresh/ && java \
-Dsun.misc.URLClassPath.disableJarChecking=true \
-Xmx1024M -XX:MaxPermSize=512M \
$MEMORY_PARAMS \
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/metasfresh/heapdump \
-DPropertyFile=/opt/metasfresh/metasfresh.properties \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8788 \
-Dcom.sun.net.ssl.enableECC=false \
org.springframework.boot.loader.JarLauncher
-jar metasfresh_server.jar
}
run_install
+4 -19
View File
@@ -1,9 +1,5 @@
FROM ubuntu:16.04
# to make sure that the cache is only used during one day, run docker build --build-arg CACHEBUST=$(date "+%Y-%m-%d")
# that way we should get the latest updates since the release of our base image
# thx to https://github.com/moby/moby/issues/1996#issuecomment-185872769
ARG CACHEBUST=1
RUN apt update && apt -y full-upgrade
RUN apt autoclean && apt update
@@ -12,26 +8,15 @@ RUN apt -y install netcat \
&& apt -y install curl \
&& apt -y install openjdk-8-jdk-headless \
&& apt -y install postgresql-client-9.5 \
&& apt -y install unzip \
&& apt -y autoremove \
&& apt -y autoclean
COPY sources/configs/local_settings.properties /root/
RUN mkdir -p /opt/metasfresh-webui-api/metasfresh-webui-api \
&& mkdir -p /opt/metasfresh-webui-api/log \
&& mkdir -p /opt/metasfresh-webui-api/heapdump
RUN curl https://repo.metasfresh.com/content/repositories/mvn-release/de/metas/ui/web/metasfresh-webui-api/5.92.2-669+release/metasfresh-webui-api-5.92.2-669+release.jar \
--output /opt/metasfresh-webui-api/metasfresh-webui-api.jar
# Explode the uber jar to make it easier to work with the docker image;
# e.g. with the exploded uber jar, we can later copy or overwrite config files into the docker image that change the applications behavior.
# Note that the skript start_materialdispo_docker.sh is adapted to the exploded jar.
# Note2 that we need unzip; jar doesn't work, thx to https://stackoverflow.com/a/39653862/1012103
RUN cd /opt/metasfresh/metasfresh-webui-api \
&& (unzip -q /opt/metasfresh/metasfresh-webui-api/metasfresh-webui-api || echo "Ignore exit code $? because spring boot's uber jar starts with a shell script") \
&& rm /opt/metasfresh/metasfresh-webui-api/metasfresh-webui-api
&& mkdir -p /opt/metasfresh-webui-api/log
RUN curl https://repo.metasfresh.com/content/repositories/mvn-release/de/metas/ui/web/metasfresh-webui-api/5.87.2-651+release/metasfresh-webui-api-5.87.2-651+release.jar \
--output /opt/metasfresh-webui-api/metasfresh-webui-api.jar \
&& chmod 750 /opt/metasfresh-webui-api/metasfresh-webui-api.jar
COPY sources/configs/* /opt/metasfresh-webui-api/
COPY sources/start_webapi.sh /opt/metasfresh-webui-api/
@@ -1,8 +0,0 @@
# When the docker image is build, then this file overrides the default file which is present within the container.
#
# see https://www.mchange.com/projects/c3p0/index.htmlc3p0.initialPoolSize=10
c3p0.initialPoolSize=10
c3p0.minPoolSize=10
c3p0.maxPoolSize=45
c3p0.checkoutTimeout=0
+20 -5
View File
@@ -1,10 +1,23 @@
#!/bin/bash
set -e
#set -x
DB_HOST=db
APP_HOST=app
echo_variable_values()
{
echo "*************************************************************"
echo "Display the variable values we run with"
echo "*************************************************************"
echo "Note: all these variables can be set using the -e parameter."
echo ""
echo "DB_HOST=${DB_HOST}"
echo "APP_HOST=${APP_HOST}"
echo ""
}
set_properties()
{
local prop_file="$1"
@@ -22,22 +35,24 @@ wait_dbms()
done
}
#2019-01-29 jb: added '-XX:HeapDumpPath=/opt/metasfresh/heapdump' to java opts
# gh issue: https://github.com/metasfresh/metasfresh-docker/issues/41
# thx to
# https://blog.csanchez.org/2017/05/31/running-a-jvm-in-a-container-without-getting-killed/
MEMORY_PARAMS="-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=1"
run_metasfresh()
{
cd /opt/metasfresh-webui-api/ && java -Dsun.misc.URLClassPath.disableJarChecking=true \
-Xmx1024M -XX:MaxPermSize=512M \
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/metasfresh/heapdump \
$MEMORY_PARAMS \
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/metasfresh-webui-api/heapdump \
-DPropertyFile=/opt/metasfresh-webui-api/metasfresh.properties \
-Dcom.sun.management.jmxremote.port=1618 \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8789 \
org.springframework.boot.loader.JarLauncher
-jar metasfresh-webui-api.jar
}
echo_variable_values
set_properties /opt/metasfresh-webui-api/metasfresh.properties
set_properties /opt/metasfresh-webui-api/local_settings.properties
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -5,11 +5,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta name="mobile-web-app-capable" content="yes">
<link href="https://fonts.googleapis.com/css?family=Roboto:400,400i,500,500i" rel="stylesheet">
<link rel="icon" type="image/png" href="/favicon.png">
<title>Metasfresh</title>
</head>
<body>
<div id="root"></div>
<script src="/config.js"></script>
<script type="text/javascript" src="/bundle-4a65994cd6e363843353-git-36132f4.js"></script></body>
<script type="text/javascript" src="/bundle-813c2d8e3fcc7aa2f32e-git-62af4b2.js"></script></body>
</html>
+5 -5
View File
@@ -1,10 +1,10 @@
{
"build": {
"releaseVersion": "5.92.2-293+release",
"jenkinsBuildUrl": "https://jenkins.metasfresh.com/job/metasfresh-webui-frontend/job/release/293/",
"jenkinsBuildNo": "293",
"releaseVersion": "5.87.2-276+release",
"jenkinsBuildUrl": "https://jenkins.metasfresh.com/job/metasfresh-webui-frontend/job/release/276/",
"jenkinsBuildNo": "276",
"jenkinsJobName": "metasfresh-webui-frontend/release",
"jenkinsBuildTag": "jenkins-metasfresh-webui-frontend-release-293"
"gitSHA1": "36132f4175cad8c99335bac536a8a562380ffbeb"
"jenkinsBuildTag": "jenkins-metasfresh-webui-frontend-release-276"
"gitSHA1": "62af4b2015514c40d17ea446a353537cf63a473b"
}
}
File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 95 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 90 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 95 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 90 KiB

+1 -1
View File
@@ -1,4 +1,4 @@
FROM metasfresh/metasfresh-webapi:5.92
FROM metasfresh/metasfresh-webapi:5.87
COPY sources/configs/* /opt/metasfresh-webui-api/
COPY sources/start_webapi.sh /opt/metasfresh-webui-api/
+1 -2
View File
@@ -25,8 +25,7 @@ wait_dbms()
run_metasfresh()
{
cd /opt/metasfresh-webui-api/ && java -Dsun.misc.URLClassPath.disableJarChecking=true \
-Xmx1024M -XX:MaxPermSize=512M \
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/metasfresh-webui-api/heapdump \
-Xmx1024M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError \
-DPropertyFile=/opt/metasfresh-webui-api/metasfresh.properties \
-Dcom.sun.management.jmxremote.port=1618 \
-Dcom.sun.management.jmxremote.authenticate=false \
+1 -1
View File
@@ -1,4 +1,4 @@
FROM metasfresh/metasfresh-webui:5.92
FROM metasfresh/metasfresh-webui:5.87
COPY sources/configs/config.js /opt/metasfresh-webui-frontend/dist/