Merge pull request #139 from overleaf/spd-revert-debugging

Revert debugging additions
This commit is contained in:
Simon Detheridge 2021-07-19 12:23:19 +01:00 committed by GitHub
commit 54665b1aea
5 changed files with 8 additions and 69 deletions

View file

@ -1,5 +1,4 @@
*
!install-all-dev-packages.sh
!start.sh
!/conf
!/lib

View file

@ -2,28 +2,8 @@
FROM maven:3-jdk-11 as base
RUN apt-get update && apt-get install -y make git sqlite3 build-essential dpkg-dev
RUN echo "deb-src http://deb.debian.org/debian buster main" >> /etc/apt/sources.list && \
echo "deb-src http://deb.debian.org/debian buster-updates main" >> /etc/apt/sources.list && \
echo "deb-src http://security.debian.org/debian-security buster/updates main" >> /etc/apt/sources.list
RUN mkdir -p /build
WORKDIR /build
RUN apt-get update && \
apt-get -y source libjemalloc-dev && \
apt-get -y build-dep libjemalloc-dev && \
echo "override_dh_auto_configure:" >> jemalloc-5.1.0/debian/rules && \
echo "\tdh_auto_configure -- --enable-debug --enable-fill --enable-prof --enable-stat" >> jemalloc-5.1.0/debian/rules && \
cat jemalloc-5.1.0/debian/rules
WORKDIR /build/jemalloc-5.1.0
RUN dpkg-buildpackage
ADD install-all-dev-packages.sh /install-all-dev-packages.sh
RUN rm -rf /var/lib/apt/lists
RUN apt-get update && apt-get install -y make git sqlite3 \
&& rm -rf /var/lib/apt/lists
COPY vendor/envsubst /opt/envsubst
RUN chmod +x /opt/envsubst
@ -43,12 +23,9 @@ RUN make package \
-name 'writelatex-git-bridge*jar-with-dependencies.jar' \
-exec mv {} /git-bridge.jar \;
FROM builder
# FROM openjdk:11-jre <-- disabled while we are memory profiling
FROM openjdk:11-jre
WORKDIR /
RUN apt-get update && apt-get install -y git sqlite3 procps htop net-tools sockstat binutils graphviz gdb \
RUN apt-get update && apt-get install -y git sqlite3 procps htop net-tools sockstat \
&& rm -rf /var/lib/apt/lists
# Install Google Cloud Profiler agent
@ -61,16 +38,9 @@ RUN mkdir /opt/cdbg && \
wget -qO- https://storage.googleapis.com/cloud-debugger/compute-java/debian-wheezy/cdbg_java_agent_gce.tar.gz | \
tar xvz -C /opt/cdbg
# Disabled while we are memory profiling (these are already in the image)
# RUN useradd --create-home node
RUN useradd --create-home node
# COPY --from=builder /git-bridge.jar /
# COPY --from=builder /build/*.deb /tmp/
# RUN dpkg -i /tmp/libjemalloc*.deb
RUN dpkg -i /build/*.deb
RUN apt-get -y update && /install-all-dev-packages.sh && rm -rf /var/lib/apt/lists
COPY --from=builder /git-bridge.jar /
COPY vendor/envsubst /opt/envsubst
RUN chmod +x /opt/envsubst

View file

@ -1,28 +0,0 @@
#!/bin/bash
apt-cache pkgnames > /tmp/allpackages
BADPKGLIST="libjemalloc2"
NEWPKGLIST="build-essential"
echo "Searching for required -dev and -dbg packages..."
for PKG in `dpkg --get-selections | sed 's/[: ].*//'`
do
# Make sure it's not in the ignore list
echo $BADPKGLIST | grep -q $PKG
if [ $? -eq 0 ]
then
continue
fi
for suffix in dev dbg dbgsym
do
grep -qe "^$PKG-$suffix$" /tmp/allpackages
if [ $? -eq 0 ]
then
NEWPKGLIST=" $NEWPKGLIST $PKG-$suffix"
fi
done
done
apt-get install -y $NEWPKGLIST

View file

@ -22,10 +22,10 @@
</appender>
<!-- Set log levels for the application (or parts of the application). -->
<logger name="uk.ac.ic.wlgitbridge" level="DEBUG" />
<logger name="uk.ac.ic.wlgitbridge" level="INFO" />
<!-- The root log level determines how much our dependencies put in the logs. -->
<root level="DEBUG">
<root level="WARN">
<appender-ref ref="stdout" />
<appender-ref ref="stderr" />
</root>

View file

@ -16,6 +16,4 @@ if [ "$ENABLE_DEBUG_AGENT" == "true" ]; then
GIT_BRIDGE_JVM_ARGS="-agentpath:/opt/cdbg/cdbg_java_agent.so -Dcom.google.cdbg.module=git-bridge -Dcom.google.cdbg.version=$VERSION ${GIT_BRIDGE_JVM_ARGS}"
fi
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so
export MALLOC_CONF=prof:true,lg_prof_interval:30,lg_prof_sample:17,prof_prefix:/tmp/jemalloc
exec java $GIT_BRIDGE_JVM_ARGS -jar /git-bridge.jar /conf/runtime.json