Skip to content

Commit

Permalink
Fix jolokia downloads in 6.8 (#24066)
Browse files Browse the repository at this point in the history
Backport some fixes from 7.x:
* Use sonatype mirror to download jolokia (#12707)
* Try to make jolokia downloads more robust (#13201)

Re-enable integration tests for Metricbeat.
  • Loading branch information
jsoriano authored Feb 17, 2021
1 parent 85d33e5 commit 74865c2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 0 additions & 2 deletions metricbeat/Jenkinsfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ stages:
make check-no-changes;
build:
make: "RACE_DETECTOR=1 make -C metricbeat check testsuite integration-tests-environment"
when:
disabled: true ## Disabled since Integration Testing is broken. See https://github.com/elastic/beats/issues/21961
crosscompile:
make: "make -C metricbeat crosscompile"
windows:
Expand Down
20 changes: 11 additions & 9 deletions metricbeat/module/jolokia/_meta/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ ENV TOMCAT_VERSION 7.0.86
ENV TC apache-tomcat-${TOMCAT_VERSION}
ENV JOLOKIA_VERSION 1.5.0

RUN apk update;\
apk add curl
RUN apk update && \
apk add curl openssl ca-certificates bash

HEALTHCHECK --interval=1s --retries=90 CMD curl -f localhost:8778/jolokia/
EXPOSE 8778

# Prepare a server where jolokia runs in proxy mode
RUN wget http://archive.apache.org/dist/tomcat/tomcat-7/v${TOMCAT_VERSION}/bin/${TC}.tar.gz;\
tar xzf ${TC}.tar.gz -C /usr;\
rm ${TC}.tar.gz;\
sed -i -e 's/Connector port="8080"/Connector port="8778"/g' /usr/${TC}/conf/server.xml;\
wget http://central.maven.org/maven2/org/jolokia/jolokia-war/${JOLOKIA_VERSION}/jolokia-war-${JOLOKIA_VERSION}.war -O /usr/${TC}/webapps/jolokia.war
RUN wget http://archive.apache.org/dist/tomcat/tomcat-7/v${TOMCAT_VERSION}/bin/${TC}.tar.gz && \
tar xzf ${TC}.tar.gz -C /usr && \
rm ${TC}.tar.gz && \
sed -i -e 's/Connector port="8080"/Connector port="8778"/g' /usr/${TC}/conf/server.xml && \
curl -J -L -s -f -o - https://github.com/kadwanev/retry/releases/download/1.0.1/retry-1.0.1.tar.gz | tar xfz - -C /usr/local/bin && \
retry --min 1 --max 180 -- curl -J -L -s -f --show-error -o /usr/${TC}/webapps/jolokia.war \
"https://oss.sonatype.org/content/repositories/releases/org/jolokia/jolokia-war/${JOLOKIA_VERSION}/jolokia-war-${JOLOKIA_VERSION}.war"

# JMX setting to request authentication with remote connection
RUN echo "monitorRole QED" >> /usr/lib/jvm/java-1.8-openjdk/jre/lib/management/jmxremote.password;\
echo "controlRole R&D" >> /usr/lib/jvm/java-1.8-openjdk/jre/lib/management/jmxremote.password;\
RUN echo "monitorRole QED" >> /usr/lib/jvm/java-1.8-openjdk/jre/lib/management/jmxremote.password && \
echo "controlRole R&D" >> /usr/lib/jvm/java-1.8-openjdk/jre/lib/management/jmxremote.password && \
chmod 600 /usr/lib/jvm/java-1.8-openjdk/jre/lib/management/jmxremote.password

ADD jolokia.xml /usr/${TC}/conf/Catalina/localhost/jolokia.xml
Expand Down

0 comments on commit 74865c2

Please sign in to comment.