judovana / benchmarks-in-nested-virtualisation-toolchain

MIT License
0 stars 1 forks source link

Install hsotname to container for radarguns #30

Closed judovana closed 1 year ago

judovana commented 1 year ago

radargun is using hostname command

judovana commented 1 year ago

testing this now

judovana commented 1 year ago

the hsots file have not helped to resolve:

 for SLAVE in $(seq ${SLAVES})
starting slave [1] ...
+ echo 'starting slave [1] ...'
+ JAVA_HOME=/usr/lib/jvm/java
+ bash /root/RadarGun-3.0.0-SNAPSHOT/bin/slave.sh -J ' -Djgroups.udp.mcast_port=46138' -m 127.0.0.1:2103
=== Radargun: slave.sh ===
This script is used to launch the local slave process.

... done! Slave process started on host cf5cc53cb913! Slave PID is 281

+ status=0
+ set -x
starting master ...
+ echo 'starting master ...'
+ JAVA_HOME=/usr/lib/jvm/java
+ bash /root/RadarGun-3.0.0-SNAPSHOT/bin/master.sh -J ' -Djgroups.udp.mcast_port=46138' -c //results/config.xml -t -w
=== Radargun: master.sh ===
This script is used to launch the master process, which coordinates tests run 
on slaves.

Master's PID is 303 running on cf5cc53cb913
/usr/lib/jvm/java/bin/java -Djgroups.udp.mcast_port=46138 -classpath /root/RadarGun-3.0.0-SNAPSHOT/lib/HdrHistogram-2.1.0.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/activation-1.1.1.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/commons-codec-1.6.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/commons-io-2.1.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/commons-logging-1.1.3.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/fast-classpath-scanner-1.93.1.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/httpclient-4.3.6.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/httpcore-4.3.3.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/jboss-annotations-api_1.2_spec-1.0.0.Final.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/jboss-jaxrs-api_2.0_spec-1.0.0.Final.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/jboss-logging-3.1.4.GA.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/jboss-transaction-api-1.0.1.GA.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/jcip-annotations-1.0.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/log4j-1.2.16.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/radargun-cache-3.0.0-SNAPSHOT.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/radargun-core-3.0.0-SNAPSHOT.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/radargun-counter-3.0.0-SNAPSHOT.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/radargun-hdrhistogram-3.0.0-SNAPSHOT.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/radargun-mapreduce-3.0.0-SNAPSHOT.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/radargun-multimap-3.0.0-SNAPSHOT.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/radargun-query-3.0.0-SNAPSHOT.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/radargun-rest-3.0.0-SNAPSHOT.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/resteasy-client-3.0.16.Final.jar:/root/RadarGun-3.0.0-SNAPSHOT/lib/resteasy-jaxrs-3.0.16.Final.jar:/root/RadarGun-3.0.0-SNAPSHOT/conf -Djava.net.preferIPv4Stack=true org.radargun.LaunchMaster --config //results/config.xml
Running in directory: /results/.
PerNodeRollingFileAppender::Not using file prefix.
15:52:52,355 INFO  [org.radargun.LaunchMaster] (main) Running in directory: /results/.
Configuration file is: //results/config.xml
15:52:52,357 INFO  [org.radargun.LaunchMaster] (main) Configuration file is: //results/config.xml
15:52:56,030 ERROR [org.radargun.LaunchMaster] (main) Master failed
java.lang.IllegalStateException: java.net.UnknownHostException: results
    at org.radargun.config.DomConfigParser.parseConfig(DomConfigParser.java:41)
    at org.radargun.LaunchMaster.main(LaunchMaster.java:32)
Caused by: java.net.UnknownHostException: results
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
    at java.net.Socket.connect(Socket.java:589)
    at java.net.Socket.connect(Socket.java:538)
    at sun.net.ftp.impl.FtpClient.doConnect(FtpClient.java:957)
    at sun.net.ftp.impl.FtpClient.tryConnect(FtpClient.java:917)
    at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1012)
    at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:998)
    at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:294)
    at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:393)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:623)
    at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:148)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:805)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:177)
    at org.radargun.config.DomConfigParser.parseConfig(DomConfigParser.java:39)
    ... 1 more
java.lang.IllegalStateException: java.net.UnknownHostException: results
    at org.radargun.config.DomConfigParser.parseConfig(DomConfigParser.java:41)
    at org.radargun.LaunchMaster.main(LaunchMaster.java:32)
Caused by: java.net.UnknownHostException: results
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
    at java.net.Socket.connect(Socket.java:589)
    at java.net.Socket.connect(Socket.java:538)
    at sun.net.ftp.impl.FtpClient.doConnect(FtpClient.java:957)
    at sun.net.ftp.impl.FtpClient.tryConnect(FtpClient.java:917)
    at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1012)
    at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:998)
    at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:294)
    at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:393)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:623)
    at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:148)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:805)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:177)
    at org.radargun.config.DomConfigParser.parseConfig(DomConfigParser.java:39)
    ... 1 more
judovana commented 1 year ago

Hostname returns nonsense in container. am now trying

-CLUSTER_NAME=$( hostname )
+CLUSTER_NAME=localhost
judovana commented 1 year ago

hmm.. nope :(

judovana commented 1 year ago

hm. master.sh is also calling host=hostname

judovana commented 1 year ago

added

 sed 's/`hostname`/localhost/g' -i "${RADARGUN_DIR}/bin/master.sh"
judovana commented 1 year ago

nope.. that was jsut for prnt out... Will try -m localhost

judovana commented 1 year ago

-m was probably ignored... IDK. will try to manually resolve

judovana commented 1 year ago

After adding

echo "127.0.0.1 results" >> /etc/hosts

to radargun runner, as hosts file seesm to be regenerated in runtime.

Configuration file is: //results/config.xml
18:00:46,987 INFO  [org`.radargun.LaunchMaster] (main) Configuration file is: //results/config.xml
18:00:47,002 ERROR [org.radargun.LaunchMaster] (main) Master failed
java.lang.IllegalStateException: java.net.ConnectException: Connection refused
    at org.radargun.config.DomConfigParser.parseConfig(DomConfigParser.java:41)
    at org.radargun.LaunchMaster.main(LaunchMaster.java:32)
Caused by: java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)

Maybe try to run with --network=host?

judovana commented 1 year ago

I had created sample: https://github.com/judovana/ContainerSockets and it did not reprodcued the issue. So I guess it is radargun specific

judovana commented 1 year ago

the result hack needed followiing changes to radargun

--- a/jenkins/benchmarks/radargun/quickstart-radargun.sh
+++ b/jenkins/benchmarks/radargun/quickstart-radargun.sh
@@ -30,7 +30,7 @@ fi

 SLAVES=${1}
 VERIFY_SENTENCE=${2}
-THREADS=30
+THREADS=12

 # calculate 90% of memory in MB and save it in java friendly format
 MEM_90P=$( sh ${SCRIPT_DIR}/../calcMemoryPercentage.sh )
@@ -40,6 +40,7 @@ fi
 if [ "x$OTOOL_BUILD_ARCH" = "xi686" ] ; then
     MEM_90P=1500
 fi
+MEM_90P=4096
 MEM_PER_SLAVE=$( printf %.0f $(echo "$MEM_90P / $SLAVES" | bc -l) )
 MEM_PER_SLAVE=${MEM_PER_SLAVE}M

diff --git a/jenkins/benchmarks/radargun/radargun.sh b/jenkins/benchmarks/radargun/radargun.sh
index 1b1e9d14..14b1c8ac 100644
--- a/jenkins/benchmarks/radargun/radargun.sh
+++ b/jenkins/benchmarks/radargun/radargun.sh
@@ -25,6 +25,8 @@ set -x
 set -e
 set -o pipefail

+cat /etc/hosts || true
+
 function printHelp() {
   cat <<EndOfHelp
 Usage:  bash radargun.sh [arguments]
@@ -121,16 +123,16 @@ function prepareEnv() {
   readonly RADARGUN_DIR_NAME="RadarGun-3.0.0-SNAPSHOT"
   readonly RADARGUN_DIR="$HOME/${RADARGUN_DIR_NAME}"
   readonly RADARGUN_ARCHIVE="${RADARGUN_DIR_NAME}-035c0a2c.zip"
-  readonly RADARGUN_REPORT="${WORKSPACE}/radargun-report"
+  readonly RADARGUN_REPORT="${WORKSPACE}/results"
   readonly RADARGUN_ZIP="/mnt/shared/testsuites/${RADARGUN_ARCHIVE}"

   # clean everything but rpms dir
-  find ${WORKSPACE}  -mindepth 1 ! -name 'rpms' -type d -exec rm -rf {} +
+  #find ${WORKSPACE}  -mindepth 1 ! -name 'rpms' -type d -exec rm -rf {} +
   rm -rf $RADARGUN_DIR

   unzip -q "$RADARGUN_ZIP" -d "$HOME"

-  mkdir "$RADARGUN_REPORT"
+  mkdir "$RADARGUN_REPORT" || true
 }

 function prepareConfig() {
@@ -149,7 +151,8 @@ function prepareConfig() {
   sed -i "s;%{NUM_THREADS};${NUM_THREADS};g;" ${CONFIG}
   sed -i "s;%{DIST_SYNC_CFG};${DIST_SYNC_CFG};g;" ${CONFIG}

-  CLUSTER_NAME=$( hostname )
+  #CLUSTER_NAME=$( hostname )
+  CLUSTER_NAME=results
   sed -i "s;%{CLUSTER_NAME};${CLUSTER_NAME};g;" ${DIST_SYNC_CFG}
   popd

@@ -164,12 +167,13 @@ function run() {
   sudo su -c "sh $SCRIPT_DIR/../memoryProtector.sh memory" &
   for SLAVE in $(seq ${SLAVES}); do
     echo "starting slave [${SLAVE}] ..."
-    JAVA_HOME=${JDK} bash "${RADARGUN_DIR}/bin/slave.sh" -J "${JVM_ARGS}" -m "127.0.0.1:2103"
+    JAVA_HOME=${JDK} bash "${RADARGUN_DIR}/bin/slave.sh" -J "${JVM_ARGS}" -m "results:2103"
   done
   status=0;
   set -x
   echo "starting master ..."
-  JAVA_HOME=${JDK} bash "${RADARGUN_DIR}/bin/master.sh" -J "${JVM_ARGS}" -c "${CONFIG}" -t -w || {
+  sed 's/`hostname`/results/g' -i "${RADARGUN_DIR}/bin/master.sh"
+  JAVA_HOME=${JDK} bash "${RADARGUN_DIR}/bin/master.sh" -J "${JVM_ARGS}" -c "${CONFIG}" -t -w -m results|| {
     status=$?;
     echo "Master exited with non zero $status. Will now continue to gather data (if any) and die later";
   };

but it was nto working at the end:(

judovana commented 1 year ago
@@ -148,8 +150,10 @@ function prepareConfig() {
   sed -i "s;%{HEAP_SIZE};${HEAP_SIZE};g;" ${CONFIG}
   sed -i "s;%{NUM_THREADS};${NUM_THREADS};g;" ${CONFIG}
   sed -i "s;%{DIST_SYNC_CFG};${DIST_SYNC_CFG};g;" ${CONFIG}
+  sed -i "s;127.0.0.1;results;g;" ${CONFIG}

-  CLUSTER_NAME=$( hostname )
+  #CLUSTER_NAME=$( hostname )
+  CLUSTER_NAME=results
   sed -i "s;%{CLUSTER_NAME};${CLUSTER_NAME};g;" ${DIST_SYNC_CFG}
   popd

was missing.... another try.. running out of ideass:(

judovana commented 1 year ago
+  pushd "$RADARGUN_DIR/bin"
+    for x in `ls` ; do
+           sed 's/`hostname`/results/g' -i $x
+    done
+  popd

going on...:(

judovana commented 1 year ago
--- a/jenkins/benchmarks/radargun/dist-sync_template.xml
+++ b/jenkins/benchmarks/radargun/dist-sync_template.xml
@@ -1,8 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>

 <infinispan
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="urn:infinispan:config:8.0 http://www.infinispan.org/schemas/infinispan-config-8.0.xsd"
         xmlns="urn:infinispan:config:9.0">
     <jgroups>
         <stack-file name="jgroupsStack" path="default-configs/default-jgroups-udp.xml"/>
judovana commented 1 year ago

So the reason remain in loading of config file. I ahd tried to amend public class DomConfigParser extends ConfigParser implements ConfigSchema { from package org.radargun.config in runtime via the

   protected DocumentBuilder createDocumentBuilder() throws ParserConfigurationException {
     System.out.println("JEDU?");
     System.err.println("JEDU?");
      DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
      documentBuilderFactory.setValidating(false);
      //documentBuilderFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); // it doesn't work
      documentBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
      documentBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
      documentBuilderFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);
      documentBuilderFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
      //documentBuilderFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
      documentBuilderFactory.setNamespaceAware(true);
      return documentBuilderFactory.newDocumentBuilder();
   }

But unluckily it had not helped. At elast it will allow me to create direct reproducer. Maybe only simple bump of sax will be enough (from in jdk to external)

judovana commented 1 year ago

https://github.com/radargun/radargun/blob/035c0a2c26e0d58dab35262505c6e8a80fdd6679/core/src/main/java/org/radargun/config/DomConfigParser.java#L113

from

https://github.com/radargun/radargun/blob/035c0a2c26e0d58dab35262505c6e8a80fdd6679/core/src/main/java/org/radargun/config/DomConfigParser.java#L36